traxxx/migrations/20240825232707_summaries.js

26 lines
491 B
JavaScript
Raw Permalink Normal View History

2024-08-26 04:15:39 +00:00
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');
};