remove stupid

This commit is contained in:
pavel 2026-05-14 23:51:33 +02:00
commit 4cfc6be322
7 changed files with 16 additions and 26 deletions

View file

@ -23,7 +23,6 @@ func (a *App) migrate(ctx context.Context) error {
repo_private BOOLEAN NOT NULL DEFAULT true,
service_name TEXT NOT NULL,
route_host TEXT NOT NULL DEFAULT '',
target_port INT NOT NULL DEFAULT 8000,
deploy_token TEXT NOT NULL DEFAULT '',
provision_state TEXT NOT NULL DEFAULT 'provisioned',
provision_error TEXT NOT NULL DEFAULT '',
@ -48,7 +47,6 @@ func (a *App) migrate(ctx context.Context) error {
}
alter := []string{
`ALTER TABLE projects ADD COLUMN IF NOT EXISTS route_host TEXT NOT NULL DEFAULT '';`,
`ALTER TABLE projects ADD COLUMN IF NOT EXISTS target_port INT NOT NULL DEFAULT 8000;`,
`ALTER TABLE projects ADD COLUMN IF NOT EXISTS workspace_id BIGINT REFERENCES workspaces(id) ON DELETE RESTRICT;`,
`ALTER TABLE projects ADD COLUMN IF NOT EXISTS deploy_token TEXT NOT NULL DEFAULT '';`,
`ALTER TABLE projects ADD COLUMN IF NOT EXISTS repo_private BOOLEAN NOT NULL DEFAULT true;`,
@ -63,6 +61,9 @@ func (a *App) migrate(ctx context.Context) error {
return err
}
}
if _, err := a.db.ExecContext(ctx, `ALTER TABLE projects DROP COLUMN IF EXISTS target_port;`); err != nil {
return err
}
rows, err := a.db.QueryContext(ctx, `SELECT id FROM projects WHERE deploy_token=''`)
if err != nil {
return err