mirror of
https://gitlab.com/mobicoop/v3/service/auth.git
synced 2026-01-02 19:02:40 +00:00
multiple usernames
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "auth" (
|
||||
"uuid" UUID NOT NULL,
|
||||
"username" TEXT NOT NULL,
|
||||
"password" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "auth_pkey" PRIMARY KEY ("uuid")
|
||||
);
|
||||
26
prisma/migrations/20221220135616_init/migration.sql
Normal file
26
prisma/migrations/20221220135616_init/migration.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "Type" AS ENUM ('EMAIL', 'PHONE');
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "auth" (
|
||||
"uuid" UUID NOT NULL,
|
||||
"password" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "auth_pkey" PRIMARY KEY ("uuid")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "username" (
|
||||
"username" TEXT NOT NULL,
|
||||
"uuid" UUID NOT NULL,
|
||||
"type" "Type" NOT NULL DEFAULT 'EMAIL',
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "username_pkey" PRIMARY KEY ("username")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "username_uuid_type_key" ON "username"("uuid", "type");
|
||||
Reference in New Issue
Block a user