postgres fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-16 08:56:24 +11:00
parent bc84931c37
commit ff1ec3f4aa

View File

@@ -124,8 +124,8 @@ CREATE TABLE IF NOT EXISTS snapshot_registry (
if err != nil {
return err
}
_, err = dbConn.ExecContext(ctx, `ALTER TABLE snapshot_registry ADD COLUMN snapshot_count BIGINT NOT NULL DEFAULT 0`)
if err != nil && !strings.Contains(strings.ToLower(err.Error()), "column \"snapshot_count\" of relation \"snapshot_registry\" already exists") {
_, err = dbConn.ExecContext(ctx, `ALTER TABLE snapshot_registry ADD COLUMN IF NOT EXISTS snapshot_count BIGINT NOT NULL DEFAULT 0`)
if err != nil {
slog.Warn("failed to add snapshot_count column", "error", err)
return err
}