File tree Expand file tree Collapse file tree 5 files changed +25
-33
lines changed
migrations/20240819094423_init Expand file tree Collapse file tree 5 files changed +25
-33
lines changed Original file line number Diff line number Diff line change 1- DATABASE_URL = " postgresql://USERNAME:PASSWORD@localhost:6500/DATABASENAME?schema=public "
1+ DATABASE_URL =
Original file line number Diff line number Diff line change @@ -7,6 +7,4 @@ node_modules
77
88# Local Netlify folder
99.netlify
10- .DS_Store
11- /prisma /docs
12- prisma /credentials
10+ .DS_Store
Original file line number Diff line number Diff line change @@ -5,15 +5,18 @@ import { prisma } from "~/utils/db.server";
55
66export const loader = async ( { params } : LoaderFunctionArgs ) => {
77 if ( ! params . slug ) {
8- throw new Error ( "Missing eventid param " ) ;
8+ throw new Error ( "Missing event slug " ) ;
99 }
10- const event = await prisma . events . findFirst ( {
10+ const event = await prisma . event . findFirst ( {
1111 where : {
1212 slug : params . slug ,
1313 } ,
1414 } ) ;
1515 if ( ! event ) {
16- throw new Response ( "Not Found" , { status : 404 } ) ;
16+ throw new Response ( null , {
17+ status : 404 ,
18+ statusText : "Event Not Found" ,
19+ } ) ;
1720 }
1821 return json ( { event } ) ;
1922} ;
Original file line number Diff line number Diff line change 1- /*
2- Warnings:
3-
4- - You are about to drop the `Event` table. If the table is not empty, all the data it contains will be lost.
5-
6- */
7- -- DropTable
8- DROP TABLE " Event" ;
9-
101-- CreateTable
11- CREATE TABLE "Events " (
2+ CREATE TABLE "Event " (
123 " id" TEXT NOT NULL ,
134 " slug" TEXT NOT NULL ,
145 " title" TEXT NOT NULL ,
@@ -19,13 +10,13 @@ CREATE TABLE "Events" (
1910 " description" TEXT NOT NULL ,
2011 " locationName" TEXT NOT NULL ,
2112 " locationAddress" TEXT NOT NULL ,
22- " eventAgendas " TEXT [],
23- " registration " TEXT NOT NULL ,
13+ " agendas " TEXT [],
14+ " registrationInfo " TEXT NOT NULL ,
2415 " createdAt" TIMESTAMP (3 ) NOT NULL DEFAULT CURRENT_TIMESTAMP ,
2516 " updatedAt" TIMESTAMP (3 ) NOT NULL ,
2617
27- CONSTRAINT " Events_pkey " PRIMARY KEY (" id" )
18+ CONSTRAINT " Event_pkey " PRIMARY KEY (" id" )
2819);
2920
3021-- CreateIndex
31- CREATE UNIQUE INDEX "Events_slug_key " ON " Events " (" slug" );
22+ CREATE UNIQUE INDEX "Event_slug_key " ON " Event " (" slug" );
Original file line number Diff line number Diff line change @@ -11,20 +11,20 @@ datasource db {
1111 url = env (" DATABASE_URL " )
1212}
1313
14- model Events {
14+ model Event {
1515 id String @id @default (cuid () )
1616
17- slug String @unique
18- title String @db.Text
19- imageUrl String
20- dateTimeStart DateTime @default (now () )
21- dateTimeEnd DateTime @default (now () )
22- url String // Url for online or hybrid
23- description String @db.Text
24- locationName String
25- locationAddress String
26- eventAgendas String []
27- registration String @db.Text
17+ slug String @unique
18+ title String @db.Text
19+ imageUrl String
20+ dateTimeStart DateTime @default (now () )
21+ dateTimeEnd DateTime @default (now () )
22+ url String // Url for online or hybrid
23+ description String @db.Text
24+ locationName String
25+ locationAddress String
26+ agendas String []
27+ registrationInfo String @db.Text
2828
2929 createdAt DateTime @default (now () )
3030 updatedAt DateTime @updatedAt
You can’t perform that action at this time.
0 commit comments