2021-02-19 11:13:25 +01:00
|
|
|
'use strict';
|
|
|
|
|
2021-02-19 11:28:35 +01:00
|
|
|
const { v4: uuidv4 } = require('uuid');
|
2021-02-19 11:27:29 +01:00
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
exports.up = function (db, cb) {
|
2021-02-19 11:28:35 +01:00
|
|
|
const instanceId = uuidv4();
|
2021-02-19 11:13:25 +01:00
|
|
|
db.runSql(
|
|
|
|
`
|
2021-02-19 11:27:29 +01:00
|
|
|
INSERT INTO settings(name, content) VALUES ('instanceInfo', json_build_object('id', '${instanceId}'));
|
2021-02-19 11:13:25 +01:00
|
|
|
`,
|
|
|
|
cb,
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
exports.down = function (db, cb) {
|
2021-02-19 11:13:25 +01:00
|
|
|
db.runSql(
|
|
|
|
`
|
2021-03-04 12:55:28 +01:00
|
|
|
DELETE FROM settings WHERE name = 'instanceInfo'
|
2021-02-19 11:13:25 +01:00
|
|
|
`,
|
|
|
|
cb,
|
|
|
|
);
|
|
|
|
};
|