mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix: database migrations FK relations.
fix: database columns indexing.
This commit is contained in:
@@ -4,17 +4,17 @@ exports.up = function(knex) {
|
||||
table.increments();
|
||||
table.decimal('credit', 13, 3);
|
||||
table.decimal('debit', 13, 3);
|
||||
table.string('transaction_type');
|
||||
table.string('reference_type');
|
||||
table.integer('reference_id');
|
||||
table.integer('account_id').unsigned();
|
||||
table.string('contact_type').nullable();
|
||||
table.integer('contact_id').unsigned().nullable();
|
||||
table.string('transaction_type').index();
|
||||
table.string('reference_type').index();
|
||||
table.integer('reference_id').index();
|
||||
table.integer('account_id').unsigned().index().references('id').inTable('accounts');
|
||||
table.string('contact_type').nullable().index();
|
||||
table.integer('contact_id').unsigned().nullable().index().references('id').inTable('contacts');
|
||||
table.string('note');
|
||||
table.boolean('draft').defaultTo(false);
|
||||
table.integer('user_id').unsigned();
|
||||
table.integer('user_id').unsigned().index();
|
||||
table.integer('index').unsigned();
|
||||
table.date('date');
|
||||
table.date('date').index();
|
||||
table.timestamps();
|
||||
}).raw('ALTER TABLE `ACCOUNTS_TRANSACTIONS` AUTO_INCREMENT = 1000');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user