Files
cloudron-box/migrations/20260217120000-mailPasswords-create-table.js
2026-02-18 15:17:08 +01:00

19 lines
619 B
JavaScript

'use strict';
exports.up = async function(db) {
const cmd = 'CREATE TABLE mailPasswords(' +
'clientId VARCHAR(128) NOT NULL,' +
'userId VARCHAR(128) NOT NULL,' +
'password VARCHAR(1024) NOT NULL,' +
'creationTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,' +
'FOREIGN KEY(clientId) REFERENCES oidcClients(id),' +
'FOREIGN KEY(userId) REFERENCES users(id),' +
'PRIMARY KEY (clientId, userId)) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin';
await db.runSql(cmd);
};
exports.down = async function(db) {
await db.runSql('DROP TABLE mailPasswords');
};