27 lines
462 B
JavaScript
27 lines
462 B
JavaScript
/* eslint-disable no-magic-numbers */
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* execute migration
|
|
*
|
|
* @param {any} knex database connections
|
|
*/
|
|
async function up (knex) {
|
|
await knex.schema.createTable ('template', (table) => {
|
|
table.increments ('id');
|
|
table.string ('text', 64);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* revert migration
|
|
*
|
|
* @param {any} knex database connections
|
|
*/
|
|
async function down (knex) {
|
|
await knex.schema.dropTable ('template');
|
|
}
|
|
|
|
module.exports = { up, down };
|