feat: add database migrations for environments, apps, deployments
This commit is contained in:
16
src/main/resources/db/migration/V009__create_deployments.sql
Normal file
16
src/main/resources/db/migration/V009__create_deployments.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE deployments (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
app_id UUID NOT NULL REFERENCES apps(id) ON DELETE CASCADE,
|
||||
version INTEGER NOT NULL,
|
||||
image_ref VARCHAR(500) NOT NULL,
|
||||
desired_status VARCHAR(20) NOT NULL DEFAULT 'RUNNING',
|
||||
observed_status VARCHAR(20) NOT NULL DEFAULT 'BUILDING',
|
||||
orchestrator_metadata JSONB DEFAULT '{}',
|
||||
error_message TEXT,
|
||||
deployed_at TIMESTAMPTZ,
|
||||
stopped_at TIMESTAMPTZ,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
UNIQUE(app_id, version)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_deployments_app_id ON deployments(app_id);
|
||||
Reference in New Issue
Block a user