This commit is contained in:
Oscar
2026-05-26 10:14:26 +03:00
commit 1f1633de8a
39 changed files with 10534 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"telegramId" BIGINT NOT NULL,
"username" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"isNew" BOOLEAN NOT NULL DEFAULT true
);
INSERT INTO "new_User" ("createdAt", "id", "telegramId", "username") SELECT "createdAt", "id", "telegramId", "username" FROM "User";
DROP TABLE "User";
ALTER TABLE "new_User" RENAME TO "User";
CREATE UNIQUE INDEX "User_telegramId_key" ON "User"("telegramId");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;