mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-24 16:43:37 +01:00
fix(migrations): remove explicit BEGIN/COMMIT from migrations 0012-0015
applyMigration() already wraps each file in a db.Begin()/tx.Commit() transaction. The inner BEGIN/COMMIT in these files caused the outer transaction to commit early, leaving applyMigration trying to insert into schema_version on an idle connection: pq: unexpected transaction status idle Affected: 0012_guild_invites, 0014_return_guilds, 0015_tournament.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
BEGIN;
|
||||
|
||||
-- Dedicated table for guild-initiated scout invitations, separate from
|
||||
-- player-initiated applications. This gives each invitation a real serial PK
|
||||
-- so the client's InvitationID field can map to an actual database row
|
||||
@@ -19,5 +17,3 @@ FROM guild_applications
|
||||
WHERE application_type = 'invited';
|
||||
|
||||
DELETE FROM guild_applications WHERE application_type = 'invited';
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE public.guilds ADD COLUMN IF NOT EXISTS return_type SMALLINT NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tournaments (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
@@ -44,5 +42,3 @@ CREATE TABLE IF NOT EXISTS tournament_results (
|
||||
stage_handle INTEGER NOT NULL DEFAULT 0,
|
||||
submitted_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
|
||||
Reference in New Issue
Block a user