fix accounts balance check;

This commit is contained in:
ntr
2019-07-13 21:31:48 +10:00
parent 2fa7310aaa
commit 02719884c2
2 changed files with 18 additions and 15 deletions
@@ -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 () => {};