From 58e6997eeefd277a7b96ad2e3fae97b10da6f807 Mon Sep 17 00:00:00 2001 From: Trey T Date: Tue, 14 Apr 2026 16:17:23 -0500 Subject: [PATCH] Fix migration numbering collision and bump Dockerfile to Go 1.25 The `000016_task_template_id` and `000017_drop_task_template_regions_join` migrations introduced on gitea collided with the existing unpadded 016/017 migrations (authtoken_created_at, fk_indexes). Renamed them to 021/022 so they extend the shipped sequence instead of replacing real migrations. Also removed the padded 000012-000015 files which were duplicate content of the shipped 012-015 unpadded migrations. Dockerfile builder image bumped from golang:1.24-alpine to 1.25-alpine to match go.mod's `go 1.25` directive. Co-Authored-By: Claude Opus 4.6 (1M context) --- Dockerfile | 2 +- migrations/000012_webhook_event_log.down.sql | 1 - migrations/000012_webhook_event_log.up.sql | 9 --------- .../000013_business_constraints.down.sql | 5 ----- migrations/000013_business_constraints.up.sql | 19 ------------------- .../000014_task_version_column.down.sql | 1 - migrations/000014_task_version_column.up.sql | 1 - migrations/000015_targeted_indexes.down.sql | 3 --- migrations/000015_targeted_indexes.up.sql | 14 -------------- ...down.sql => 021_task_template_id.down.sql} | 0 ..._id.up.sql => 021_task_template_id.up.sql} | 0 ..._drop_task_template_regions_join.down.sql} | 0 ...22_drop_task_template_regions_join.up.sql} | 0 13 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 migrations/000012_webhook_event_log.down.sql delete mode 100644 migrations/000012_webhook_event_log.up.sql delete mode 100644 migrations/000013_business_constraints.down.sql delete mode 100644 migrations/000013_business_constraints.up.sql delete mode 100644 migrations/000014_task_version_column.down.sql delete mode 100644 migrations/000014_task_version_column.up.sql delete mode 100644 migrations/000015_targeted_indexes.down.sql delete mode 100644 migrations/000015_targeted_indexes.up.sql rename migrations/{000016_task_template_id.down.sql => 021_task_template_id.down.sql} (100%) rename migrations/{000016_task_template_id.up.sql => 021_task_template_id.up.sql} (100%) rename migrations/{000017_drop_task_template_regions_join.down.sql => 022_drop_task_template_regions_join.down.sql} (100%) rename migrations/{000017_drop_task_template_regions_join.up.sql => 022_drop_task_template_regions_join.up.sql} (100%) diff --git a/Dockerfile b/Dockerfile index f51c912..46bf669 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY admin/ . RUN npm run build # Go build stage -FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS builder ARG TARGETARCH # Install build dependencies diff --git a/migrations/000012_webhook_event_log.down.sql b/migrations/000012_webhook_event_log.down.sql deleted file mode 100644 index f8c69d8..0000000 --- a/migrations/000012_webhook_event_log.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE IF EXISTS webhook_event_log; diff --git a/migrations/000012_webhook_event_log.up.sql b/migrations/000012_webhook_event_log.up.sql deleted file mode 100644 index e0bfc56..0000000 --- a/migrations/000012_webhook_event_log.up.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE IF NOT EXISTS webhook_event_log ( - id SERIAL PRIMARY KEY, - event_id VARCHAR(255) NOT NULL, - provider VARCHAR(20) NOT NULL, - event_type VARCHAR(100) NOT NULL, - processed_at TIMESTAMPTZ DEFAULT NOW(), - payload_hash VARCHAR(64), - UNIQUE(provider, event_id) -); diff --git a/migrations/000013_business_constraints.down.sql b/migrations/000013_business_constraints.down.sql deleted file mode 100644 index e905c1d..0000000 --- a/migrations/000013_business_constraints.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE notifications_notificationpreference DROP CONSTRAINT IF EXISTS uq_notif_pref_user; -ALTER TABLE subscriptions_usersubscription DROP CONSTRAINT IF EXISTS uq_subscription_user; -ALTER TABLE notifications_notification DROP CONSTRAINT IF EXISTS chk_notification_sent_consistency; -ALTER TABLE subscriptions_usersubscription DROP CONSTRAINT IF EXISTS chk_subscription_tier; -ALTER TABLE task_task DROP CONSTRAINT IF EXISTS chk_task_not_cancelled_and_archived; diff --git a/migrations/000013_business_constraints.up.sql b/migrations/000013_business_constraints.up.sql deleted file mode 100644 index 46c5560..0000000 --- a/migrations/000013_business_constraints.up.sql +++ /dev/null @@ -1,19 +0,0 @@ --- Prevent task from being both cancelled and archived simultaneously -ALTER TABLE task_task ADD CONSTRAINT chk_task_not_cancelled_and_archived - CHECK (NOT (is_cancelled = true AND is_archived = true)); - --- Subscription tier must be a valid value -ALTER TABLE subscriptions_usersubscription ADD CONSTRAINT chk_subscription_tier - CHECK (tier IN ('free', 'pro')); - --- Notification: sent_at must be set when sent is true -ALTER TABLE notifications_notification ADD CONSTRAINT chk_notification_sent_consistency - CHECK ((sent = false) OR (sent = true AND sent_at IS NOT NULL)); - --- One subscription per user -ALTER TABLE subscriptions_usersubscription ADD CONSTRAINT uq_subscription_user - UNIQUE (user_id); - --- One notification preference per user -ALTER TABLE notifications_notificationpreference ADD CONSTRAINT uq_notif_pref_user - UNIQUE (user_id); diff --git a/migrations/000014_task_version_column.down.sql b/migrations/000014_task_version_column.down.sql deleted file mode 100644 index b0f2d88..0000000 --- a/migrations/000014_task_version_column.down.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE task_task DROP COLUMN IF EXISTS version; diff --git a/migrations/000014_task_version_column.up.sql b/migrations/000014_task_version_column.up.sql deleted file mode 100644 index 961db2b..0000000 --- a/migrations/000014_task_version_column.up.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE task_task ADD COLUMN IF NOT EXISTS version INTEGER NOT NULL DEFAULT 1; diff --git a/migrations/000015_targeted_indexes.down.sql b/migrations/000015_targeted_indexes.down.sql deleted file mode 100644 index 6144e7d..0000000 --- a/migrations/000015_targeted_indexes.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP INDEX IF EXISTS idx_document_residence_active; -DROP INDEX IF EXISTS idx_notification_user_unread; -DROP INDEX IF EXISTS idx_task_kanban_query; diff --git a/migrations/000015_targeted_indexes.up.sql b/migrations/000015_targeted_indexes.up.sql deleted file mode 100644 index 844f871..0000000 --- a/migrations/000015_targeted_indexes.up.sql +++ /dev/null @@ -1,14 +0,0 @@ --- Kanban: composite partial index for active task queries by residence with due date ordering -CREATE INDEX IF NOT EXISTS idx_task_kanban_query - ON task_task (residence_id, next_due_date, due_date) - WHERE is_cancelled = false AND is_archived = false; - --- Notifications: partial index for unread count (hot query) -CREATE INDEX IF NOT EXISTS idx_notification_user_unread - ON notifications_notification (user_id, read) - WHERE read = false; - --- Documents: partial index for active documents by residence -CREATE INDEX IF NOT EXISTS idx_document_residence_active - ON documents_document (residence_id, is_active) - WHERE is_active = true; diff --git a/migrations/000016_task_template_id.down.sql b/migrations/021_task_template_id.down.sql similarity index 100% rename from migrations/000016_task_template_id.down.sql rename to migrations/021_task_template_id.down.sql diff --git a/migrations/000016_task_template_id.up.sql b/migrations/021_task_template_id.up.sql similarity index 100% rename from migrations/000016_task_template_id.up.sql rename to migrations/021_task_template_id.up.sql diff --git a/migrations/000017_drop_task_template_regions_join.down.sql b/migrations/022_drop_task_template_regions_join.down.sql similarity index 100% rename from migrations/000017_drop_task_template_regions_join.down.sql rename to migrations/022_drop_task_template_regions_join.down.sql diff --git a/migrations/000017_drop_task_template_regions_join.up.sql b/migrations/022_drop_task_template_regions_join.up.sql similarity index 100% rename from migrations/000017_drop_task_template_regions_join.up.sql rename to migrations/022_drop_task_template_regions_join.up.sql