This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

chore: proper updateschema just command

+32 -36
+10
Justfile
··· 7 7 go run server/*.go 8 8 9 9 build: 10 + just genprisma 10 11 go mod tidy 11 12 go build -v -ldflags="-X main.Version={{current_version}}" -o bin/server server/*.go 12 13 ··· 16 17 17 18 updateschema: 18 19 curl -fsSL https://git.inpt.fr/churros/churros/-/raw/main/packages/db/prisma/schema.prisma -o schema.prisma 20 + sed -i '/^generator .* {/,/^}/d' schema.prisma 21 + sed -i '1i\ 22 + generator goprisma {\n\ 23 + provider = "go run github.com/steebchen/prisma-client-go"\n\ 24 + previewFeatures = ["fullTextSearch", "postgresqlExtensions"]\n\ 25 + }\ 26 + ' schema.prisma 27 + go run github.com/steebchen/prisma-client-go format 28 + 19 29 20 30 genprisma: 21 31 go get github.com/steebchen/prisma-client-go
+22 -36
schema.prisma
··· 1 - // generator client { 2 - // provider = "prisma-client-js" 3 - // previewFeatures = ["fullTextSearch", "postgresqlExtensions"] 4 - // output = "../src/client" 5 - // } 6 - 7 - // See https://pothos-graphql.dev/docs/plugins/prisma#setup 8 - // generator pothos { 9 - // provider = "prisma-pothos-types" 10 - // clientOutput = "@churros/db/prisma" 11 - // output = "../src/pothos/index.d.ts" 12 - // prismaUtils = true 13 - // } 14 - 15 1 generator goprisma { 16 2 provider = "go run github.com/steebchen/prisma-client-go" 17 3 previewFeatures = ["fullTextSearch", "postgresqlExtensions"] 18 4 } 19 5 6 + // See https://pothos-graphql.dev/docs/plugins/prisma#setup 7 + 20 8 datasource db { 21 9 provider = "postgresql" 22 10 url = env("DATABASE_URL") ··· 224 212 groupId String? 225 213 group Group? @relation(fields: [groupId], references: [id], onUpdate: Cascade, onDelete: SetNull) 226 214 importance Int @default(0) 215 + hidden Boolean @default(false) 227 216 228 217 @@unique([schoolId, studentAssociationId, groupId, url]) 229 218 @@unique([schoolId, studentAssociationId, groupId, name]) ··· 461 450 services Service[] 462 451 restrictedFormSections FormSection[] @relation("restrictedTo") 463 452 464 - notifications Notification[] 465 - groupId String? 466 - ticketGroupId String? 467 - joinedByBookingTickets Ticket[] @relation("autojoin") 468 - themes Theme[] 453 + notifications Notification[] 454 + groupId String? 455 + ticketGroupId String? 456 + joinedByBookingTickets Ticket[] @relation("autojoin") 457 + themes Theme[] 458 + defaultApplicableOffers Promotion[] @relation("defaultApplicableOffers") 469 459 470 460 // For ldap 471 461 ldapGidNumber Int @unique @default(autoincrement()) ··· 480 470 @@index([search], type: Gin) 481 471 } 482 472 483 - /// The intermediate model between users and groups 473 + /// The intermediate model between users 484 474 model GroupMember { 485 475 groupId String 486 476 memberId String ··· 647 637 openToPromotions Int[] @default([]) 648 638 openToAlumni Boolean? @default(false) // false means only non-alumni, true means only alumni, null means both 649 639 openToExternal Boolean? @default(false) // same thing 650 - openToContributors Boolean? @default(false) // same thing 640 + openToContributors Boolean? // same thing 651 641 openToApprentices Boolean? // same thing 652 642 openToSchools School[] 653 643 openToMajors Major[] ··· 745 735 phoneNumber String @default("") @db.VarChar(255) 746 736 registrationId String? @unique 747 737 registration Registration? @relation(fields: [registrationId], references: [id], onUpdate: Cascade, onDelete: Cascade) 738 + shopPaymentId String? @unique 748 739 requestId String? 749 740 requestUuid String? 750 741 transactionId String? ··· 976 967 } 977 968 978 969 model Promotion { 979 - id String @id @default(dbgenerated("nanoid('promo:')")) 980 - createdAt DateTime @default(now()) 981 - updatedAt DateTime @updatedAt 982 - validUntil DateTime? 983 - type PromotionType 984 - codes PromotionCode[] 985 - validOn Ticket[] 970 + id String @id @default(dbgenerated("nanoid('promo:')")) 971 + createdAt DateTime @default(now()) 972 + updatedAt DateTime @updatedAt 973 + validUntil DateTime? 974 + type PromotionType 975 + codes PromotionCode[] 976 + validOn Ticket[] 977 + validByDefaultOn Group[] @relation("defaultApplicableOffers") 986 978 987 979 priceOverride Int 988 980 events Event[] 989 - } 990 - 991 - model Picture { 992 - id String @id @default(dbgenerated("nanoid('picfile:')")) 993 - path String @db.VarChar(255) 994 - position Int @default(0) 995 981 } 996 982 997 983 model Form { ··· 1160 1146 createdAt DateTime @default(now()) 1161 1147 updatedAt DateTime @updatedAt 1162 1148 visibility Visibility @default(Private) 1163 - startsAt DateTime? @default(now()) 1164 - endsAt DateTime? 1149 + startsAt DateTime @default(now()) 1150 + endsAt DateTime 1165 1151 author Group? @relation(fields: [authorId], references: [id], onDelete: SetNull, onUpdate: Cascade) 1166 1152 authorId String? 1167 1153