1
2
| npm install prisma
npx prisma init
|
Setup the schema in prisma/schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model SlackUser {
id String @id
name String
email String?
deleted Boolean
admin Boolean?
restricted Boolean?
bot Boolean
tz String?
title String?
skype String?
real_name String?
display_name String?
status_text String?
status_emoji String?
custom_image Boolean?
original_image String?
}
|
Start a database if you don't have one
1
| docker run -d -e POSTGRES_PASSWORD=awesome_password -p 5432:5432 postgres
|
And create the migrations
1
| npx prisma migrate dev --name init
|