forked from kristiandupont/kanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.kanelrc.js
39 lines (33 loc) · 902 Bytes
/
.kanelrc.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
const path = require('path');
const { recase } = require('@kristiandupont/recase');
// This hook will insert the name of the model or type right after the auto-generated warning comment.
const insertNameComment = (lines, src) => {
const [head, ...tail] = lines;
return [head, `// Name: ${src.name}`, ...tail];
};
module.exports = {
connection: {
host: 'localhost',
user: 'postgres',
password: 'postgres',
database: 'dvdrental',
charset: 'utf8',
port: 54321,
},
modelNominator: recase('snake', 'pascal'),
typeNominator: recase('snake', 'pascal'),
preDeleteModelFolder: true,
customTypeMap: {
tsvector: 'string',
bpchar: 'string',
},
modelHooks: [insertNameComment],
typeHooks: [insertNameComment],
schemas: [
{
name: 'public',
modelFolder: path.join(__dirname, 'models'),
ignore: ['film_list', 'staff'],
},
],
};