mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-21 23:22:34 +01:00
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:
@@ -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 $$;
|
||||
Reference in New Issue
Block a user