-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_user" (
    "id" TEXT NOT NULL PRIMARY KEY,
    "name" TEXT,
    "email" TEXT,
    "emailVerified" BOOLEAN NOT NULL DEFAULT false,
    "firstPaymentDone" BOOLEAN NOT NULL DEFAULT false,
    "verified" BOOLEAN NOT NULL DEFAULT false,
    "island" TEXT,
    "house_name" TEXT,
    "id_card" TEXT,
    "dob" DATETIME,
    "image" TEXT,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" DATETIME NOT NULL,
    "phoneNumber" TEXT NOT NULL,
    "phoneNumberVerified" BOOLEAN NOT NULL DEFAULT false,
    "role" TEXT,
    "lang" TEXT
);
INSERT INTO "new_user" ("createdAt", "dob", "email", "emailVerified", "firstPaymentDone", "house_name", "id", "id_card", "image", "island", "lang", "name", "phoneNumber", "phoneNumberVerified", "role", "updatedAt", "verified") SELECT "createdAt", "dob", "email", "emailVerified", "firstPaymentDone", "house_name", "id", "id_card", "image", "island", "lang", "name", "phoneNumber", "phoneNumberVerified", "role", "updatedAt", "verified" FROM "user";
DROP TABLE "user";
ALTER TABLE "new_user" RENAME TO "user";
CREATE UNIQUE INDEX "user_email_key" ON "user"("email");
CREATE UNIQUE INDEX "user_id_card_key" ON "user"("id_card");
CREATE UNIQUE INDEX "user_phoneNumber_key" ON "user"("phoneNumber");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
