1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-17 01:17:29 +02:00

fix: generate uuid in js migration instead of from db

This commit is contained in:
Christopher Kolstad 2021-02-19 11:27:29 +01:00
parent 153fd970bf
commit ba57822d23
No known key found for this signature in database
GPG Key ID: 559ACB0E3DB5538A
3 changed files with 10 additions and 1 deletions

View File

@ -96,6 +96,7 @@
"response-time": "^2.3.2",
"serve-favicon": "^2.5.0",
"unleash-frontend": "3.11.4",
"uuid": "^8.3.2",
"yargs": "^16.0.3"
},
"devDependencies": {

View File

@ -1,9 +1,12 @@
'use strict';
const { v4 } = require('uuid');
exports.up = function(db, cb) {
const instanceId = v4();
db.runSql(
`
INSERT INTO settings(name, content) VALUES ('instanceInfo', json_build_object('id', gen_random_uuid()));
INSERT INTO settings(name, content) VALUES ('instanceInfo', json_build_object('id', '${instanceId}'));
`,
cb,
);

View File

@ -6330,6 +6330,11 @@ uuid@^3.2.1, uuid@^3.3.2, uuid@^3.3.3:
resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
v8-compile-cache@^2.0.3:
version "2.1.1"
resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz"