feat: create new character table and migrate data from existing character table
All checks were successful
Build Docker Image / build (push) Successful in 1m17s

This commit is contained in:
2026-03-05 22:00:41 +01:00
parent a7775783af
commit b4601a5caf
4 changed files with 1210 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_character` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`gender` text,
`age` integer,
`affiliations` text,
`devilFruitId` text,
`hakiObservation` integer DEFAULT false,
`hakiArmament` integer DEFAULT false,
`hakiConqueror` integer DEFAULT false,
`bounty` integer DEFAULT 0,
`height` real,
`origin` text,
`firstAppearance` integer NOT NULL,
`pictureUrl` text,
`epithets` text,
`status` text,
`arcId` text,
`url` text,
`isInDailyMode` integer DEFAULT false,
FOREIGN KEY (`devilFruitId`) REFERENCES `devilFruit`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`arcId`) REFERENCES `arc`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
INSERT INTO `__new_character`("id", "name", "gender", "age", "affiliations", "devilFruitId", "hakiObservation", "hakiArmament", "hakiConqueror", "bounty", "height", "origin", "firstAppearance", "pictureUrl", "epithets", "status", "arcId", "url", "isInDailyMode") SELECT "id", "name", "gender", "age", "affiliations", "devilFruitId", "hakiObservation", "hakiArmament", "hakiConqueror", "bounty", "height", "origin", "firstAppearance", "pictureUrl", "epithets", "status", "arcId", "url", "isInDailyMode" FROM `character`;--> statement-breakpoint
DROP TABLE `character`;--> statement-breakpoint
ALTER TABLE `__new_character` RENAME TO `character`;--> statement-breakpoint
PRAGMA foreign_keys=ON;

File diff suppressed because it is too large Load Diff

View File

@@ -50,6 +50,13 @@
"when": 1772562364830, "when": 1772562364830,
"tag": "0006_premium_mesmero", "tag": "0006_premium_mesmero",
"breakpoints": true "breakpoints": true
},
{
"idx": 7,
"version": "6",
"when": 1772735982970,
"tag": "0007_gray_shinko_yamashiro",
"breakpoints": true
} }
] ]
} }

View File

@@ -49,7 +49,7 @@ export const character = sqliteTable('character', {
status: text('status').$type<Status | null>(), status: text('status').$type<Status | null>(),
arcId: text('arcId').references(() => arc.id), arcId: text('arcId').references(() => arc.id),
url: text('url'), url: text('url'),
isInDailyMode: integer('isInDailyMode', { mode: 'boolean' }).default(true) isInDailyMode: integer('isInDailyMode', { mode: 'boolean' }).default(false)
}); });
// Define the character override table schema // Define the character override table schema