Work in progress on introducing tag language. Not tested yet.
This commit is contained in:
parent
450b930cc5
commit
00e328a914
21 changed files with 2154 additions and 1909 deletions
|
@ -2,6 +2,7 @@ const { CampaignSource, CampaignType} = require('../../../../shared/campaigns');
|
|||
const files = require('../../../models/files');
|
||||
const contextHelpers = require('../../../lib/context-helpers');
|
||||
const mosaicoTemplates = require('../../../../shared/mosaico-templates');
|
||||
const {TagLanguages} = require('../../../../shared/templates');
|
||||
const {getGlobalNamespaceId} = require('../../../../shared/namespaces');
|
||||
const {getAdminId} = require('../../../../shared/users');
|
||||
const { MailerType, ZoneMTAType, getSystemSendConfigurationId, getSystemSendConfigurationCid } = require('../../../../shared/send-configurations');
|
||||
|
@ -905,7 +906,7 @@ async function addMosaicoTemplates(knex) {
|
|||
type: 'html',
|
||||
namespace: 1,
|
||||
data: JSON.stringify({
|
||||
html: mosaicoTemplates.getVersafix()
|
||||
html: mosaicoTemplates.getVersafix(TagLanguages.SIMPLE)
|
||||
})
|
||||
};
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ exports.up = (knex, Promise) => (async() => {
|
|||
data.listId = queuedEntry.list;
|
||||
data.subscriptionId = queuedEntry.subscription;
|
||||
|
||||
knex('queued')
|
||||
await knex('queued')
|
||||
.where('id', queuedEntry.id)
|
||||
.update({
|
||||
data: JSON.stringify(data)
|
||||
|
|
41
server/setup/knex/migrations/20190630210000_tag_language.js
Normal file
41
server/setup/knex/migrations/20190630210000_tag_language.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
const { CampaignSource } = require('../../../../shared/campaigns');
|
||||
const { TagLanguages } = require('../../../../shared/templates');
|
||||
|
||||
exports.up = (knex, Promise) => (async() => {
|
||||
await knex.schema.table('templates', table => {
|
||||
table.string('tag_language', 48);
|
||||
});
|
||||
|
||||
await knex('templates').update({
|
||||
tag_language: 'simple'
|
||||
});
|
||||
|
||||
await knex.schema.table('templates', table => {
|
||||
table.string('tag_language', 48).notNullable().index().alter();
|
||||
});
|
||||
|
||||
|
||||
await knex.schema.table('mosaico_templates', table => {
|
||||
table.string('tag_language', 48);
|
||||
});
|
||||
|
||||
await knex('mosaico_templates').update({
|
||||
tag_language: TagLanguages.SIMPLE
|
||||
});
|
||||
|
||||
await knex.schema.table('mosaico_templates', table => {
|
||||
table.string('tag_language', 48).notNullable().index().alter();
|
||||
});
|
||||
|
||||
const rows = await knex('campaigns').whereIn('source', [CampaignSource.CUSTOM, CampaignSource.CUSTOM_FROM_CAMPAIGN, CampaignSource.CUSTOM_FROM_TEMPLATE]);
|
||||
for (const row of rows) {
|
||||
const data = JSON.parse(row.data);
|
||||
|
||||
data.sourceCustom.tag_language = TagLanguages.SIMPLE;
|
||||
|
||||
await knex('campaigns').where('id', row.id).update({data: JSON.stringify(data)});
|
||||
}
|
||||
})();
|
||||
|
||||
exports.down = (knex, Promise) => (async() => {
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue