Skip to content

Commit 9b44baa

Browse files
remove unnecessary columns
1 parent fdf6cd5 commit 9b44baa

File tree

4 files changed

+7
-36
lines changed

4 files changed

+7
-36
lines changed

prisma/migrations/20250925142454_initial_tables_for_auth_feature/migration.sql renamed to prisma/migrations/20250925154009_initial_tables_for_auth_feature/migration.sql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CREATE TABLE "public"."user" (
1212
"updatedAt" TIMESTAMP(3) NOT NULL,
1313
"emailVerified" BOOLEAN NOT NULL DEFAULT false,
1414
"image" TEXT,
15-
"position" TEXT,
1615

1716
CONSTRAINT "user_pkey" PRIMARY KEY ("id")
1817
);
@@ -21,11 +20,8 @@ CREATE TABLE "public"."user" (
2120
CREATE TABLE "public"."account" (
2221
"id" TEXT NOT NULL,
2322
"userId" TEXT NOT NULL,
24-
"provider" TEXT NOT NULL,
25-
"providerAccountId" TEXT NOT NULL,
2623
"accessToken" TEXT,
2724
"refreshToken" TEXT,
28-
"expiresAt" INTEGER,
2925
"accountId" TEXT NOT NULL,
3026
"providerId" TEXT NOT NULL,
3127
"idToken" TEXT,
@@ -68,9 +64,6 @@ CREATE TABLE "public"."verification" (
6864
-- CreateIndex
6965
CREATE UNIQUE INDEX "user_email_key" ON "public"."user"("email");
7066

71-
-- CreateIndex
72-
CREATE UNIQUE INDEX "account_provider_providerAccountId_key" ON "public"."account"("provider", "providerAccountId");
73-
7467
-- CreateIndex
7568
CREATE UNIQUE INDEX "session_token_key" ON "public"."session"("token");
7669

prisma/schema.prisma

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ model User {
1616
createdAt DateTime @default(now())
1717
updatedAt DateTime @updatedAt
1818
19-
accounts Account[]
19+
accounts Account[]
2020
2121
// #### UNCOMMENT THIS WHEN RELATED FEATURE IS READY ####
2222
// posts PostAuthor[] // posts authored (many-to-many)
@@ -27,22 +27,18 @@ model User {
2727
// following Follow[] @relation("UserFollowing")
2828
// leaderboard LeaderboardSnapshot[]
2929
30-
emailVerified Boolean @default(false)
30+
emailVerified Boolean @default(false)
3131
image String?
32-
position String?
3332
sessions Session[]
3433
3534
@@map("user")
3635
}
3736

3837
model Account {
39-
id String @id @default(cuid())
40-
userId String
41-
provider String
42-
providerAccountId String
43-
accessToken String?
44-
refreshToken String?
45-
expiresAt Int?
38+
id String @id @default(cuid())
39+
userId String
40+
accessToken String?
41+
refreshToken String?
4642
4743
user User @relation(fields: [userId], references: [id])
4844
@@ -56,7 +52,6 @@ model Account {
5652
createdAt DateTime @default(now())
5753
updatedAt DateTime @updatedAt
5854
59-
@@unique([provider, providerAccountId])
6055
@@map("account")
6156
}
6257

prisma/seeds/user.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ export async function seedUsers() {
2626
create: [
2727
{
2828
accountId: userId,
29-
provider: 'email-password',
30-
providerAccountId: userId,
31-
providerId: 'credential',
29+
providerId: 'email-password',
3230
password: hashedPassword,
3331
},
3432
],

src/lib/auth.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,6 @@ export const auth = betterAuth({
5050
provider: 'postgresql',
5151
}),
5252

53-
user: {
54-
additionalFields: {
55-
role: {
56-
type: 'string',
57-
required: false,
58-
defaultValue: 'VIEWER',
59-
input: false,
60-
},
61-
position: {
62-
type: 'string',
63-
required: false,
64-
},
65-
},
66-
},
67-
6853
// Setup your rate limiting for auth api
6954
rateLimit: {
7055
enabled: true,

0 commit comments

Comments
 (0)