forked from DebaucheryLibrarian/traxxx
Added user template database.
This commit is contained in:
25
migrations/20240825232707_summaries.js
Normal file
25
migrations/20240825232707_summaries.js
Normal file
@@ -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');
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user