fix accounts balance check;
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
exports.up = async knex => {
|
||||
return knex.schema.createTable('accounts', table => {
|
||||
await knex.schema.createTable('accounts', table => {
|
||||
table.uuid('id').primary();
|
||||
table.timestamps(true, true);
|
||||
|
||||
@@ -23,8 +23,10 @@ exports.up = async knex => {
|
||||
|
||||
await knex.schema.raw(`
|
||||
ALTER TABLE accounts
|
||||
ADD CHECK (balance > 0);
|
||||
ADD CHECK (balance >= 0);
|
||||
`);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.down = async () => {};
|
||||
Reference in New Issue
Block a user