deploy.sh does not include alembic migrations — tables never created on first deploy
Bug
scripts/deploy.sh copies server/, client/out/, app.yaml, and requirements.txt to the staging directory, but does not copy alembic/ or alembic.ini.
On app startup, run_migrations() searches for alembic.ini in these paths:
<app_root>/alembic.ini/app/python/source_code/alembic.ini./alembic.ini
Since none of these exist in the deployed package, the migration is silently skipped. As a result, the database tables (projects, conversations, messages, project_backup, executions) are never created, and the app fails immediately on first use with:
psycopg.errors.UndefinedTable: relation "projects" does not exist
Steps to Reproduce
- Follow the deployment guide: create Lakebase, create app, add resource, configure
app.yaml, run./scripts/deploy.sh <app-name> - Open the app URL
- Attempt to create a project → Error: Failed to create project
Fix
Add the following lines to the staging copy section of deploy.sh:
# Copy alembic migrations
cp alembic.ini "$STAGING_DIR/"
cp -r alembic "$STAGING_DIR/"
Workaround
Manually create the tables after first deploy by generating a Lakebase OAuth token and running create_tables() from a local Python session with LAKEBASE_PG_URL set.
This appears to already be fixed on main. The current deploy.sh (lines 217-219) includes:
# Copy Alembic migrations
echo " Copying Alembic migrations..."
cp alembic.ini "$STAGING_DIR/"
cp -r alembic "$STAGING_DIR/"
Could this issue be closed?