diff --git a/packages/backend/migrations/20210422194130_create_assets_table.js b/packages/backend/migrations/20230912072520_create_assets_table.js similarity index 96% rename from packages/backend/migrations/20210422194130_create_assets_table.js rename to packages/backend/migrations/20230912072520_create_assets_table.js index 50cc4aac91..33f597bf77 100644 --- a/packages/backend/migrations/20210422194130_create_assets_table.js +++ b/packages/backend/migrations/20230912072520_create_assets_table.js @@ -1,26 +1,26 @@ -exports.up = function (knex) { - return knex.schema.createTable('assets', function (table) { - table.uuid('id').notNullable().primary() - - // TigerBeetle account 2 byte ledger field representing account's asset - table.specificType('ledger', 'smallserial').notNullable().unique() - table.string('code').notNullable() - table.smallint('scale').unsigned().notNullable() - - table.bigInteger('withdrawalThreshold').nullable() - table.bigInteger('liquidityThreshold').nullable() - - table.timestamp('createdAt').defaultTo(knex.fn.now()) - table.timestamp('updatedAt').defaultTo(knex.fn.now()) - - table.unique(['code', 'scale']) - - table.index(['createdAt', 'id']) - - table.check('?? <= 255', ['scale']) - }) -} - -exports.down = function (knex) { - return knex.schema.dropTableIfExists('assets') -} +exports.up = function (knex) { + return knex.schema.createTable('assets', function (table) { + table.uuid('id').notNullable().primary() + + // TigerBeetle account 2 byte ledger field representing account's asset + table.specificType('ledger', 'smallserial').notNullable().unique() + table.string('code').notNullable() + table.smallint('scale').unsigned().notNullable() + + table.bigInteger('withdrawalThreshold').nullable() + table.bigInteger('liquidityThreshold').nullable() + + table.timestamp('createdAt').defaultTo(knex.fn.now()) + table.timestamp('updatedAt').defaultTo(knex.fn.now()) + + table.unique(['code', 'scale']) + + table.index(['createdAt', 'id']) + + table.check('?? <= 255', ['scale']) + }) +} + +exports.down = function (knex) { + return knex.schema.dropTableIfExists('assets') +} diff --git a/packages/backend/migrations/20211026133430_create_peers_table.js b/packages/backend/migrations/20230912072530_create_peers_table.js similarity index 96% rename from packages/backend/migrations/20211026133430_create_peers_table.js rename to packages/backend/migrations/20230912072530_create_peers_table.js index d36c79ddb7..6c9ae28dc1 100644 --- a/packages/backend/migrations/20211026133430_create_peers_table.js +++ b/packages/backend/migrations/20230912072530_create_peers_table.js @@ -1,27 +1,27 @@ -exports.up = function (knex) { - return knex.schema.createTable('peers', function (table) { - table.uuid('id').notNullable().primary() - - table.uuid('assetId').notNullable() - table.foreign('assetId').references('assets.id') - - table.bigInteger('maxPacketAmount').nullable() - table.bigInteger('liquidityThreshold').nullable() - - table.string('staticIlpAddress').notNullable().index() - - table.string('outgoingToken').nullable() - table.string('outgoingEndpoint').nullable() - - table.string('name').nullable() - - table.timestamp('createdAt').defaultTo(knex.fn.now()) - table.timestamp('updatedAt').defaultTo(knex.fn.now()) - - table.index(['createdAt', 'id']) - }) -} - -exports.down = function (knex) { - return knex.schema.dropTableIfExists('peers') -} +exports.up = function (knex) { + return knex.schema.createTable('peers', function (table) { + table.uuid('id').notNullable().primary() + + table.uuid('assetId').notNullable() + table.foreign('assetId').references('assets.id') + + table.bigInteger('maxPacketAmount').nullable() + table.bigInteger('liquidityThreshold').nullable() + + table.string('staticIlpAddress').notNullable().index() + + table.string('outgoingToken').nullable() + table.string('outgoingEndpoint').nullable() + + table.string('name').nullable() + + table.timestamp('createdAt').defaultTo(knex.fn.now()) + table.timestamp('updatedAt').defaultTo(knex.fn.now()) + + table.index(['createdAt', 'id']) + }) +} + +exports.down = function (knex) { + return knex.schema.dropTableIfExists('peers') +}