diff --git a/src/db/dbMigrator/migration/public/migrations/20241009091444-add-column-auth-group-user-props.js b/src/db/dbMigrator/migration/public/migrations/20241009091444-add-column-auth-group-user-props.js new file mode 100644 index 0000000..cf2b8ad --- /dev/null +++ b/src/db/dbMigrator/migration/public/migrations/20241009091444-add-column-auth-group-user-props.js @@ -0,0 +1,51 @@ +'use strict' + +var dbm +var type +var seed +var fs = require('fs') +var path = require('path') +var Promise + +/** + * 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 + Promise = options.Promise +} + +exports.up = function (db) { + var filePath = path.join(__dirname, 'sqls', '20241009091444-add-column-auth-group-user-props-up.sql') + return new Promise(function (resolve, reject) { + fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) { + if (err) return reject(err) + console.log('received data: ' + data) + + resolve(data) + }) + }).then(function (data) { + return db.runSql(data) + }) +} + +exports.down = function (db) { + var filePath = path.join(__dirname, 'sqls', '20241009091444-add-column-auth-group-user-props-down.sql') + return new Promise(function (resolve, reject) { + fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) { + if (err) return reject(err) + console.log('received data: ' + data) + + resolve(data) + }) + }).then(function (data) { + return db.runSql(data) + }) +} + +exports._meta = { + version: 1, +} diff --git a/src/db/dbMigrator/migration/public/migrations/sqls/20241009091444-add-column-auth-group-user-props-down.sql b/src/db/dbMigrator/migration/public/migrations/sqls/20241009091444-add-column-auth-group-user-props-down.sql new file mode 100644 index 0000000..44f074e --- /dev/null +++ b/src/db/dbMigrator/migration/public/migrations/sqls/20241009091444-add-column-auth-group-user-props-down.sql @@ -0,0 +1 @@ +/* Replace with your SQL commands */ \ No newline at end of file diff --git a/src/db/dbMigrator/migration/public/migrations/sqls/20241009091444-add-column-auth-group-user-props-up.sql b/src/db/dbMigrator/migration/public/migrations/sqls/20241009091444-add-column-auth-group-user-props-up.sql new file mode 100644 index 0000000..93c1e8b --- /dev/null +++ b/src/db/dbMigrator/migration/public/migrations/sqls/20241009091444-add-column-auth-group-user-props-up.sql @@ -0,0 +1,2 @@ +ALTER TABLE auth_group_user + ADD COLUMN props jsonb NULL; \ No newline at end of file