fix(server comments): fix pagination time confilct js <-> postgres

This commit is contained in:
Gergő Jedlicska
2022-03-11 10:31:59 +01:00
parent a9e545ae60
commit 519ea2ec2c
4 changed files with 82 additions and 19 deletions
@@ -3,8 +3,9 @@ exports.up = async ( knex ) => {
await knex.schema.createTable( 'comments', table => {
table.string( 'id', 10 ).primary( )
table.string( 'authorId', 10 ).references( 'id' ).inTable( 'users' ).notNullable().index( )
table.timestamp( 'createdAt' ).defaultTo( knex.fn.now( ) )
table.timestamp( 'updatedAt' ).defaultTo( knex.fn.now( ) )
// table.timestamp( 'createdAt' ).defaultTo( knex.fn.now( ) )
table.specificType( 'createdAt', 'TIMESTAMPTZ(3)' ).defaultTo( knex.fn.now( ) )
table.specificType( 'updatedAt', 'TIMESTAMPTZ(3)' ).defaultTo( knex.fn.now( ) )
table.string( 'text' )
table.text( 'screenshot' )
table.jsonb( 'data' )