diff --git a/client/src/lists/CUD.js b/client/src/lists/CUD.js index 0caaa04a..16eeb4de 100644 --- a/client/src/lists/CUD.js +++ b/client/src/lists/CUD.js @@ -75,7 +75,7 @@ export default class CUD extends Component { homepage: '', unsubscription_mode: UnsubscriptionMode.ONE_STEP, namespace: mailtrainConfig.user.namespace, - to_name: '[FIRST_NAME] [LAST_NAME]', + to_name: '[MERGE_FIRST_NAME] [MERGE_LAST_NAME]', send_configuration: null, listunsubscribe_disabled: false }); diff --git a/server/models/fields.js b/server/models/fields.js index 1fef2b09..20f9adef 100644 --- a/server/models/fields.js +++ b/server/models/fields.js @@ -551,7 +551,7 @@ async function create(context, listId, entity) { } }); - // Altough this is a reference to another list, it is represented as signed int(11). This is because we use negative values for constant from SubscriptionSource + // Altough this is a reference to an import, it is represented as signed int(11). This is because we use negative values for constant from SubscriptionSource await knex.schema.raw('ALTER TABLE `subscription__' + listId + '` ADD `source_' + columnName +'` int(11) DEFAULT NULL'); } @@ -600,6 +600,7 @@ async function removeTx(tx, context, listId, id) { } else { await knex.schema.table('subscription__' + listId, table => { table.dropColumn(existing.column); + table.dropColumn('source_' + existing.column); }); await segments.removeRulesByColumnTx(tx, context, listId, existing.column); diff --git a/server/models/lists.js b/server/models/lists.js index dca6f781..043e12cb 100644 --- a/server/models/lists.js +++ b/server/models/lists.js @@ -123,7 +123,7 @@ async function create(context, entity) { ' `cid` varchar(255) CHARACTER SET ascii NOT NULL,\n' + ' `email` varchar(255) CHARACTER SET utf8 DEFAULT NULL,\n' + ' `hash_email` varchar(255) CHARACTER SET ascii NOT NULL,\n' + - ' `source_email` int(10) unsigned,\n' + // This references imports if the source is an import, 0 means some import in version 1, NULL if the source is via subscription or edit of the subscription + ' `source_email` int(11) DEFAULT NULL,\n' + // Altough this is a reference to an import, it is represented as signed int(11). This is because we use negative values for constant from SubscriptionSource ' `opt_in_ip` varchar(100) DEFAULT NULL,\n' + ' `opt_in_country` varchar(2) DEFAULT NULL,\n' + ' `tz` varchar(100) CHARACTER SET ascii DEFAULT NULL,\n' + diff --git a/server/setup/knex/migrations/20170506102634_v1_to_v2.js b/server/setup/knex/migrations/20170506102634_v1_to_v2.js index 73d20291..11ddfc19 100644 --- a/server/setup/knex/migrations/20170506102634_v1_to_v2.js +++ b/server/setup/knex/migrations/20170506102634_v1_to_v2.js @@ -242,7 +242,7 @@ async function migrateSubscriptions(knex) { const lists = await knex('lists'); for (const list of lists) { await knex.schema.raw('ALTER TABLE `subscription__' + list.id + '` ADD `unsubscribed` timestamp NULL DEFAULT NULL'); - await knex.schema.raw('ALTER TABLE `subscription__' + list.id + '` ADD `source_email` int(10) unsigned DEFAULT NULL'); + await knex.schema.raw('ALTER TABLE `subscription__' + list.id + '` ADD `source_email` int(11) DEFAULT NULL'); await knex.schema.raw('ALTER TABLE `subscription__' + list.id + '` ADD `hash_email` varchar(255) CHARACTER SET ascii'); @@ -250,7 +250,7 @@ async function migrateSubscriptions(knex) { const info = await knex('subscription__' + list.id).columnInfo(); for (const field of fields) { if (field.column != null) { - // Altough this is a reference to another list, it is represented as signed int(11). This is because we use negative values for constant from SubscriptionSource + // Altough this is a reference to an import, it is represented as signed int(11). This is because we use negative values for constant from SubscriptionSource await knex.schema.raw('ALTER TABLE `subscription__' + list.id + '` ADD `source_' + field.column +'` int(11) DEFAULT NULL'); }