feat: redesign accounts types.

This commit is contained in:
a.bouhuolia
2021-01-23 11:39:29 +02:00
parent 1a89730855
commit d919b56e78
29 changed files with 786 additions and 528 deletions

View File

@@ -1,14 +0,0 @@
exports.up = (knex) => {
return knex.schema.createTable('account_types', (table) => {
table.increments();
table.string('key').index();
table.string('normal').index();
table.string('root_type').index();
table.string('child_type');
table.boolean('balance_sheet');
table.boolean('income_sheet');
}).raw('ALTER TABLE `ACCOUNT_TYPES` AUTO_INCREMENT = 1000');
};
exports.down = (knex) => knex.schema.dropTableIfExists('account_types');

View File

@@ -3,7 +3,7 @@ exports.up = function (knex) {
table.increments('id').comment('Auto-generated id');
table.string('name').index();
table.string('slug');
table.integer('account_type_id').unsigned().references('id').inTable('account_types');
table.string('account_type').index();
table.integer('parent_account_id').unsigned().references('id').inTable('accounts');
table.string('code', 10).index();
table.text('description');