Files
cloudron-box/migrations/20210501044940-blobs-add-table.js
Girish Ramakrishnan 907ae4f233 secrets -> blobs
this will also have certs which are not really "secrets"
2021-04-30 22:34:27 -07:00

21 lines
514 B
JavaScript

'use strict';
exports.up = function(db, callback) {
const cmd = 'CREATE TABLE blobs(' +
'id VARCHAR(128) NOT NULL UNIQUE,' +
'value MEDIUMBLOB,' +
'PRIMARY KEY (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 blobs', function (error) {
if (error) console.error(error);
callback(error);
});
};