Added user template database.

This commit is contained in:
DebaucheryLibrarian 2024-08-26 06:15:39 +02:00
parent 43134e0c8d
commit 856a5f4580
1 changed files with 25 additions and 0 deletions

View 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');
};