File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
v3-mongodb-v3-sql/dialects Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ endOfLine : 'lf' ,
3
+ semi : true ,
4
+ singleQuote : true ,
5
+ tabWidth : 2 ,
6
+ trailingComma : 'es5' ,
7
+ printWidth : 100 ,
8
+ arrowParens : 'always' ,
9
+ } ;
Original file line number Diff line number Diff line change @@ -11,26 +11,25 @@ module.exports = (knex, inspector) => ({
11
11
} ,
12
12
13
13
async beforeMigration ( ) {
14
- // await knex.raw(`SET session_replication_role = 'replica';`);
14
+ // do nothing for postgres
15
15
} ,
16
16
17
17
async afterMigration ( ) {
18
18
const tableList = await inspector . tables ( ) ;
19
19
20
20
// restart sequence for tables
21
21
for ( const table of tableList ) {
22
- let result = await knex . raw ( " select max(id) from ??" , [ table ] ) ;
22
+ let result = await knex . raw ( ' select max(id) from ??' , [ table ] ) ;
23
23
const max = result . rows [ 0 ] . max ;
24
24
25
25
if ( max ) {
26
26
await knex . raw (
27
27
`
28
28
ALTER SEQUENCE ?? RESTART WITH ??;
29
29
` ,
30
- [ table + " _id_seq" , max + 1 ]
30
+ [ table + ' _id_seq' , max + 1 ]
31
31
) ;
32
32
}
33
33
}
34
- // await knex.raw(`SET session_replication_role = 'origin';`);
35
34
} ,
36
35
} ) ;
You can’t perform that action at this time.
0 commit comments