Add a table and the install/configure routes. Initially, I thought we can just keep the env vars in docker container but that doesn't work since we create the container only later in apptask. And if the container gets deleted we lose this information.
22 lines
627 B
JavaScript
22 lines
627 B
JavaScript
'use strict';
|
|
|
|
exports.up = function(db, callback) {
|
|
var cmd = 'CREATE TABLE IF NOT EXISTS appEnvVars(' +
|
|
'appId VARCHAR(128) NOT NULL,' +
|
|
'name TEXT NOT NULL,' +
|
|
'value TEXT NOT NULL,' +
|
|
'FOREIGN KEY(appId) REFERENCES apps(id)) CHARACTER SET utf8 COLLATE utf8_bin';
|
|
|
|
db.runSql(cmd, function (error) {
|
|
if (error) console.error(error);
|
|
callback(error);
|
|
});
|
|
};
|
|
|
|
exports.down = function(db, callback) {
|
|
db.runSql('DROP TABLE appEnvVars', function (error) {
|
|
if (error) console.error(error);
|
|
callback(error);
|
|
});
|
|
};
|