diff --git a/migrations/20240417112319-modify-user-dashboard.js b/migrations/20240417112319-modify-user-dashboard.js new file mode 100644 index 0000000..6a7e6bf --- /dev/null +++ b/migrations/20240417112319-modify-user-dashboard.js @@ -0,0 +1,53 @@ +'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', '20240417112319-modify-user-dashboard-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', '20240417112319-modify-user-dashboard-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/migrations/sqls/20240417112319-modify-user-dashboard-down.sql b/migrations/sqls/20240417112319-modify-user-dashboard-down.sql new file mode 100644 index 0000000..e0ac49d --- /dev/null +++ b/migrations/sqls/20240417112319-modify-user-dashboard-down.sql @@ -0,0 +1 @@ +SELECT 1; diff --git a/migrations/sqls/20240417112319-modify-user-dashboard-up.sql b/migrations/sqls/20240417112319-modify-user-dashboard-up.sql new file mode 100644 index 0000000..6a512e3 --- /dev/null +++ b/migrations/sqls/20240417112319-modify-user-dashboard-up.sql @@ -0,0 +1 @@ +ALTER TABLE actaeon_user_ext MODIFY COLUMN dashboard MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;