mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
WIP Metadata class.
This commit is contained in:
@@ -12,18 +12,34 @@ factory.define('user', 'users', async () => {
|
||||
first_name: faker.name.firstName(),
|
||||
last_name: faker.name.lastName(),
|
||||
email: faker.internet.email(),
|
||||
phone_number: faker.phone.phoneNumber(),
|
||||
phone_number: faker.phone.phoneNumberFormat().replace('-', ''),
|
||||
active: 1,
|
||||
password: hashedPassword,
|
||||
};
|
||||
});
|
||||
|
||||
factory.define('account', 'accounts', async () => ({
|
||||
name: faker.lorem.word(),
|
||||
type: faker.lorem.word(),
|
||||
description: faker.lorem.paragraph(),
|
||||
factory.define('password_reset', 'password_resets', async () => {
|
||||
const user = await faker.create('user');
|
||||
return {
|
||||
user_id: user.id,
|
||||
token: faker.lorem.slug,
|
||||
};
|
||||
});
|
||||
|
||||
factory.define('account_type', 'account_types', async () => ({
|
||||
name: faker.lorem.words(2),
|
||||
}));
|
||||
|
||||
factory.define('account', 'accounts', async () => {
|
||||
const accountType = await factory.create('account_type');
|
||||
|
||||
return {
|
||||
name: faker.lorem.word(),
|
||||
account_type_id: accountType.id,
|
||||
description: faker.lorem.paragraph(),
|
||||
};
|
||||
});
|
||||
|
||||
factory.define('item_category', 'items_categories', () => ({
|
||||
label: faker.name.firstName(),
|
||||
description: faker.lorem.text(),
|
||||
@@ -55,4 +71,16 @@ factory.define('item', 'items', async () => {
|
||||
};
|
||||
});
|
||||
|
||||
factory.define('setting', 'settings', async () => {
|
||||
const user = await factory.create('user');
|
||||
|
||||
return {
|
||||
key: faker.lorem.slug(),
|
||||
user_id: user.id,
|
||||
type: 'string',
|
||||
value: faker.lorem.words(),
|
||||
group: 'default',
|
||||
};
|
||||
});
|
||||
|
||||
export default factory;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
exports.up = (knex) => knex.schema.createTable('password_resets', (table) => {
|
||||
table.increments();
|
||||
table.string('user_id');
|
||||
table.string('token');
|
||||
table.timestamp('created_at');
|
||||
});
|
||||
|
||||
exports.down = (knex) => knex.schema.dropTableIfExists('password_resets');
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.schema.createTable('oauth_clients', table => {
|
||||
return knex.schema.createTable('oauth_clients', (table) => {
|
||||
table.increments();
|
||||
table.integer('client_id').unsigned();
|
||||
table.string('client_secret');
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.schema.createTable('settings', table => {
|
||||
exports.up = function (knex) {
|
||||
return knex.schema.createTable('settings', (table) => {
|
||||
table.increments();
|
||||
table.integer('user_id').unsigned().references('id').inTable('users');
|
||||
table.string('group');
|
||||
table.string('type');
|
||||
table.string('key');
|
||||
table.string('value');
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@ exports.up = function (knex) {
|
||||
return knex.schema.createTable('accounts', (table) => {
|
||||
table.increments();
|
||||
table.string('name');
|
||||
table.string('type');
|
||||
table.integer('account_type_id');
|
||||
table.integer('parent_account_id');
|
||||
table.string('code', 10);
|
||||
table.text('description');
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
exports.up = function (knex) {
|
||||
return knex.schema.createTable('account_types', (table) => {
|
||||
table.increments();
|
||||
table.string('name');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = (knex) => knex.schema.dropTableIfExists('account_types');
|
||||
Reference in New Issue
Block a user