feat: Add production schema deployment scripts
- Create apply-schema-prod.js for deploying schema to any SurrealDB instance - Create deploy-schema.sh to easily deploy using .prod.env - Add npm scripts: schema:apply (local) and schema:deploy (production) Usage: pnpm schema:deploy # Deploy to production using .prod.env 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
23
scripts/deploy-schema.sh
Executable file
23
scripts/deploy-schema.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Deploy schema to production SurrealDB
|
||||
# This script reads from .prod.env and applies the schema
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -f .prod.env ]; then
|
||||
echo "Error: .prod.env file not found"
|
||||
echo "Please create .prod.env with your production database credentials"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Loading production environment variables..."
|
||||
export $(cat .prod.env | grep -v '^#' | grep '=' | xargs)
|
||||
|
||||
echo "Applying schema to production database..."
|
||||
node scripts/apply-schema-prod.js
|
||||
|
||||
echo ""
|
||||
echo "✓ Schema deployment complete!"
|
||||
echo ""
|
||||
echo "You can now test your deployment at: https://www.ponderants.com"
|
||||
Reference in New Issue
Block a user