Skip to content

Commit

Permalink
update migration to stop excessive consumption of computation
Browse files Browse the repository at this point in the history
  • Loading branch information
affanv14 committed Oct 18, 2024
1 parent 301b438 commit 80d16c6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ export async function up(knex: Knex): Promise<void> {
return knex.schema.alterTable('fills', (table) => {
// decimal('columnName') has is 8,2 precision and scale
// decimal('columnName', null) has variable precision and scale
table.decimal('affiliateRevShare', null).notNullable().defaultTo(0).alter();
table.dropColumn('affiliateRevShare');
table.decimal('affiliateRevShare', null).notNullable().defaultTo(0);
});
}

export async function down(knex: Knex): Promise<void> {
return knex.schema.alterTable('fills', (table) => {
table.string('affiliateRevShare').notNullable().defaultTo('0').alter();
table.dropColumn('affiliateRevShare');
table.string('affiliateRevShare').notNullable().defaultTo('0');
});
}

0 comments on commit 80d16c6

Please sign in to comment.