-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7be2879
commit 13b4524
Showing
2 changed files
with
53 additions
and
53 deletions.
There are no files selected for viewing
52 changes: 26 additions & 26 deletions
52
...ons/20210422194130_create_assets_table.js → ...ons/20230912072520_create_assets_table.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
} |
54 changes: 27 additions & 27 deletions
54
...ions/20211026133430_create_peers_table.js → ...ions/20230912072530_create_peers_table.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
} |