test(channelserver): add comprehensive GuildRepository tests

Add 34 tests covering all previously-untested GuildRepository methods:
invitations/scouts, guild posts, alliances, adventures, treasure
hunts, meals, kill tracking, and edge cases like disband with
alliance cleanup.

Fix test schema setup to apply the 9.2 update schema after init.sql,
which bridges v9.1.0 to v9.2.0 and resolves 9 pre-existing test
failures caused by missing columns (rp_today, created_at, etc.).

Make patch schemas 14 and 19 idempotent so they no longer fail when
applied against a schema that already has the target state (e.g.
festival_color type already renamed, legacy column names).
This commit is contained in:
Houmgaor
2026-02-20 22:53:16 +01:00
parent 93f28c721a
commit 7436ac0870
4 changed files with 980 additions and 18 deletions

View File

@@ -1,6 +1,4 @@
BEGIN;
CREATE TABLE festa_submissions (
CREATE TABLE IF NOT EXISTS festa_submissions (
character_id int NOT NULL,
guild_id int NOT NULL,
trial_type int NOT NULL,
@@ -8,8 +6,11 @@ CREATE TABLE festa_submissions (
timestamp timestamp with time zone NOT NULL
);
ALTER TABLE guild_characters DROP COLUMN souls;
ALTER TABLE guild_characters DROP COLUMN IF EXISTS souls;
ALTER TYPE festival_colour RENAME TO festival_color;
END;
DO $$ BEGIN
ALTER TYPE festival_colour RENAME TO festival_color;
EXCEPTION
WHEN undefined_object THEN NULL;
WHEN duplicate_object THEN NULL;
END $$;