Skip to content

Commit

Permalink
Add data_element_data_service table
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorNadj committed Sep 12, 2022
1 parent 2128be7 commit 5ab7e4b
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'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 = async function (db) {
await db.runSql(`
CREATE TABLE data_element_data_service (
id TEXT PRIMARY KEY,
data_element_code TEXT NOT NULL,
country_code TEXT NOT NULL,
service_type service_type NOT NULL,
service_config JSONB NOT NULL DEFAULT '{}'
)
`);
};

exports.down = async function (db) {
await db.runSql(`DROP TABLE data_element_data_service`);
};

exports._meta = {
version: 1,
};

0 comments on commit 5ab7e4b

Please sign in to comment.