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
7
7
8
8
# Local Netlify folder
9
9
.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";
5
5
6
6
export const loader = async ( { params } : LoaderFunctionArgs ) => {
7
7
if ( ! params . slug ) {
8
- throw new Error ( "Missing eventid param " ) ;
8
+ throw new Error ( "Missing event slug " ) ;
9
9
}
10
- const event = await prisma . events . findFirst ( {
10
+ const event = await prisma . event . findFirst ( {
11
11
where : {
12
12
slug : params . slug ,
13
13
} ,
14
14
} ) ;
15
15
if ( ! event ) {
16
- throw new Response ( "Not Found" , { status : 404 } ) ;
16
+ throw new Response ( null , {
17
+ status : 404 ,
18
+ statusText : "Event Not Found" ,
19
+ } ) ;
17
20
}
18
21
return json ( { event } ) ;
19
22
} ;
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
-
10
1
-- CreateTable
11
- CREATE TABLE "Events " (
2
+ CREATE TABLE "Event " (
12
3
" id" TEXT NOT NULL ,
13
4
" slug" TEXT NOT NULL ,
14
5
" title" TEXT NOT NULL ,
@@ -19,13 +10,13 @@ CREATE TABLE "Events" (
19
10
" description" TEXT NOT NULL ,
20
11
" locationName" TEXT NOT NULL ,
21
12
" locationAddress" TEXT NOT NULL ,
22
- " eventAgendas " TEXT [],
23
- " registration " TEXT NOT NULL ,
13
+ " agendas " TEXT [],
14
+ " registrationInfo " TEXT NOT NULL ,
24
15
" createdAt" TIMESTAMP (3 ) NOT NULL DEFAULT CURRENT_TIMESTAMP ,
25
16
" updatedAt" TIMESTAMP (3 ) NOT NULL ,
26
17
27
- CONSTRAINT " Events_pkey " PRIMARY KEY (" id" )
18
+ CONSTRAINT " Event_pkey " PRIMARY KEY (" id" )
28
19
);
29
20
30
21
-- 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 {
11
11
url = env (" DATABASE_URL " )
12
12
}
13
13
14
- model Events {
14
+ model Event {
15
15
id String @id @default (cuid () )
16
16
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
28
28
29
29
createdAt DateTime @default (now () )
30
30
updatedAt DateTime @updatedAt
You can’t perform that action at this time.
0 commit comments