veza/veza-backend-api/migrations
senke 3f326e8266
Some checks failed
Veza CI / Rust (Stream Server) (push) Successful in 4m22s
Security Scan / Secret Scanning (gitleaks) (push) Successful in 1m5s
Veza CI / Frontend (Web) (push) Failing after 17m19s
E2E Playwright / e2e (full) (push) Failing after 20m28s
Veza CI / Backend (Go) (push) Successful in 21m31s
Veza CI / Notify on failure (push) Successful in 4s
fix(ci): unblock CI red — gofmt + e2e webserver reuse + orders.hyperswitch_payment_id (Day 4)
Three pre-existing infra issues surfaced by the Day 1→Day 3 push wave.
Each is independent — bundled here because the goal is "ci.yml + e2e.yml
green" before the v1.0.9 tag, and they're all small.

(1) gofmt — ci.yml golangci-lint v2 step

  Five files were unformatted on main. Pre-existing (untouched by my
  Item G work, but the formatter caught them now):
    - internal/api/router.go
    - internal/core/marketplace/reconcile_hyperswitch_test.go
    - internal/models/user.go
    - internal/monitoring/ledger_metrics.go
    - internal/monitoring/ledger_metrics_test.go
  Pure whitespace via `gofmt -w` — no behavior change.

(2) e2e silent-fail — playwright webServer port collision

  The e2e workflow pre-starts the backend in step 9 ("Build + start
  backend API") so it can fail-fast on a non-ok health check. But
  playwright.config.ts had `reuseExistingServer: !process.env.CI` on
  the backend webServer entry — meaning in CI Playwright tried to
  spawn a SECOND backend on port 18080. The spawn collided with
  EADDRINUSE and Playwright silently exited before printing any test
  output. The artifact upload then warned "No files were found"
  because tests/e2e/playwright-report/ never got written, and the job
  ended in `Failure` for an unrelated reason (the artifact upload
  step's GHESNotSupportedError).

  Fix: backend `reuseExistingServer: true` always — workflow + dev
  both pre-start backend on 18080. Vite stays `!CI` because the
  workflow doesn't pre-start it. Comment in playwright.config.ts
  documents the symptom so the next person debugging gets the
  pointer immediately.

(3) orders.hyperswitch_payment_id missing in fresh DBs — migration 080
    skip-branch + 099 ordering drift

  Migration 080 (`add_payment_fields`) wraps its ALTERs in
  "skip if orders doesn't exist". At authoring time orders existed
  earlier in the migration sequence; that ordering has since shifted
  (orders is now created at 099_z_create_orders.sql, AFTER 080).
  Result: in any freshly-migrated DB (CI, fresh dev, future restore
  drills) migration 080 takes the skip branch and the columns are
  never added — even though the Order model and the marketplace code
  rely on them.

  Symptom: every CI run logs
    pq: column "hyperswitch_payment_id" does not exist
  from the periodic ledger_metrics worker. Order checkout would also
  fail to persist payment_id at write time, breaking reconciliation.

  Fix: append-only migration 987 with idempotent
  `ADD COLUMN IF NOT EXISTS` + a partial index on the reconciliation
  hot path. Production envs that did pick up 080 in the original
  order are no-ops; fresh envs converge to the same end state.
  Rollback in migrations/rollback/.

Verified locally:
  $ cd veza-backend-api && go build ./... && VEZA_SKIP_INTEGRATION=1 \
      go test -short -count=1 ./internal/...
  (all green)

SKIP_TESTS=1: backend-only Go + Playwright config + SQL. Frontend
unit tests irrelevant to this commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:03:55 +02:00
..
archive chore(release): v0.942 — Compress (migration consolidation procedure, mark script) 2026-03-02 19:05:54 +01:00
rollback fix(ci): unblock CI red — gofmt + e2e webserver reuse + orders.hyperswitch_payment_id (Day 4) 2026-04-27 12:03:55 +02:00
000_mark_consolidated.sql fix(release): v1.0.1 — Conformité complète ROADMAP checklist 2026-03-03 20:17:54 +01:00
001_extensions_and_types.sql P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
010_auth_and_users.sql P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
011_cleanup_refresh_tokens.sql docs: update walkthrough with launch instructions and test credentials 2026-01-04 01:44:23 +01:00
012_add_user_social_links.sql stabilisation commit 2026-01-04 01:44:23 +01:00
020_create_sessions.sql refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
020_z_migration_rename_records.sql Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
021_rbac_and_profiles.sql Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
030_files_management.sql P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
040_streaming_core.sql stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
041_streaming_analytics.sql P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
042_media_processing.sql P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
043_analytics_events.sql P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
044_playlist_share_links.sql [BE-DB-005] be-db: Create migration for playlist_share_link table 2025-12-24 15:09:44 +01:00
045_user_follows.sql [BE-DB-006] be-db: Create migration for user_follows table 2025-12-24 15:10:34 +01:00
046_user_blocks.sql [BE-DB-007] be-db: Create migration for user_blocks table 2025-12-24 15:11:32 +01:00
047_notifications.sql [BE-DB-008] be-db: Create migration for notifications table 2025-12-24 15:12:11 +01:00
048_search_indexes.sql [BE-DB-009] be-db: Add indexes for search queries 2025-12-24 15:13:03 +01:00
049_composite_indexes.sql [T0-002] fix(rust): Corriger erreurs compilation Rust 2026-01-04 01:44:20 +01:00
050_data_validation_constraints.sql [FIX] Fix migration errors for missing tables 2026-01-04 01:44:13 +01:00
051_legacy_chat.sql Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
052_stats_views.sql Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
053_audit_triggers.sql Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
060_job_queue.sql feat(backend-worker): persist job queue in postgres 2025-12-06 13:32:32 +01:00
069_groups_and_members.sql chore(migrations): add 069, 089, 090, 091 for v0.302 2026-02-21 05:47:14 +01:00
070_create_social_tables.sql feat: Visual masterpiece - true light mode & premium UI 2026-01-11 02:32:21 +01:00
075_create_webhooks.sql fix(webhooks): add DB migration and avoid 500 toast on developer portal 2026-02-10 21:11:32 +01:00
076_create_gear_items.sql Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
077_create_live_streams.sql Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
078_add_missing_indexes.sql perf(db): add missing indexes for file_id and cover_art_file_id 2026-02-14 18:32:05 +01:00
080_add_payment_fields.sql chore: consolidate CI, E2E, backend and frontend updates 2026-02-17 16:43:21 +01:00
081_create_playback_analytics.sql fix(backend): remediation plan — tests, playback_analytics, job queue, gamification 2026-02-17 16:01:45 +01:00
082_create_api_keys.sql feat(developer): add API keys backend (Lot C) 2026-02-20 00:18:36 +01:00
083_add_user_banner.sql feat(profile): add profile banner (B1) 2026-02-20 14:56:25 +01:00
084_add_track_lyrics.sql feat(tracks): add lyrics model and endpoints (E3) 2026-02-20 15:36:28 +01:00
085_add_track_tags.sql feat(tracks): add suggested tags endpoint and UI (E4) 2026-02-20 15:38:51 +01:00
086_add_pg_trgm.sql feat(search): add pg_trgm extension for fuzzy search 2026-02-20 18:34:50 +01:00
087_queue_sessions.sql feat(queue): add queue_sessions and shared_queue_items models 2026-02-20 18:39:33 +01:00
088_user_presence.sql feat(presence): migration 088 user_presence (P1.1) 2026-02-21 05:22:33 +01:00
089_group_join_requests.sql feat(groups): S2.1-S2.5 request join, invite, roles, feed groups, my groups 2026-02-21 05:48:59 +01:00
090_push_subscriptions.sql chore(migrations): add 069, 089, 090, 091 for v0.302 2026-02-21 05:47:14 +01:00
091_user_presence_invisible.sql chore(migrations): add 069, 089, 090, 091 for v0.302 2026-02-21 05:47:14 +01:00
092_group_invitations.sql feat(groups): S2.1-S2.5 request join, invite, roles, feed groups, my groups 2026-02-21 05:48:59 +01:00
093_notification_preferences.sql feat(notifications): N1.1-N1.3 Web Push subscription, send on events, preferences 2026-02-21 16:41:39 +01:00
094_create_products.sql feat: backend, stream server & infra improvements 2026-03-18 11:36:06 +01:00
094_user_presence_rich.sql feat(presence): P2.1 rich presence, P2.2 invisible mode 2026-02-21 16:47:09 +01:00
095_products_enrichment.sql feat(marketplace): add migrations 095-097 for products enrichment, previews, images 2026-02-22 14:05:19 +01:00
096_product_previews.sql feat(marketplace): add migrations 095-097 for products enrichment, previews, images 2026-02-22 14:05:19 +01:00
097_product_images.sql feat(marketplace): add migrations 095-097 for products enrichment, previews, images 2026-02-22 14:05:19 +01:00
098_product_licenses.sql feat(marketplace): add migration 098 product_licenses, ProductLicense model, GET /licenses/mine 2026-02-22 14:16:24 +01:00
099_promo_codes.sql feat(v0.501): Sprint 4 -- Cloud frontend + Gear advanced 2026-02-22 18:30:49 +01:00
099_z_create_orders.sql feat: backend, stream server & infra improvements 2026-03-18 11:36:06 +01:00
100_orders_discount.sql feat(v0.501): Sprint 4 -- Cloud frontend + Gear advanced 2026-02-22 18:30:49 +01:00
101_product_reviews.sql feat(marketplace): add product_reviews migration 2026-02-22 16:04:14 +01:00
102_license_revoked.sql feat(marketplace): add license revoked_at migration 2026-02-22 16:18:01 +01:00
103_tracks_waveform.sql feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
104_user_folders.sql feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
105_user_files.sql feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
106_user_storage_quotas.sql feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
107_gear_is_public.sql feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
108_gear_images.sql feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
109_read_receipts.sql feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
110_delivered_status.sql feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
111_message_reactions.sql feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
112_messages_extra_columns.sql feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
113_messages_fts.sql feat(chat): Redis rate limiter, persistent presence, PostgreSQL full-text search 2026-02-22 21:17:51 +01:00
114_seller_stripe_accounts.sql feat(seller): add seller_stripe_accounts migration and model 2026-02-23 22:11:11 +01:00
115_seller_transfers.sql feat(commerce): add 115_seller_transfers migration 2026-02-23 22:54:56 +01:00
116_seller_transfers_retry.sql feat(marketplace): add migration 116 — retry columns for seller_transfers 2026-02-23 23:30:41 +01:00
117_live_streams_go_live.sql feat(live): add migration 117 and model fields for Go Live 2026-02-24 09:51:21 +01:00
118_user_preferences.sql feat(users): add user_preferences migration with appearance fields 2026-02-25 09:45:03 +01:00
119_cloud_file_versions.sql feat(db): add migrations 119-122 for cloud versions, gear warranty/documents/repairs 2026-02-25 13:30:49 +01:00
120_gear_warranty.sql feat(db): add migrations 119-122 for cloud versions, gear warranty/documents/repairs 2026-02-25 13:30:49 +01:00
121_gear_documents.sql feat(db): add migrations 119-122 for cloud versions, gear warranty/documents/repairs 2026-02-25 13:30:49 +01:00
122_gear_repairs.sql feat(db): add migrations 119-122 for cloud versions, gear warranty/documents/repairs 2026-02-25 13:30:49 +01:00
123_invalidate_tokens_rs256.sql v0.9.1 2026-03-05 19:22:31 +01:00
124_room_invitations.sql v0.9.7 2026-03-06 18:52:08 +01:00
125_follow_counts_triggers.sql stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
126_tags_genres_discover.sql feat(v0.10.1): Tags & Genres discover - F351-F355 2026-03-09 01:52:56 +01:00
127_moderation_keywords.sql feat(v0.10.3): Commentaires & Interactions Sociales - F201-F215 2026-03-09 10:30:47 +01:00
128_track_reposts.sql feat(v0.10.3): Commentaires & Interactions Sociales - F201-F215 2026-03-09 10:30:47 +01:00
129_playlist_editorial.sql stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
132_quiet_hours.sql stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
133_notification_grouping.sql stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
134_weekly_digest_prefs.sql feat(v0.10.5): Notifications complètes — F551-F555 2026-03-10 10:02:21 +01:00
900_triggers_and_functions.sql P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
910_create_audit_logs.sql stabilizing apps/web: THIRD BATCH - FIXED Playwright 2025-12-21 18:55:51 -05:00
920_add_performance_indexes.sql [BE-DB-001] backend-database: Add database indexes for performance-critical queries 2025-12-23 01:47:33 +01:00
930_add_missing_foreign_keys.sql [BE-DB-002] backend-database: Add foreign key constraints where missing 2025-12-23 01:48:33 +01:00
931_add_refresh_tokens_updated_at.sql docs: update walkthrough with launch instructions and test credentials 2026-01-04 01:44:23 +01:00
932_add_user_deletion_fields.sql feat(users): account deletion hardening with anonymization, S3 cleanup, session revocation 2026-02-25 19:51:21 +01:00
933_reports.sql feat(admin): moderation queue with reports CRUD 2026-02-25 19:53:04 +01:00
934_announcements.sql feat(admin): global announcements CRUD and public banner endpoint 2026-02-25 19:55:21 +01:00
935_feature_flags.sql feat(admin): feature flags CRUD with DB persistence 2026-02-25 19:56:24 +01:00
936_oauth_states_pkce.sql release(v0.902): Sentinel - PKCE OAuth, token encryption, redirect validation, CHAT_JWT_SECRET 2026-02-26 19:49:15 +01:00
936_webrtc_flag.sql chore(release): v0.971 — Phantom (gamification removal, WebRTC Beta, limits doc) 2026-03-02 19:25:37 +01:00
940_performance_indexes_v0951.sql chore(release): v0.951 — Loadtest (500 req/s, 1000 WS, 50 uploads, perf indexes) 2026-03-02 19:22:38 +01:00
941_notification_prefs_defaults_v0105.sql feat(v0.10.5): Notifications Complètes (F551-F555) 2026-03-10 10:09:32 +01:00
942_create_co_listening_sessions.sql feat: backend, stream server & infra improvements 2026-03-18 11:36:06 +01:00
943_create_track_stems.sql feat(v0.10.7): Collaboration Temps Réel F481-F483 2026-03-10 13:34:16 +01:00
944_create_data_exports.sql feat(gdpr): v0.10.8 portabilité données - export ZIP async, suppression compte, hard delete cron 2026-03-10 13:57:04 +01:00
945_creator_analytics_v0110.sql feat(v0.11.0): F381-F385 database migrations and models for creator analytics 2026-03-10 16:21:01 +01:00
946_advanced_analytics_v0111.sql feat(v0.11.1): F396-F399 database migrations for advanced analytics 2026-03-10 17:12:01 +01:00
947_moderation_advanced_v0112.sql feat(v0.11.2): F411-F420 database migrations and models for advanced moderation 2026-03-10 17:41:38 +01:00
948_marketplace_complete_v0120.sql feat(v0.12.0): F252-F254 database migrations for marketplace completion 2026-03-10 18:51:26 +01:00
949_subscription_plans_v0121.sql feat(v0.12.1): database migrations for subscription plans 2026-03-10 19:36:29 +01:00
950_distribution_platforms_v0122.sql feat(v0.12.2): database migrations for distribution platforms 2026-03-10 19:54:00 +01:00
951_education_courses_v0123.sql feat(v0.12.3): database migrations for education courses 2026-03-11 09:44:54 +01:00
960_performance_indexes_v0124.sql feat: backend, stream server & infra improvements 2026-03-18 11:36:06 +01:00
970_password_login_history_v0130.sql feat(v0.13.0): conformité features partielles — CAPTCHA, password history, login history, SMS 2FA 2026-03-12 09:31:50 +01:00
971_security_advanced_v0133.sql feat(v0.13.3): complete - Polish Sécurité Avancée 2026-03-13 10:09:01 +01:00
972_seller_kyc_v0135.sql feat(v0.13.5): polish marketplace & compliance — KYC, support, payout E2E 2026-03-13 14:57:19 +01:00
973_support_tickets_v0135.sql feat(v0.13.5): polish marketplace & compliance — KYC, support, payout E2E 2026-03-13 14:57:19 +01:00
974_track_likes_updated_at.sql feat: backend — config, handlers, services, logging, migration 2026-03-23 15:46:57 +01:00
975_add_two_factor_columns.sql fix(backend): add password change endpoint and 2FA migration 2026-03-25 23:39:28 +01:00
976_platform_settings.sql fix(middleware): persist maintenance flag via platform_settings table 2026-04-16 14:57:06 +02:00
977_users_promoted_to_creator_at.sql feat(backend,web): self-service creator role upgrade via /settings 2026-04-16 18:35:07 +02:00
978_refunds_table.sql feat(backend,marketplace): refund reverse-charge with idempotent webhook 2026-04-17 02:02:57 +02:00
979_refunds_unique_partial.sql chore(release): v1.0.6.1 — partial UNIQUE on refunds.hyperswitch_refund_id 2026-04-17 02:42:24 +02:00
980_void_unpaid_subscriptions.sql chore(release): v1.0.6.2 — subscription payment-gate bypass hotfix 2026-04-17 12:21:53 +02:00
981_seller_transfers_stripe_reversal_id.sql refactor(connect): persist stripe_transfer_id on create + retry — v1.0.7 item A 2026-04-17 13:08:39 +02:00
982_seller_transfers_reversal_pending_index.sql feat(marketplace): seller transfer state machine matrix — v1.0.7 item B day 1 2026-04-17 14:13:02 +02:00
983_seller_transfers_reversal_pending_not_null.sql fix(migrations): make 983 CHECK constraint idempotent via DO block 2026-04-18 04:08:14 +02:00
984_hyperswitch_webhook_log.sql feat(webhooks): persist raw hyperswitch payloads to audit log — v1.0.7 item E 2026-04-18 02:44:58 +02:00
985_tracks_storage_backend.sql feat(storage): add track storage_backend column + config prep (v1.0.8 P0) 2026-04-23 19:54:28 +02:00
986_user_subscriptions_pending_payment_index.sql fix(ci): unblock CI red after v1.0.9 sprint 1 push (migration 986 + config tests) 2026-04-27 05:02:07 +02:00
987_orders_hyperswitch_payment_id_backfill.sql fix(ci): unblock CI red — gofmt + e2e webserver reuse + orders.hyperswitch_payment_id (Day 4) 2026-04-27 12:03:55 +02:00