mailtrain/server/setup/knex/migrations/20190705220000_test_messages.js
Tomas Bures 4113cb8476 Work in progress on tag language
Fix - message sent to a list not associated with a campaign couldn't be shown in archive - to know which message to show even if the list is not at the campaign, we store test messages in table test_messages
2019-07-05 23:23:02 +02:00

14 lines
628 B
JavaScript

exports.up = (knex, Promise) => (async() => {
await knex.schema.raw('CREATE TABLE `test_messages` (\n' +
' `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n' +
' `campaign` int(10) unsigned NOT NULL,\n' +
' `list` int(10) unsigned NOT NULL,\n' +
' `subscription` int(10) unsigned NOT NULL,\n' +
' `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n' +
' PRIMARY KEY (`id`),\n' +
' UNIQUE KEY `cls` (`campaign`, `list`, `subscription`)\n' +
') ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n');
})();
exports.down = (knex, Promise) => (async() => {
})();