-
Notifications
You must be signed in to change notification settings - Fork 0
/
knexfile.js
54 lines (50 loc) · 1.24 KB
/
knexfile.js
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
let config = require('./config/index')
// In terminal open psql and create a new database. Then include the name of the database and your username and password in the development details below
// Run the following terminal command
// $ psql
// # CREATE DATABASE nameofyourdatabase;
// Note: remember the semicolon syntax
// # \q
module.exports = {
dev: {
client: 'pg',
connection: {
host: config.pg.PG_HOST,
user: config.pg.PG_USER,
password: config.pg.PG_PASSWORD,
database: config.pg.PG_DATABASE,
port: config.pg.PG_PORT,
// ssl: true
},
migrations: {
directory: __dirname + '/db/pg/migrations'
},
seeds: {
directory: __dirname + '/db/pg/seeds'
}
},
production: {
client: 'pg',
connection: {
host: config.pg.PG_HOST,
user: config.pg.PG_USER,
password: config.pg.PG_PASSWORD,
database: config.pg.PG_DATABASE,
port: config.pg.PG_PORT,
ssl: true
},
migrations: {
directory: __dirname + '/db/pg/migrations'
},
seeds: {
directory: __dirname + '/db/pg/seeds'
}
}
};
/* COMMANDS
npm install knex
npm install pg --save
npx knex migrate:make servicesCategoriesTable
npx knex migrate:latest
npx knex seed:run
*/