Skip to content

Commit

Permalink
chore: fix snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekacru committed Oct 13, 2024
1 parent 4bba10e commit ab91e77
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`adapter test > should create schema > __snapshots__/adapter.drizzle 1`] = `
"create table "user" ("id" text primary key, "name" text not null, "email" text not null unique, "emailVerified" boolean not null, "image" text, "createdAt" date not null, "updatedAt" date not null, "twoFactorEnabled" boolean, "twoFactorSecret" text, "twoFactorBackupCodes" text);
"create table "user" ("id" text primary key, "name" text not null, "email" text not null unique, "emailVerified" boolean not null, "image" text, "createdAt" date not null, "updatedAt" date not null, "twoFactorEnabled" boolean);
create table "session" ("id" text primary key, "expiresAt" date not null, "ipAddress" text, "userAgent" text, "userId" text not null references "user" ("id"), "activeOrganizationId" text);
Expand All @@ -13,5 +13,7 @@ create table "organization" ("id" text primary key, "name" text not null, "slug"
create table "member" ("id" text primary key, "organizationId" text not null references "organization" ("id"), "userId" text not null, "email" text not null, "role" text not null, "createdAt" date not null);
create table "invitation" ("id" text primary key, "organizationId" text not null references "organization" ("id"), "email" text not null, "role" text, "status" text not null, "expiresAt" date not null, "inviterId" text not null references "user" ("id"))"
create table "invitation" ("id" text primary key, "organizationId" text not null references "organization" ("id"), "email" text not null, "role" text, "status" text not null, "expiresAt" date not null, "inviterId" text not null references "user" ("id"));
create table "twoFactor" ("id" text primary key, "secret" text not null, "backupCodes" text not null, "userId" text not null references "user" ("id"))"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function generatePrismaSchema({
builder
.model(tableName)
.field(
`${attr.references.model.toLowerCase()}s`,
`${attr.references.model.toLowerCase()}`,
capitalizeFirstLetter(attr.references.model),
)
.attribute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ model Session {
ipAddress String?
userAgent String?
userId String
users User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("session")
}
Expand All @@ -40,7 +40,7 @@ model Account {
accountId String
providerId String
userId String
users User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
accessToken String?
refreshToken String?
idToken String?
Expand Down Expand Up @@ -73,16 +73,14 @@ datasource db {
}
model User {
id String @id
name String
email String
emailVerified Boolean
image String?
createdAt DateTime
updatedAt DateTime
twoFactorEnabled Boolean?
twoFactorSecret String?
twoFactorBackupCodes String?
id String @id
name String
email String
emailVerified Boolean
image String?
createdAt DateTime
updatedAt DateTime
twoFactorEnabled Boolean?
@@unique([email])
@@map("user")
Expand All @@ -94,7 +92,7 @@ model Session {
ipAddress String?
userAgent String?
userId String
users User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("session")
}
Expand All @@ -104,7 +102,7 @@ model Account {
accountId String
providerId String
userId String
users User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
accessToken String?
refreshToken String?
idToken String?
Expand All @@ -122,5 +120,15 @@ model Verification {
@@map("verification")
}
model TwoFactor {
id String @id
secret String
backupCodes String
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("twoFactor")
}
"
`;

0 comments on commit ab91e77

Please sign in to comment.