Implement PostgreSQL support and update database configuration: Migrate from SQLite to PostgreSQL by updating the Prisma schema, Docker configuration, and environment variables. Add PostgreSQL dependencies and adjust the database connection logic in the application. Enhance .gitignore to exclude PostgreSQL-related files and directories.
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled

This commit is contained in:
Julien Froidefond
2025-12-17 11:41:32 +01:00
parent 1f59cc7f9d
commit 8ad09ab9c8
45 changed files with 1238 additions and 109 deletions

View File

@@ -16,8 +16,8 @@ import type * as Prisma from "./internal/prismaNamespace"
export type StringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -25,20 +25,21 @@ export type StringFilter<$PrismaModel = never> = {
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
mode?: Prisma.QueryMode
not?: Prisma.NestedStringFilter<$PrismaModel> | string
}
export type EnumRoleFilter<$PrismaModel = never> = {
equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel>
in?: $Enums.Role[]
notIn?: $Enums.Role[]
in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumRoleFilter<$PrismaModel> | $Enums.Role
}
export type IntFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -48,8 +49,8 @@ export type IntFilter<$PrismaModel = never> = {
export type StringNullableFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -57,13 +58,14 @@ export type StringNullableFilter<$PrismaModel = never> = {
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
mode?: Prisma.QueryMode
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
}
export type DateTimeFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
@@ -73,8 +75,8 @@ export type DateTimeFilter<$PrismaModel = never> = {
export type EnumCharacterClassNullableFilter<$PrismaModel = never> = {
equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null
in?: $Enums.CharacterClass[] | null
notIn?: $Enums.CharacterClass[] | null
in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel> | $Enums.CharacterClass | null
}
@@ -85,8 +87,8 @@ export type SortOrderInput = {
export type StringWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -94,6 +96,7 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = {
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
mode?: Prisma.QueryMode
not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedStringFilter<$PrismaModel>
@@ -102,8 +105,8 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = {
export type EnumRoleWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel>
in?: $Enums.Role[]
notIn?: $Enums.Role[]
in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumRoleWithAggregatesFilter<$PrismaModel> | $Enums.Role
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumRoleFilter<$PrismaModel>
@@ -112,8 +115,8 @@ export type EnumRoleWithAggregatesFilter<$PrismaModel = never> = {
export type IntWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -128,8 +131,8 @@ export type IntWithAggregatesFilter<$PrismaModel = never> = {
export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -137,6 +140,7 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
mode?: Prisma.QueryMode
not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedStringNullableFilter<$PrismaModel>
@@ -145,8 +149,8 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
@@ -159,8 +163,8 @@ export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
export type EnumCharacterClassNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null
in?: $Enums.CharacterClass[] | null
notIn?: $Enums.CharacterClass[] | null
in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel> | $Enums.CharacterClass | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel>
@@ -169,15 +173,15 @@ export type EnumCharacterClassNullableWithAggregatesFilter<$PrismaModel = never>
export type EnumEventTypeFilter<$PrismaModel = never> = {
equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.EventType[]
notIn?: $Enums.EventType[]
in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> | $Enums.EventType
}
export type IntNullableFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -187,8 +191,8 @@ export type IntNullableFilter<$PrismaModel = never> = {
export type EnumEventTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.EventType[]
notIn?: $Enums.EventType[]
in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.EventType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumEventTypeFilter<$PrismaModel>
@@ -197,8 +201,8 @@ export type EnumEventTypeWithAggregatesFilter<$PrismaModel = never> = {
export type IntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -226,15 +230,15 @@ export type BoolWithAggregatesFilter<$PrismaModel = never> = {
export type EnumChallengeStatusFilter<$PrismaModel = never> = {
equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel>
in?: $Enums.ChallengeStatus[]
notIn?: $Enums.ChallengeStatus[]
in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel> | $Enums.ChallengeStatus
}
export type DateTimeNullableFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
@@ -244,8 +248,8 @@ export type DateTimeNullableFilter<$PrismaModel = never> = {
export type EnumChallengeStatusWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel>
in?: $Enums.ChallengeStatus[]
notIn?: $Enums.ChallengeStatus[]
in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel> | $Enums.ChallengeStatus
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel>
@@ -254,8 +258,8 @@ export type EnumChallengeStatusWithAggregatesFilter<$PrismaModel = never> = {
export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
@@ -268,8 +272,8 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
export type NestedStringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -282,15 +286,15 @@ export type NestedStringFilter<$PrismaModel = never> = {
export type NestedEnumRoleFilter<$PrismaModel = never> = {
equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel>
in?: $Enums.Role[]
notIn?: $Enums.Role[]
in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumRoleFilter<$PrismaModel> | $Enums.Role
}
export type NestedIntFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -300,8 +304,8 @@ export type NestedIntFilter<$PrismaModel = never> = {
export type NestedStringNullableFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -314,8 +318,8 @@ export type NestedStringNullableFilter<$PrismaModel = never> = {
export type NestedDateTimeFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
@@ -325,15 +329,15 @@ export type NestedDateTimeFilter<$PrismaModel = never> = {
export type NestedEnumCharacterClassNullableFilter<$PrismaModel = never> = {
equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null
in?: $Enums.CharacterClass[] | null
notIn?: $Enums.CharacterClass[] | null
in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel> | $Enums.CharacterClass | null
}
export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[]
notIn?: string[]
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -349,8 +353,8 @@ export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
export type NestedEnumRoleWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.Role | Prisma.EnumRoleFieldRefInput<$PrismaModel>
in?: $Enums.Role[]
notIn?: $Enums.Role[]
in?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.Role[] | Prisma.ListEnumRoleFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumRoleWithAggregatesFilter<$PrismaModel> | $Enums.Role
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumRoleFilter<$PrismaModel>
@@ -359,8 +363,8 @@ export type NestedEnumRoleWithAggregatesFilter<$PrismaModel = never> = {
export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -375,8 +379,8 @@ export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
export type NestedFloatFilter<$PrismaModel = never> = {
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel>
in?: number[]
notIn?: number[]
in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel>
notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel>
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
@@ -386,8 +390,8 @@ export type NestedFloatFilter<$PrismaModel = never> = {
export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null
notIn?: string[] | null
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
@@ -403,8 +407,8 @@ export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
export type NestedIntNullableFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -414,8 +418,8 @@ export type NestedIntNullableFilter<$PrismaModel = never> = {
export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[]
notIn?: Date[] | string[]
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
@@ -428,8 +432,8 @@ export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
export type NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.CharacterClass | Prisma.EnumCharacterClassFieldRefInput<$PrismaModel> | null
in?: $Enums.CharacterClass[] | null
notIn?: $Enums.CharacterClass[] | null
in?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
notIn?: $Enums.CharacterClass[] | Prisma.ListEnumCharacterClassFieldRefInput<$PrismaModel> | null
not?: Prisma.NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel> | $Enums.CharacterClass | null
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedEnumCharacterClassNullableFilter<$PrismaModel>
@@ -438,15 +442,15 @@ export type NestedEnumCharacterClassNullableWithAggregatesFilter<$PrismaModel =
export type NestedEnumEventTypeFilter<$PrismaModel = never> = {
equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.EventType[]
notIn?: $Enums.EventType[]
in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> | $Enums.EventType
}
export type NestedEnumEventTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel>
in?: $Enums.EventType[]
notIn?: $Enums.EventType[]
in?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
notIn?: $Enums.EventType[] | Prisma.ListEnumEventTypeFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumEventTypeWithAggregatesFilter<$PrismaModel> | $Enums.EventType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumEventTypeFilter<$PrismaModel>
@@ -455,8 +459,8 @@ export type NestedEnumEventTypeWithAggregatesFilter<$PrismaModel = never> = {
export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
@@ -471,8 +475,8 @@ export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = {
export type NestedFloatNullableFilter<$PrismaModel = never> = {
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
in?: number[] | null
notIn?: number[] | null
in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
@@ -495,15 +499,15 @@ export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
export type NestedEnumChallengeStatusFilter<$PrismaModel = never> = {
equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel>
in?: $Enums.ChallengeStatus[]
notIn?: $Enums.ChallengeStatus[]
in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel> | $Enums.ChallengeStatus
}
export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
@@ -513,8 +517,8 @@ export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
export type NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.ChallengeStatus | Prisma.EnumChallengeStatusFieldRefInput<$PrismaModel>
in?: $Enums.ChallengeStatus[]
notIn?: $Enums.ChallengeStatus[]
in?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
notIn?: $Enums.ChallengeStatus[] | Prisma.ListEnumChallengeStatusFieldRefInput<$PrismaModel>
not?: Prisma.NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel> | $Enums.ChallengeStatus
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumChallengeStatusFilter<$PrismaModel>
@@ -523,8 +527,8 @@ export type NestedEnumChallengeStatusWithAggregatesFilter<$PrismaModel = never>
export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
in?: Date[] | string[] | null
notIn?: Date[] | string[] | null
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>

File diff suppressed because one or more lines are too long

View File

@@ -958,6 +958,9 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
*/
export const TransactionIsolationLevel = runtime.makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
} as const)
@@ -1083,6 +1086,14 @@ export const SortOrder = {
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
export const QueryMode = {
default: 'default',
insensitive: 'insensitive'
} as const
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
export const NullsOrder = {
first: 'first',
last: 'last'
@@ -1104,6 +1115,13 @@ export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel,
/**
* Reference to a field of type 'String[]'
*/
export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'>
/**
* Reference to a field of type 'Role'
*/
@@ -1111,6 +1129,13 @@ export type EnumRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel
/**
* Reference to a field of type 'Role[]'
*/
export type ListEnumRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Role[]'>
/**
* Reference to a field of type 'Int'
*/
@@ -1118,6 +1143,13 @@ export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'In
/**
* Reference to a field of type 'Int[]'
*/
export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'>
/**
* Reference to a field of type 'DateTime'
*/
@@ -1125,6 +1157,13 @@ export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel
/**
* Reference to a field of type 'DateTime[]'
*/
export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'>
/**
* Reference to a field of type 'CharacterClass'
*/
@@ -1132,6 +1171,13 @@ export type EnumCharacterClassFieldRefInput<$PrismaModel> = FieldRefInputType<$P
/**
* Reference to a field of type 'CharacterClass[]'
*/
export type ListEnumCharacterClassFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CharacterClass[]'>
/**
* Reference to a field of type 'EventType'
*/
@@ -1139,6 +1185,13 @@ export type EnumEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$Prisma
/**
* Reference to a field of type 'EventType[]'
*/
export type ListEnumEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'EventType[]'>
/**
* Reference to a field of type 'Boolean'
*/
@@ -1153,12 +1206,26 @@ export type EnumChallengeStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$
/**
* Reference to a field of type 'ChallengeStatus[]'
*/
export type ListEnumChallengeStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'ChallengeStatus[]'>
/**
* Reference to a field of type 'Float'
*/
export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'>
/**
* Reference to a field of type 'Float[]'
*/
export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'>
/**
* Batch Payload for updateMany & deleteMany & createMany
*/

View File

@@ -67,6 +67,9 @@ export type ModelName = (typeof ModelName)[keyof typeof ModelName]
*/
export const TransactionIsolationLevel = {
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
} as const
@@ -192,6 +195,14 @@ export const SortOrder = {
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
export const QueryMode = {
default: 'default',
insensitive: 'insensitive'
} as const
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
export const NullsOrder = {
first: 'first',
last: 'last'

View File

@@ -780,6 +780,7 @@ export type ChallengeCreateOrConnectWithoutChallengerInput = {
export type ChallengeCreateManyChallengerInputEnvelope = {
data: Prisma.ChallengeCreateManyChallengerInput | Prisma.ChallengeCreateManyChallengerInput[]
skipDuplicates?: boolean
}
export type ChallengeCreateWithoutChallengedInput = {
@@ -821,6 +822,7 @@ export type ChallengeCreateOrConnectWithoutChallengedInput = {
export type ChallengeCreateManyChallengedInputEnvelope = {
data: Prisma.ChallengeCreateManyChallengedInput | Prisma.ChallengeCreateManyChallengedInput[]
skipDuplicates?: boolean
}
export type ChallengeCreateWithoutAdminInput = {
@@ -862,6 +864,7 @@ export type ChallengeCreateOrConnectWithoutAdminInput = {
export type ChallengeCreateManyAdminInputEnvelope = {
data: Prisma.ChallengeCreateManyAdminInput | Prisma.ChallengeCreateManyAdminInput[]
skipDuplicates?: boolean
}
export type ChallengeCreateWithoutWinnerInput = {
@@ -903,6 +906,7 @@ export type ChallengeCreateOrConnectWithoutWinnerInput = {
export type ChallengeCreateManyWinnerInputEnvelope = {
data: Prisma.ChallengeCreateManyWinnerInput | Prisma.ChallengeCreateManyWinnerInput[]
skipDuplicates?: boolean
}
export type ChallengeUpsertWithWhereUniqueWithoutChallengerInput = {
@@ -2040,6 +2044,7 @@ export type ChallengeCreateManyArgs<ExtArgs extends runtime.Types.Extensions.Int
* The data used to create many Challenges.
*/
data: Prisma.ChallengeCreateManyInput | Prisma.ChallengeCreateManyInput[]
skipDuplicates?: boolean
}
/**
@@ -2058,6 +2063,7 @@ export type ChallengeCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Exten
* The data used to create many Challenges.
*/
data: Prisma.ChallengeCreateManyInput | Prisma.ChallengeCreateManyInput[]
skipDuplicates?: boolean
/**
* Choose, which related nodes to fetch as well
*/

View File

@@ -1447,6 +1447,7 @@ export type EventCreateManyArgs<ExtArgs extends runtime.Types.Extensions.Interna
* The data used to create many Events.
*/
data: Prisma.EventCreateManyInput | Prisma.EventCreateManyInput[]
skipDuplicates?: boolean
}
/**
@@ -1465,6 +1466,7 @@ export type EventCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extension
* The data used to create many Events.
*/
data: Prisma.EventCreateManyInput | Prisma.EventCreateManyInput[]
skipDuplicates?: boolean
}
/**

View File

@@ -550,6 +550,7 @@ export type EventFeedbackCreateOrConnectWithoutUserInput = {
export type EventFeedbackCreateManyUserInputEnvelope = {
data: Prisma.EventFeedbackCreateManyUserInput | Prisma.EventFeedbackCreateManyUserInput[]
skipDuplicates?: boolean
}
export type EventFeedbackUpsertWithWhereUniqueWithoutUserInput = {
@@ -609,6 +610,7 @@ export type EventFeedbackCreateOrConnectWithoutEventInput = {
export type EventFeedbackCreateManyEventInputEnvelope = {
data: Prisma.EventFeedbackCreateManyEventInput | Prisma.EventFeedbackCreateManyEventInput[]
skipDuplicates?: boolean
}
export type EventFeedbackUpsertWithWhereUniqueWithoutEventInput = {
@@ -1450,6 +1452,7 @@ export type EventFeedbackCreateManyArgs<ExtArgs extends runtime.Types.Extensions
* The data used to create many EventFeedbacks.
*/
data: Prisma.EventFeedbackCreateManyInput | Prisma.EventFeedbackCreateManyInput[]
skipDuplicates?: boolean
}
/**
@@ -1468,6 +1471,7 @@ export type EventFeedbackCreateManyAndReturnArgs<ExtArgs extends runtime.Types.E
* The data used to create many EventFeedbacks.
*/
data: Prisma.EventFeedbackCreateManyInput | Prisma.EventFeedbackCreateManyInput[]
skipDuplicates?: boolean
/**
* Choose, which related nodes to fetch as well
*/

View File

@@ -406,6 +406,7 @@ export type EventRegistrationCreateOrConnectWithoutUserInput = {
export type EventRegistrationCreateManyUserInputEnvelope = {
data: Prisma.EventRegistrationCreateManyUserInput | Prisma.EventRegistrationCreateManyUserInput[]
skipDuplicates?: boolean
}
export type EventRegistrationUpsertWithWhereUniqueWithoutUserInput = {
@@ -453,6 +454,7 @@ export type EventRegistrationCreateOrConnectWithoutEventInput = {
export type EventRegistrationCreateManyEventInputEnvelope = {
data: Prisma.EventRegistrationCreateManyEventInput | Prisma.EventRegistrationCreateManyEventInput[]
skipDuplicates?: boolean
}
export type EventRegistrationUpsertWithWhereUniqueWithoutEventInput = {
@@ -1238,6 +1240,7 @@ export type EventRegistrationCreateManyArgs<ExtArgs extends runtime.Types.Extens
* The data used to create many EventRegistrations.
*/
data: Prisma.EventRegistrationCreateManyInput | Prisma.EventRegistrationCreateManyInput[]
skipDuplicates?: boolean
}
/**
@@ -1256,6 +1259,7 @@ export type EventRegistrationCreateManyAndReturnArgs<ExtArgs extends runtime.Typ
* The data used to create many EventRegistrations.
*/
data: Prisma.EventRegistrationCreateManyInput | Prisma.EventRegistrationCreateManyInput[]
skipDuplicates?: boolean
/**
* Choose, which related nodes to fetch as well
*/

View File

@@ -1145,6 +1145,7 @@ export type SitePreferencesCreateManyArgs<ExtArgs extends runtime.Types.Extensio
* The data used to create many SitePreferences.
*/
data: Prisma.SitePreferencesCreateManyInput | Prisma.SitePreferencesCreateManyInput[]
skipDuplicates?: boolean
}
/**
@@ -1163,6 +1164,7 @@ export type SitePreferencesCreateManyAndReturnArgs<ExtArgs extends runtime.Types
* The data used to create many SitePreferences.
*/
data: Prisma.SitePreferencesCreateManyInput | Prisma.SitePreferencesCreateManyInput[]
skipDuplicates?: boolean
}
/**

View File

@@ -2499,6 +2499,7 @@ export type UserCreateManyArgs<ExtArgs extends runtime.Types.Extensions.Internal
* The data used to create many Users.
*/
data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[]
skipDuplicates?: boolean
}
/**
@@ -2517,6 +2518,7 @@ export type UserCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions
* The data used to create many Users.
*/
data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[]
skipDuplicates?: boolean
}
/**

View File

@@ -1201,6 +1201,7 @@ export type UserPreferencesCreateManyArgs<ExtArgs extends runtime.Types.Extensio
* The data used to create many UserPreferences.
*/
data: Prisma.UserPreferencesCreateManyInput | Prisma.UserPreferencesCreateManyInput[]
skipDuplicates?: boolean
}
/**
@@ -1219,6 +1220,7 @@ export type UserPreferencesCreateManyAndReturnArgs<ExtArgs extends runtime.Types
* The data used to create many UserPreferences.
*/
data: Prisma.UserPreferencesCreateManyInput | Prisma.UserPreferencesCreateManyInput[]
skipDuplicates?: boolean
/**
* Choose, which related nodes to fetch as well
*/

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"

View File

@@ -0,0 +1,200 @@
-- CreateEnum
CREATE TYPE "Role" AS ENUM ('USER', 'ADMIN');
-- CreateEnum
CREATE TYPE "EventType" AS ENUM ('ATELIER', 'KATA', 'PRESENTATION', 'LEARNING_HOUR');
-- CreateEnum
CREATE TYPE "CharacterClass" AS ENUM ('WARRIOR', 'MAGE', 'ROGUE', 'RANGER', 'PALADIN', 'ENGINEER', 'MERCHANT', 'SCHOLAR', 'BERSERKER', 'NECROMANCER');
-- CreateEnum
CREATE TYPE "ChallengeStatus" AS ENUM ('PENDING', 'ACCEPTED', 'COMPLETED', 'REJECTED', 'CANCELLED');
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"password" TEXT NOT NULL,
"username" TEXT NOT NULL,
"role" "Role" NOT NULL DEFAULT 'USER',
"score" INTEGER NOT NULL DEFAULT 0,
"level" INTEGER NOT NULL DEFAULT 1,
"hp" INTEGER NOT NULL DEFAULT 1000,
"maxHp" INTEGER NOT NULL DEFAULT 1000,
"xp" INTEGER NOT NULL DEFAULT 0,
"maxXp" INTEGER NOT NULL DEFAULT 5000,
"avatar" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"bio" TEXT,
"characterClass" "CharacterClass",
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "UserPreferences" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"homeBackground" TEXT,
"eventsBackground" TEXT,
"leaderboardBackground" TEXT,
"theme" TEXT DEFAULT 'default',
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "UserPreferences_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Event" (
"id" TEXT NOT NULL,
"date" TIMESTAMP(3) NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT NOT NULL,
"type" "EventType" NOT NULL,
"room" TEXT,
"time" TEXT,
"maxPlaces" INTEGER,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Event_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "EventRegistration" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"eventId" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "EventRegistration_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "EventFeedback" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"eventId" TEXT NOT NULL,
"rating" INTEGER NOT NULL,
"comment" TEXT,
"isRead" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "EventFeedback_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "SitePreferences" (
"id" TEXT NOT NULL DEFAULT 'global',
"homeBackground" TEXT,
"eventsBackground" TEXT,
"leaderboardBackground" TEXT,
"challengesBackground" TEXT,
"eventRegistrationPoints" INTEGER NOT NULL DEFAULT 100,
"eventFeedbackPoints" INTEGER NOT NULL DEFAULT 100,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "SitePreferences_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Challenge" (
"id" TEXT NOT NULL,
"challengerId" TEXT NOT NULL,
"challengedId" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL,
"pointsReward" INTEGER NOT NULL DEFAULT 100,
"status" "ChallengeStatus" NOT NULL DEFAULT 'PENDING',
"adminId" TEXT,
"adminComment" TEXT,
"winnerId" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"acceptedAt" TIMESTAMP(3),
"completedAt" TIMESTAMP(3),
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Challenge_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
-- CreateIndex
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
-- CreateIndex
CREATE INDEX "User_score_idx" ON "User"("score");
-- CreateIndex
CREATE INDEX "User_email_idx" ON "User"("email");
-- CreateIndex
CREATE UNIQUE INDEX "UserPreferences_userId_key" ON "UserPreferences"("userId");
-- CreateIndex
CREATE INDEX "Event_date_idx" ON "Event"("date");
-- CreateIndex
CREATE INDEX "EventRegistration_userId_idx" ON "EventRegistration"("userId");
-- CreateIndex
CREATE INDEX "EventRegistration_eventId_idx" ON "EventRegistration"("eventId");
-- CreateIndex
CREATE UNIQUE INDEX "EventRegistration_userId_eventId_key" ON "EventRegistration"("userId", "eventId");
-- CreateIndex
CREATE INDEX "EventFeedback_userId_idx" ON "EventFeedback"("userId");
-- CreateIndex
CREATE INDEX "EventFeedback_eventId_idx" ON "EventFeedback"("eventId");
-- CreateIndex
CREATE INDEX "EventFeedback_isRead_idx" ON "EventFeedback"("isRead");
-- CreateIndex
CREATE UNIQUE INDEX "EventFeedback_userId_eventId_key" ON "EventFeedback"("userId", "eventId");
-- CreateIndex
CREATE INDEX "Challenge_challengerId_idx" ON "Challenge"("challengerId");
-- CreateIndex
CREATE INDEX "Challenge_challengedId_idx" ON "Challenge"("challengedId");
-- CreateIndex
CREATE INDEX "Challenge_status_idx" ON "Challenge"("status");
-- CreateIndex
CREATE INDEX "Challenge_adminId_idx" ON "Challenge"("adminId");
-- AddForeignKey
ALTER TABLE "UserPreferences" ADD CONSTRAINT "UserPreferences_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "EventRegistration" ADD CONSTRAINT "EventRegistration_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "EventRegistration" ADD CONSTRAINT "EventRegistration_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "EventFeedback" ADD CONSTRAINT "EventFeedback_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "EventFeedback" ADD CONSTRAINT "EventFeedback_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Challenge" ADD CONSTRAINT "Challenge_challengerId_fkey" FOREIGN KEY ("challengerId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Challenge" ADD CONSTRAINT "Challenge_challengedId_fkey" FOREIGN KEY ("challengedId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Challenge" ADD CONSTRAINT "Challenge_adminId_fkey" FOREIGN KEY ("adminId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Challenge" ADD CONSTRAINT "Challenge_winnerId_fkey" FOREIGN KEY ("winnerId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "sqlite"
provider = "postgresql"

View File

@@ -4,7 +4,7 @@ generator client {
}
datasource db {
provider = "sqlite"
provider = "postgresql"
}
model User {

View File

@@ -3,12 +3,15 @@ import {
EventType,
CharacterClass,
} from "@/prisma/generated/prisma/client";
import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3";
import { PrismaPg } from "@prisma/adapter-pg";
import { Pool } from "pg";
import bcrypt from "bcryptjs";
const adapter = new PrismaBetterSqlite3({
url: process.env.DATABASE_URL || "file:./data/dev.db",
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
const adapter = new PrismaPg(pool);
const prisma = new PrismaClient({ adapter });
async function main() {