From db2f5801348009cfd1a6d70f217091ca9f6d25b4 Mon Sep 17 00:00:00 2001 From: Nick Charlton Date: Tue, 29 Nov 2022 19:55:20 +0000 Subject: [PATCH] feat: add uuid to tag --- .../migrations/20221129195412-AddUuidToTag.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 main/migrations/20221129195412-AddUuidToTag.js diff --git a/main/migrations/20221129195412-AddUuidToTag.js b/main/migrations/20221129195412-AddUuidToTag.js new file mode 100644 index 0000000..f490f62 --- /dev/null +++ b/main/migrations/20221129195412-AddUuidToTag.js @@ -0,0 +1,27 @@ +'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 = function(db) { + return db.addColumn('tag', 'uuid', { type: 'uuid', defaultValue: new String('uuid_generate_v4()')}); +}; + +exports.down = function(db) { + return db.removeColumn('tag', 'uuid'); +}; + +exports._meta = { + "version": 1 +};