25 lines
959 B
SQL
25 lines
959 B
SQL
/*
|
|
Warnings:
|
|
|
|
- Added the required column `domain` to the `User` table without a default value. This is not possible if the table is not empty.
|
|
|
|
*/
|
|
-- RedefineTables
|
|
PRAGMA foreign_keys=OFF;
|
|
CREATE TABLE "new_User" (
|
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
"username" TEXT NOT NULL,
|
|
"domain" TEXT NOT NULL,
|
|
"password" TEXT NOT NULL,
|
|
"email" TEXT NOT NULL,
|
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updatedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"deletedAt" DATETIME,
|
|
"pubkey" TEXT NOT NULL
|
|
);
|
|
INSERT INTO "new_User" ("createdAt", "deletedAt", "email", "id", "password", "pubkey", "updatedAt", "username") SELECT "createdAt", "deletedAt", "email", "id", "password", "pubkey", "updatedAt", "username" FROM "User";
|
|
DROP TABLE "User";
|
|
ALTER TABLE "new_User" RENAME TO "User";
|
|
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
|
|
PRAGMA foreign_key_check;
|
|
PRAGMA foreign_keys=ON;
|