Enhance entrypoint script for migration handling: Improve error resolution process by adding direct database updates for missing migration files, and refine output messages for clarity during deployment.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m6s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m6s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
-- AlterTable
|
||||
-- SQLite doesn't support DROP COLUMN directly, so we need to recreate the table
|
||||
CREATE TABLE "SitePreferences_new" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"homeBackground" TEXT,
|
||||
"eventsBackground" TEXT,
|
||||
"leaderboardBackground" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
|
||||
-- Copy data without primaryColor column
|
||||
INSERT INTO "SitePreferences_new" ("id", "homeBackground", "eventsBackground", "leaderboardBackground", "createdAt", "updatedAt")
|
||||
SELECT "id", "homeBackground", "eventsBackground", "leaderboardBackground", "createdAt", "updatedAt"
|
||||
FROM "SitePreferences";
|
||||
|
||||
-- Drop old table
|
||||
DROP TABLE "SitePreferences";
|
||||
|
||||
-- Rename new table
|
||||
ALTER TABLE "SitePreferences_new" RENAME TO "SitePreferences";
|
||||
|
||||
Reference in New Issue
Block a user