remove deprecated url

This commit is contained in:
Girish Ramakrishnan
2026-03-10 15:15:10 +05:30
parent 4209e4d90d
commit d377d1e1cf
4 changed files with 8 additions and 14 deletions

View File

@@ -1,9 +1,7 @@
'use strict';
var url = require('node:url');
exports.up = function(db, callback) {
var dbName = url.parse(process.env.DATABASE_URL).path.substr(1); // remove slash
var dbName = new URL(process.env.DATABASE_URL).pathname.slice(1); // remove slash
// by default, mysql collates case insensitively. 'utf8_general_cs' is not available
db.runSql('ALTER DATABASE ' + dbName + ' DEFAULT CHARACTER SET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci', callback);