Prisma migrate to Postgres

This commit is contained in:
aronmal 2023-07-08 13:39:49 +02:00
parent dbb9bd8476
commit 0291e6656e
Signed by: aronmal
GPG key ID: 816B7707426FC612
5 changed files with 13 additions and 7 deletions

View file

@ -49,8 +49,8 @@ const options: NextAuthOptions = {
}, },
}, },
pages: { pages: {
signIn: "/login", signIn: "/signin",
signOut: "/logout", signOut: "/signout",
// error: '/auth/error', // Error code passed in query string as ?error= // error: '/auth/error', // Error code passed in query string as ?error=
// verifyRequest: '/auth/verify-request', // (used for check email message) // verifyRequest: '/auth/verify-request', // (used for check email message)
// newUser: '/auth/new-user' // New users will be directed here on first sign in (leave the property out if not of interest) // newUser: '/auth/new-user' // New users will be directed here on first sign in (leave the property out if not of interest)

View file

@ -22,6 +22,8 @@ export const HitScalarFieldEnumSchema = z.enum(['id','x','y','hit','user_GameId'
export const MoveScalarFieldEnumSchema = z.enum(['id','createdAt','index','type','x','y','orientation','user_game_id']); export const MoveScalarFieldEnumSchema = z.enum(['id','createdAt','index','type','x','y','orientation','user_game_id']);
export const QueryModeSchema = z.enum(['default','insensitive']);
export const SessionScalarFieldEnumSchema = z.enum(['id','sessionToken','userId','expires']); export const SessionScalarFieldEnumSchema = z.enum(['id','sessionToken','userId','expires']);
export const ShipScalarFieldEnumSchema = z.enum(['id','size','variant','x','y','orientation','user_GameId']); export const ShipScalarFieldEnumSchema = z.enum(['id','size','variant','x','y','orientation','user_GameId']);
@ -1898,6 +1900,7 @@ export const StringFilterSchema: z.ZodType<Prisma.StringFilter> = z.object({
contains: z.string().optional(), contains: z.string().optional(),
startsWith: z.string().optional(), startsWith: z.string().optional(),
endsWith: z.string().optional(), endsWith: z.string().optional(),
mode: z.lazy(() => QueryModeSchema).optional(),
not: z.union([ z.string(),z.lazy(() => NestedStringFilterSchema) ]).optional(), not: z.union([ z.string(),z.lazy(() => NestedStringFilterSchema) ]).optional(),
}).strict(); }).strict();
@ -1912,6 +1915,7 @@ export const StringNullableFilterSchema: z.ZodType<Prisma.StringNullableFilter>
contains: z.string().optional(), contains: z.string().optional(),
startsWith: z.string().optional(), startsWith: z.string().optional(),
endsWith: z.string().optional(), endsWith: z.string().optional(),
mode: z.lazy(() => QueryModeSchema).optional(),
not: z.union([ z.string(),z.lazy(() => NestedStringNullableFilterSchema) ]).optional().nullable(), not: z.union([ z.string(),z.lazy(() => NestedStringNullableFilterSchema) ]).optional().nullable(),
}).strict(); }).strict();
@ -2011,6 +2015,7 @@ export const StringWithAggregatesFilterSchema: z.ZodType<Prisma.StringWithAggreg
contains: z.string().optional(), contains: z.string().optional(),
startsWith: z.string().optional(), startsWith: z.string().optional(),
endsWith: z.string().optional(), endsWith: z.string().optional(),
mode: z.lazy(() => QueryModeSchema).optional(),
not: z.union([ z.string(),z.lazy(() => NestedStringWithAggregatesFilterSchema) ]).optional(), not: z.union([ z.string(),z.lazy(() => NestedStringWithAggregatesFilterSchema) ]).optional(),
_count: z.lazy(() => NestedIntFilterSchema).optional(), _count: z.lazy(() => NestedIntFilterSchema).optional(),
_min: z.lazy(() => NestedStringFilterSchema).optional(), _min: z.lazy(() => NestedStringFilterSchema).optional(),
@ -2028,6 +2033,7 @@ export const StringNullableWithAggregatesFilterSchema: z.ZodType<Prisma.StringNu
contains: z.string().optional(), contains: z.string().optional(),
startsWith: z.string().optional(), startsWith: z.string().optional(),
endsWith: z.string().optional(), endsWith: z.string().optional(),
mode: z.lazy(() => QueryModeSchema).optional(),
not: z.union([ z.string(),z.lazy(() => NestedStringNullableWithAggregatesFilterSchema) ]).optional().nullable(), not: z.union([ z.string(),z.lazy(() => NestedStringNullableWithAggregatesFilterSchema) ]).optional().nullable(),
_count: z.lazy(() => NestedIntNullableFilterSchema).optional(), _count: z.lazy(() => NestedIntNullableFilterSchema).optional(),
_min: z.lazy(() => NestedStringNullableFilterSchema).optional(), _min: z.lazy(() => NestedStringNullableFilterSchema).optional(),

View file

@ -7,7 +7,7 @@ generator client {
} }
datasource db { datasource db {
provider = "mysql" provider = "postgres"
url = env("DATABASE_URL") url = env("DATABASE_URL")
} }
@ -17,13 +17,13 @@ model Account {
type String type String
provider String provider String
providerAccountId String @map("provider_account_id") providerAccountId String @map("provider_account_id")
refresh_token String? @db.Text refresh_token String?
access_token String? @db.Text access_token String?
expires_at Int? expires_at Int?
ext_expires_in Int? ext_expires_in Int?
token_type String? token_type String?
scope String? scope String?
id_token String? @db.Text id_token String?
session_state String? session_state String?
oauth_token_secret String? oauth_token_secret String?
oauth_token String? oauth_token String?
@ -49,7 +49,7 @@ model User {
name String? name String?
email String? @unique email String? @unique
emailVerified DateTime? @map("email_verified") emailVerified DateTime? @map("email_verified")
image String? @db.Text image String?
createdAt DateTime @default(now()) @map(name: "created_at") createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @updatedAt @map(name: "updated_at") updatedAt DateTime @updatedAt @map(name: "updated_at")
games User_Game[] games User_Game[]