Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-24 17:30:21 +03:00
parent a972565859
commit a56a0a8b21
3 changed files with 111 additions and 15 deletions

View File

@@ -70,6 +70,16 @@ CREATE TABLE IF NOT EXISTS mk_product_series_job_log (
error_text TEXT NOT NULL DEFAULT ''
)`,
`CREATE INDEX IF NOT EXISTS ix_mk_product_series_job_log_started ON mk_product_series_job_log (started_at DESC)`,
`
CREATE TABLE IF NOT EXISTS mk_product_series_apply_state (
row_key TEXT PRIMARY KEY,
last_apply_at TIMESTAMPTZ NOT NULL DEFAULT now(),
last_apply_kind TEXT NOT NULL DEFAULT '',
last_series_ids TEXT NOT NULL DEFAULT '',
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT ck_mk_product_series_apply_state_kind CHECK (last_apply_kind IN ('', 'rules', 'fallback'))
)`,
`CREATE INDEX IF NOT EXISTS ix_mk_product_series_apply_state_updated ON mk_product_series_apply_state (updated_at DESC)`,
}
for _, stmt := range stmts {
if _, err := pg.Exec(stmt); err != nil {