Skip to content

Commit

Permalink
Commit migration
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed May 21, 2024
1 parent a9cdf32 commit 7f5d7c2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions api/migrations/20240521044000-add-search-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

var dbm;
var type;
var seed;

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
};

exports.up = function (db, callback) {
db.runSql(`ALTER TABLE searches ADD COLUMN search_type smallint NOT NULL DEFAULT 1;`, callback);
};

exports.down = function (db, callback) {
db.runSql(`ALTER TABLE searches DROP COLUMN search_type;`, callback);
};

exports._meta = {
version: 1,
};

0 comments on commit 7f5d7c2

Please sign in to comment.