Two migrations landed on `main` with the same number:
- `000596_template_usage_stats_session_usage.{up,down}.sql` (#29109)
- `000596_aibridge_workspace_context.{up,down}.sql` (#29235)
This makes golang-migrate fail to initialize the source driver:
```
failed to init driver with path .: duplicate migration file: 000596_template_usage_stats_session_usage.down.sql
```
Every job that touches the database is failing on `main` as a result
(gen, sqlc-vet, E2E, offline docs lint, PostgreSQL 17,
Linux/macOS/Windows test suites, race), plus
`coderd/database/gen/dump/main.go` panics.
This renames the later-merged AI Gateway migration to `000597`. The SQL
content is unchanged — it is a pure rename, so no schema dump or fixture
regeneration is required. `migration000596_test.go` and the
`testdata/fixtures/000596_template_usage_stats_session_usage.up.sql`
fixture belong to the earlier migration and are untouched.
Verified the source driver now initializes and resolves `597` as the
final version.
Created on behalf of @ibetitsmike
cc @johnstcn @EhabY
Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
14 lines
556 B
SQL
14 lines
556 B
SQL
-- Attach optional workspace context to an AI Bridge interception.
|
|
-- Two valid states:
|
|
-- (1) NULL - workspace unknown (default, backwards-compatible)
|
|
-- (2) non-NULL - workspace ID recorded at interception time
|
|
--
|
|
-- No foreign key constraint as historical attribution must survive deletion of
|
|
-- the attributed workspace.
|
|
|
|
ALTER TABLE aibridge_interceptions
|
|
ADD COLUMN workspace_id UUID NULL;
|
|
|
|
COMMENT ON COLUMN aibridge_interceptions.workspace_id IS
|
|
'The workspace in which the agent ran. NULL when no workspace context is available.';
|