All checks were successful
Build Docker Image / build (push) Successful in 1m23s
- Created a new snapshot file for version 6 of the database schema. - Added tables for arc, character, characterHistory, characterOverride, characterScrapeValidation, config, devilFruit, userCharacterHistory, account, session, user, and verification with appropriate columns and constraints. - Updated the journal to include new entries for version 6. - Modified the userCharacterHistory table to enforce unique constraints on userId and characterHistoryId. - Enhanced daily game logic to track user attempts and prevent duplicate entries for the same day.
15 lines
860 B
SQL
15 lines
860 B
SQL
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
CREATE TABLE `__new_userCharacterHistory` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`userId` text,
|
|
`characterHistoryId` text,
|
|
`tryCount` integer NOT NULL,
|
|
`createdAt` integer NOT NULL,
|
|
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action,
|
|
FOREIGN KEY (`characterHistoryId`) REFERENCES `characterHistory`(`id`) ON UPDATE no action ON DELETE no action
|
|
);
|
|
--> statement-breakpoint
|
|
INSERT INTO `__new_userCharacterHistory`("id", "userId", "characterHistoryId", "tryCount", "createdAt") SELECT "id", "userId", "characterId", "tryCount", "createdAt" FROM `userCharacterHistory`;--> statement-breakpoint
|
|
DROP TABLE `userCharacterHistory`;--> statement-breakpoint
|
|
ALTER TABLE `__new_userCharacterHistory` RENAME TO `userCharacterHistory`;--> statement-breakpoint
|
|
PRAGMA foreign_keys=ON; |