Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-24 17:39:38 +03:00
parent a56a0a8b21
commit aca2cf5d02
2 changed files with 59 additions and 0 deletions

View File

@@ -80,6 +80,9 @@ CREATE TABLE IF NOT EXISTS mk_product_series_apply_state (
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)`,
// Backward compatible schema upgrades.
`ALTER TABLE mk_product_series_apply_state ADD COLUMN IF NOT EXISTS invalid_streak INTEGER NOT NULL DEFAULT 0`,
`ALTER TABLE mk_product_series_apply_state ADD COLUMN IF NOT EXISTS last_invalid_at TIMESTAMPTZ`,
}
for _, stmt := range stmts {
if _, err := pg.Exec(stmt); err != nil {