feat: add Clerk Auth
This commit is contained in:
parent
3f9d4f94ff
commit
a80db3d80a
19 changed files with 146 additions and 225 deletions
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `password` on the `User` table. All the data in the column will be lost.
|
||||
- You are about to drop the `Session` table. If the table is not empty, all the data it contains will be lost.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "Session" DROP CONSTRAINT "Session_userId_fkey";
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX "User_email_key";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" DROP COLUMN "password";
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "Session";
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `clerkId` to the `User` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" ADD COLUMN "clerkId" TEXT NOT NULL;
|
||||
|
|
@ -15,24 +15,12 @@ datasource db {
|
|||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
id String @id @default(uuid())
|
||||
clerkId String
|
||||
|
||||
email String? @unique
|
||||
name String
|
||||
password String
|
||||
posts Post[]
|
||||
sessions Session[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id @default(uuid())
|
||||
|
||||
expiresAt DateTime
|
||||
user User @relation(references: [id], fields: [userId])
|
||||
userId String
|
||||
email String?
|
||||
name String
|
||||
posts Post[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue