You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
srap/migrations/20221123175316_queue-table.js

20 lines
627 B
JavaScript

"use strict";
module.exports.up = function(knex, Promise) {
return knex.schema
.alterTable("srap_tasks_in_progress", (table) => {
table.timestamp("started_at").alter().nullable().defaultTo(null);
table.boolean("started").notNullable().defaultTo(false);
})
.renameTable("srap_tasks_in_progress", "srap_queue");
};
module.exports.down = function(knex, Promise) {
return knex.schema
.renameTable("srap_queue", "srap_tasks_in_progress")
.alterTable("srap_tasks_in_progress", (table) => {
table.timestamp("started_at").alter().notNullable().defaultTo(knex.fn.now());
table.dropColumn("started");
});
};