Added user template database.
This commit is contained in:
parent
43134e0c8d
commit
856a5f4580
|
@ -0,0 +1,25 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.createTable('users_templates', (table) => {
|
||||
table.increments('id');
|
||||
|
||||
table.integer('user_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('users');
|
||||
|
||||
table.string('name')
|
||||
.notNullable();
|
||||
|
||||
table.text('template')
|
||||
.notNullable();
|
||||
|
||||
table.unique(['user_id', 'name']);
|
||||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.dropTable('users_templates');
|
||||
};
|
Loading…
Reference in New Issue