Skip to content

Commit

Permalink
fix (maestro): create db, add unique constraint (#2742)
Browse files Browse the repository at this point in the history
  • Loading branch information
etaques authored Oct 10, 2023
1 parent b448764 commit 6b55482
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions maestro/postgres/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func migrateDB(db *sqlx.DB) error {
{
Id: "1",
Up: []string{
`CREATE DATABASE IF NOT EXISTS maestro;`,
`CREATE TABLE IF NOT EXISTS deployments (
id UUID NOT NULL DEFAULT gen_random_uuid(),
owner_id VARCHAR(255),
Expand All @@ -47,6 +48,7 @@ func migrateDB(db *sqlx.DB) error {
last_collector_deploy_time TIMESTAMP,
last_collector_stop_time TIMESTAMP
);`,
`ALTER TABLE "deployments" ADD CONSTRAINT "deployments_owner_id_sink_id" UNIQUE ("owner_id", "sink_id");`,
},
Down: []string{
"DROP TABLE deployments",
Expand Down

0 comments on commit 6b55482

Please sign in to comment.