Files
cloudron-box/migrations/20260217120000-mailPasswords-create-table.js
T
Johannes Zellner 9bac099339 Add mailPassword table
This table stores email credentials for users using apps which use the
email addon
2026-02-18 10:12:34 +01:00

19 lines
603 B
JavaScript

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