/**
 * @param { import("knex").Knex } knex
 * @returns { Promise<void> }
 */
exports.up = function(knex) {
  return knex.schema.alterTable('invoices', function(table) {
    table.decimal('credit_applied', 12, 2).defaultTo(0).notNullable();
  });
};

/**
 * @param { import("knex").Knex } knex
 * @returns { Promise<void> }
 */
exports.down = function(knex) {
  return knex.schema.alterTable('invoices', function(table) {
    table.dropColumn('credit_applied');
  });
};
