From 1073d03d1b9ac09f00898a7bfaf879ad05dbb734 Mon Sep 17 00:00:00 2001 From: Tomas Bures Date: Fri, 21 Dec 2018 22:37:30 +0000 Subject: [PATCH] base.sql and mailtrain.sql updated to fresh v2 DB schema and data --- client/package-lock.json | 8 +- server/package-lock.json | 193 ++--- server/setup/sql/base.sql | 1370 +++++++++++++++++++++++++++---- server/setup/sql/mailtrain.sql | 1409 +++++++++++++++++++++++++++----- shared/package-lock.json | 13 +- 5 files changed, 2532 insertions(+), 461 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index a24f2f8e..1d1cb595 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -3602,11 +3602,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3623,7 +3625,8 @@ }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", @@ -3752,6 +3755,7 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } diff --git a/server/package-lock.json b/server/package-lock.json index 0b4d8325..acaea522 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -909,11 +909,6 @@ } } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, "browser-process-hrtime": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", @@ -1901,19 +1896,6 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "elliptic": { - "version": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", - "from": "github:openpgpjs/elliptic", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, "email-addresses": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.0.1.tgz", @@ -2901,7 +2883,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2919,11 +2902,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2936,15 +2921,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3047,7 +3035,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3057,6 +3046,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3069,17 +3059,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -3096,6 +3089,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3168,7 +3162,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3178,6 +3173,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3253,7 +3249,8 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -3283,6 +3280,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3300,6 +3298,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3338,11 +3337,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.2", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -3582,11 +3583,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" - }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -3972,16 +3968,6 @@ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "homedir-polyfill": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", @@ -5390,11 +5376,6 @@ "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -6246,20 +6227,11 @@ "ieee754": "^1.1.4" } }, - "commander": { - "version": "2.8.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "requires": { - "graceful-readlink": ">= 1.0.0" - } - }, "compressjs": { "version": "github:openpgpjs/compressjs#bfbb371a34d1750afa34bfa49156461acdab79a9", "from": "github:openpgpjs/compressjs#bfbb371a34d1750afa34bfa49156461acdab79a9", "requires": { - "amdefine": "~1.0.0", - "commander": "~2.8.1" + "amdefine": "~1.0.0" } }, "elliptic": { @@ -6267,12 +6239,9 @@ "from": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", "requires": { "bn.js": "^4.4.0", - "brorand": "^1.0.1", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "minimalistic-assert": "^1.0.0" } }, "openpgp": { @@ -6285,8 +6254,6 @@ "asn1.js": "^5.0.0", "bn.js": "^4.11.8", "buffer": "^5.0.8", - "compressjs": "github:openpgpjs/compressjs#bfbb371a34d1750afa34bfa49156461acdab79a9", - "elliptic": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", "hash.js": "^1.1.3", "node-fetch": "^1.7.3", "node-localstorage": "~1.3.0", @@ -6296,15 +6263,25 @@ "dependencies": { "compressjs": { "version": "github:openpgpjs/compressjs#bfbb371a34d1750afa34bfa49156461acdab79a9", - "from": "github:openpgpjs/compressjs", + "from": "github:openpgpjs/compressjs#bfbb371a34d1750afa34bfa49156461acdab79a9", "requires": { "amdefine": "~1.0.0", "commander": "~2.8.1" + }, + "dependencies": { + "commander": { + "version": "2.8.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "requires": { + "graceful-readlink": ">= 1.0.0" + } + } } }, "elliptic": { "version": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", - "from": "github:openpgpjs/elliptic", + "from": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -6313,7 +6290,34 @@ "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + } } + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" } } } @@ -10189,22 +10193,18 @@ "requires": { "@mattiasbuelens/web-streams-polyfill": "0.1.0-alpha.4", "address-rfc2822": "^2.0.3", - "asmcrypto.js": "github:openpgpjs/asmcrypto#6e4e407b9b8ae317925a9e677cc7b4de3e447e83", "asn1.js": "^5.0.0", "bn.js": "^4.11.8", "buffer": "^5.0.8", - "elliptic": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", "hash.js": "^1.1.3", "node-fetch": "^2.1.2", "node-localstorage": "~1.3.0", - "pako": "^1.0.6", - "seek-bzip": "github:openpgpjs/seek-bzip#3aca608ffedc055a1da1d898ecb244804ef32209", - "web-stream-tools": "github:openpgpjs/web-stream-tools#9ab800d46add161db496506d67338202ad0114ce" + "pako": "^1.0.6" }, "dependencies": { "asmcrypto.js": { "version": "github:openpgpjs/asmcrypto#6e4e407b9b8ae317925a9e677cc7b4de3e447e83", - "from": "github:openpgpjs/asmcrypto" + "from": "github:openpgpjs/asmcrypto#6e4e407b9b8ae317925a9e677cc7b4de3e447e83" }, "buffer": { "version": "5.2.1", @@ -10215,10 +10215,36 @@ "ieee754": "^1.1.4" } }, + "commander": { + "version": "2.8.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=" + }, + "elliptic": { + "version": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", + "from": "github:openpgpjs/elliptic#e187e706e11fa51bcd20e46e5119054be4e2a4a6", + "requires": { + "bn.js": "^4.4.0", + "hash.js": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "node-fetch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==" + }, + "seek-bzip": { + "version": "github:openpgpjs/seek-bzip#3aca608ffedc055a1da1d898ecb244804ef32209", + "from": "github:openpgpjs/seek-bzip#3aca608ffedc055a1da1d898ecb244804ef32209", + "requires": { + "commander": "~2.8.1" + } + }, + "web-stream-tools": { + "version": "github:openpgpjs/web-stream-tools#9ab800d46add161db496506d67338202ad0114ce", + "from": "github:openpgpjs/web-stream-tools#9ab800d46add161db496506d67338202ad0114ce" } } }, @@ -11097,23 +11123,6 @@ "xmlchars": "^1.3.1" } }, - "seek-bzip": { - "version": "github:openpgpjs/seek-bzip#3aca608ffedc055a1da1d898ecb244804ef32209", - "from": "github:openpgpjs/seek-bzip", - "requires": { - "commander": "~2.8.1" - }, - "dependencies": { - "commander": { - "version": "2.8.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "requires": { - "graceful-readlink": ">= 1.0.0" - } - } - } - }, "selenium-webdriver": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz", @@ -12163,10 +12172,6 @@ } } }, - "web-stream-tools": { - "version": "github:openpgpjs/web-stream-tools#9ab800d46add161db496506d67338202ad0114ce", - "from": "github:openpgpjs/web-stream-tools" - }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", diff --git a/server/setup/sql/base.sql b/server/setup/sql/base.sql index 483e5783..e4d708d7 100644 --- a/server/setup/sql/base.sql +++ b/server/setup/sql/base.sql @@ -1,218 +1,1314 @@ SET UNIQUE_CHECKS=0; SET FOREIGN_KEY_CHECKS=0; -CREATE TABLE `campaign` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, - `segment` int(11) unsigned NOT NULL, - `subscription` int(11) unsigned NOT NULL, - `status` tinyint(4) unsigned NOT NULL DEFAULT '0', +CREATE TABLE `blacklist` ( + `email` varchar(191) NOT NULL, + PRIMARY KEY (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `campaign_links` ( + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `link` int(10) NOT NULL, + `ip` varchar(100) CHARACTER SET ascii DEFAULT NULL, + `device_type` varchar(50) DEFAULT NULL, + `country` varchar(2) CHARACTER SET ascii DEFAULT NULL, + `count` int(10) unsigned NOT NULL DEFAULT 1, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`campaign`,`list`,`subscription`,`link`), + KEY `created_index` (`created`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `campaign_lists` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `segment` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `campaign_lists_list_foreign` (`list`), + KEY `campaign_lists_segment_foreign` (`segment`), + KEY `campaign_lists_campaign_foreign` (`campaign`), + CONSTRAINT `campaign_lists_campaign_foreign` FOREIGN KEY (`campaign`) REFERENCES `campaigns` (`id`), + CONSTRAINT `campaign_lists_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`), + CONSTRAINT `campaign_lists_segment_foreign` FOREIGN KEY (`segment`) REFERENCES `segments` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `campaign_messages` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `send_configuration` int(10) unsigned NOT NULL, + `status` tinyint(4) unsigned NOT NULL DEFAULT 0, `response` varchar(255) DEFAULT NULL, `response_id` varchar(255) CHARACTER SET ascii DEFAULT NULL, `updated` timestamp NULL DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), - UNIQUE KEY `list` (`list`,`segment`,`subscription`), + UNIQUE KEY `cls` (`campaign`,`list`,`subscription`), KEY `created` (`created`), - KEY `response_id` (`response_id`) + KEY `response_id` (`response_id`), + KEY `status_index` (`status`), + KEY `subscription_index` (`subscription`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE `campaign_tracker` ( - `list` int(11) unsigned NOT NULL, - `subscriber` int(11) unsigned NOT NULL, - `link` int(11) NOT NULL, - `ip` varchar(100) CHARACTER SET ascii DEFAULT NULL, - `country` varchar(2) CHARACTER SET ascii DEFAULT NULL, - `count` int(11) unsigned NOT NULL DEFAULT '1', - PRIMARY KEY (`list`,`subscriber`,`link`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE `campaigns` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL, + `type` tinyint(4) unsigned NOT NULL DEFAULT 1, + `parent` int(10) unsigned DEFAULT NULL, `name` varchar(255) NOT NULL DEFAULT '', - `description` text, - `list` int(11) unsigned NOT NULL, - `segment` int(11) unsigned DEFAULT NULL, - `template` int(11) unsigned NOT NULL, - `from` varchar(255) DEFAULT '', - `address` varchar(255) DEFAULT '', - `subject` varchar(255) DEFAULT '', - `html` text, - `text` text, - `status` tinyint(4) unsigned NOT NULL DEFAULT '1', - `status_change` timestamp NULL DEFAULT NULL, - `delivered` int(11) unsigned NOT NULL DEFAULT '0', - `opened` int(11) unsigned NOT NULL DEFAULT '0', - `clicks` int(11) unsigned NOT NULL DEFAULT '0', - `unsubscribed` int(11) unsigned NOT NULL DEFAULT '0', - `bounced` int(1) unsigned NOT NULL DEFAULT '0', - `complained` int(1) unsigned NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `description` text DEFAULT NULL, + `last_check` timestamp NULL DEFAULT NULL, + `from_name_override` varchar(255) DEFAULT '', + `from_email_override` varchar(255) DEFAULT '', + `reply_to_override` varchar(255) DEFAULT '', + `subject_override` varchar(255) DEFAULT '', + `unsubscribe_url` varchar(255) NOT NULL DEFAULT '', + `status` tinyint(4) unsigned NOT NULL DEFAULT 1, + `scheduled` timestamp NULL DEFAULT NULL, + `delivered` int(11) unsigned NOT NULL DEFAULT 0, + `blacklisted` int(11) unsigned NOT NULL DEFAULT 0, + `opened` int(11) unsigned NOT NULL DEFAULT 0, + `clicks` int(11) unsigned NOT NULL DEFAULT 0, + `unsubscribed` int(11) unsigned NOT NULL DEFAULT 0, + `bounced` int(1) unsigned NOT NULL DEFAULT 0, + `complained` int(1) unsigned NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `open_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT 0, + `click_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT 0, + `namespace` int(10) unsigned NOT NULL, + `data` longtext DEFAULT NULL, + `source` int(10) unsigned NOT NULL, + `send_configuration` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), KEY `name` (`name`(191)), - KEY `status` (`status`) + KEY `status` (`status`), + KEY `schedule_index` (`scheduled`), + KEY `type_index` (`type`), + KEY `parent_index` (`parent`), + KEY `check_index` (`last_check`), + KEY `campaigns_namespace_foreign` (`namespace`), + KEY `campaigns_send_configuration_foreign` (`send_configuration`), + CONSTRAINT `campaigns_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`), + CONSTRAINT `campaigns_send_configuration_foreign` FOREIGN KEY (`send_configuration`) REFERENCES `send_configurations` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE `confirmations` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL, - `list` int(11) unsigned NOT NULL, - `email` varchar(255) NOT NULL, + `list` int(10) unsigned NOT NULL, + `action` varchar(100) NOT NULL, + `ip` varchar(100) DEFAULT NULL, `data` text NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), KEY `list` (`list`), CONSTRAINT `confirmations_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE `custom_fields` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 DEFAULT '', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `list` int(10) unsigned NOT NULL, + `name` varchar(255) DEFAULT '', `key` varchar(100) CHARACTER SET ascii NOT NULL, - `default_value` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, + `default_value` varchar(255) DEFAULT NULL, `type` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `group` int(11) unsigned DEFAULT NULL, + `group` int(10) unsigned DEFAULT NULL, `column` varchar(255) CHARACTER SET ascii DEFAULT NULL, - `visible` tinyint(4) unsigned NOT NULL DEFAULT '1', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `order_subscribe` int(11) DEFAULT NULL, + `order_manage` int(11) DEFAULT NULL, + `order_list` int(11) DEFAULT NULL, + `settings` longtext DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `list` (`list`,`column`), KEY `list_2` (`list`), - CONSTRAINT `custom_fields_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE + CONSTRAINT `custom_fields_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE `importer` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, - `type` tinyint(4) unsigned NOT NULL DEFAULT '1', - `path` varchar(255) NOT NULL DEFAULT '', - `size` int(11) unsigned NOT NULL DEFAULT '0', - `delimiter` varchar(1) CHARACTER SET ascii NOT NULL DEFAULT ',', - `status` tinyint(4) unsigned NOT NULL DEFAULT '0', - `error` varchar(255) DEFAULT NULL, - `processed` int(11) unsigned NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `mapping` text CHARACTER SET utf8mb4 NOT NULL, +CREATE TABLE `custom_forms` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT '', + `description` text DEFAULT NULL, + `layout` longtext DEFAULT NULL, + `form_input_style` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `custom_forms_namespace_foreign` (`namespace`), + CONSTRAINT `custom_forms_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `custom_forms_data` ( + `form` int(10) unsigned NOT NULL, + `data_key` varchar(128) NOT NULL, + `data_value` longtext DEFAULT NULL, + PRIMARY KEY (`form`,`data_key`), + KEY `form` (`form`), + CONSTRAINT `custom_forms_data_ibfk_1` FOREIGN KEY (`form`) REFERENCES `custom_forms` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_campaign_attachment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_campaign_attachment_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_campaign_attachment_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_campaign_file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_campaign_file_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_campaign_file_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_mosaico_template_block` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_mosaico_template_block_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_mosaico_template_block_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_mosaico_template_file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_mosaico_template_file_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_mosaico_template_file_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_template_file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_template_file_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_template_file_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `generated_role_names` ( + `entity_type` varchar(32) NOT NULL, + `role` varchar(128) NOT NULL, + `name` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`entity_type`,`role`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('campaign','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('customForm','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('global','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('list','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('mosaicoTemplate','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('namespace','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('report','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('reportTemplate','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('sendConfiguration','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('template','master','Master','All permissions'); +CREATE TABLE `import_failed` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `run` int(10) unsigned DEFAULT NULL, + `source_id` int(10) unsigned DEFAULT NULL, + `email` varchar(255) NOT NULL, + `reason` text DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `import_failed_run_foreign` (`run`), + CONSTRAINT `import_failed_run_foreign` FOREIGN KEY (`run`) REFERENCES `import_runs` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `import_runs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `import` int(10) unsigned DEFAULT NULL, + `status` int(10) unsigned NOT NULL, + `mapping` longtext DEFAULT NULL, + `last_id` int(11) DEFAULT NULL, + `new` int(11) DEFAULT 0, + `failed` int(11) DEFAULT 0, + `processed` int(11) DEFAULT 0, + `error` text DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `finished` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), - KEY `list` (`list`), - CONSTRAINT `importer_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE + KEY `import_runs_import_foreign` (`import`), + CONSTRAINT `import_runs_import_foreign` FOREIGN KEY (`import`) REFERENCES `imports` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - +CREATE TABLE `imports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `list` int(10) unsigned DEFAULT NULL, + `source` int(10) unsigned NOT NULL, + `status` int(10) unsigned NOT NULL, + `settings` longtext DEFAULT NULL, + `mapping_type` int(10) unsigned NOT NULL, + `mapping` longtext DEFAULT NULL, + `last_run` timestamp NULL DEFAULT NULL, + `error` text DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `imports_list_foreign` (`list`), + CONSTRAINT `imports_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `knex_migrations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `batch` int(11) DEFAULT NULL, + `migration_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `knex_migrations` (`id`, `name`, `batch`, `migration_time`) VALUES (1,'20170506102634_v1_to_v2.js',1,NOW()); +CREATE TABLE `knex_migrations_lock` ( + `index` int(10) unsigned NOT NULL AUTO_INCREMENT, + `is_locked` int(11) DEFAULT NULL, + PRIMARY KEY (`index`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `knex_migrations_lock` (`index`, `is_locked`) VALUES (1,0); CREATE TABLE `links` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `campaign` int(11) unsigned NOT NULL, + `campaign` int(10) unsigned NOT NULL, `url` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `clicks` int(11) unsigned NOT NULL DEFAULT '0', + `visits` int(10) unsigned NOT NULL DEFAULT 0, + `hits` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), UNIQUE KEY `campaign_2` (`campaign`,`url`), KEY `campaign` (`campaign`), CONSTRAINT `links_ibfk_1` FOREIGN KEY (`campaign`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE `lists` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL, + `default_form` int(11) unsigned DEFAULT NULL, `name` varchar(255) NOT NULL DEFAULT '', - `description` text, - `subscribers` int(11) unsigned DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `description` text DEFAULT NULL, + `subscribers` int(11) unsigned DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `public_subscribe` tinyint(1) unsigned NOT NULL DEFAULT 1, + `unsubscription_mode` int(11) unsigned NOT NULL DEFAULT 0, + `listunsubscribe_disabled` tinyint(4) unsigned NOT NULL DEFAULT 0, + `namespace` int(10) unsigned NOT NULL, + `contact_email` varchar(255) DEFAULT NULL, + `homepage` varchar(255) DEFAULT NULL, + `to_name` varchar(255) DEFAULT NULL, + `send_configuration` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), - KEY `name` (`name`(191)) + KEY `name` (`name`(191)), + KEY `lists_namespace_foreign` (`namespace`), + KEY `lists_send_configuration_foreign` (`send_configuration`), + CONSTRAINT `lists_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`), + CONSTRAINT `lists_send_configuration_foreign` FOREIGN KEY (`send_configuration`) REFERENCES `send_configurations` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE `segment_rules` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `segment` int(11) unsigned NOT NULL, - `column` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `value` varchar(255) NOT NULL DEFAULT '', +CREATE TABLE `mosaico_templates` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `data` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), - KEY `segment` (`segment`), - CONSTRAINT `segment_rules_ibfk_1` FOREIGN KEY (`segment`) REFERENCES `segments` (`id`) ON DELETE CASCADE + KEY `mosaico_templates_namespace_foreign` (`namespace`), + CONSTRAINT `mosaico_templates_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `mosaico_templates` (`id`, `name`, `description`, `type`, `data`, `created`, `namespace`) VALUES (1,'Versafix One','Default Mosaico Template','html','{\"html\":\"\\n\\n\\n \\n \\n \\n TITLE\\n \\n \\n \\n \\n\\n\\n\\n
\\n\\n \\n
\\n\\n \\n \\n \\n \\n
\\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n \\n \\n \\n \\n
\\n Preferences\\n \\n
\\n
\\n\\n \\n \\n \\n \\n
\\n \\n View in your browser\\n \\n
\\n\\n
\\n\\n
\\n
\\n\\n
\\n\\n
\\n \\n\\n
\\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n
\\n\\n\\n
\\n
\\n\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n
\\n\\n \\n \\n \\n \\n
\\n\\n
\\n\\n
\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Section Title\\n \\n
 
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

\\n
 
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n Section Title\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n
 
\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n \\\"\\\"\\n
\\n \\\"\\\"\\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\n \\\"\\\"\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n \\\"\\\"\\n
\\n \\\"\\\"\\n
\\n \\\"\\\"\\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
 
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n
\\n

Address and Contacts

\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n
\\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n \\n \\n \\n\\n \\n \\n \\n

Email sent to [EMAIL]

\\n Unsubscribe\\n
\\n \\\"sponsor\\\"\\n\\n
\\n
\\n\\n
\\n \\n\\n
\\n\\n\\n\"}',NOW(),1); +CREATE TABLE `namespaces` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `namespace` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `namespaces_namespace_foreign` (`namespace`), + CONSTRAINT `namespaces_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `namespaces` (`id`, `name`, `description`, `namespace`) VALUES (1,'Root','Root namespace',NULL); +CREATE TABLE `permissions_campaign` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_campaign_user_foreign` (`user`), + CONSTRAINT `permissions_campaign_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_campaign_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - +CREATE TABLE `permissions_custom_form` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_custom_form_user_foreign` (`user`), + CONSTRAINT `permissions_custom_form_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `custom_forms` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_custom_form_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_list` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_list_user_foreign` (`user`), + CONSTRAINT `permissions_list_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `lists` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_list_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_mosaico_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_mosaico_template_user_foreign` (`user`), + CONSTRAINT `permissions_mosaico_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_mosaico_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'delete'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'edit'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'manageFiles'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'share'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'view'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'viewFiles'); +CREATE TABLE `permissions_namespace` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_namespace_user_foreign` (`user`), + CONSTRAINT `permissions_namespace_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `namespaces` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_namespace_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createCampaign'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createCustomForm'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createList'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createMosaicoTemplate'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createNamespace'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createReport'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createReportTemplate'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createSendConfiguration'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createTemplate'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'delete'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'edit'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'manageUsers'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'share'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'view'); +CREATE TABLE `permissions_report` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_report_user_foreign` (`user`), + CONSTRAINT `permissions_report_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `reports` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_report_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_report_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_report_template_user_foreign` (`user`), + CONSTRAINT `permissions_report_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `report_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_report_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_send_configuration` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_send_configuration_user_foreign` (`user`), + CONSTRAINT `permissions_send_configuration_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `send_configurations` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_send_configuration_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'delete'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'edit'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'sendWithAllowedOverrides'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'sendWithAnyOverrides'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'sendWithoutOverrides'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'share'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'viewPrivate'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'viewPublic'); +CREATE TABLE `permissions_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_template_user_foreign` (`user`), + CONSTRAINT `permissions_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `queued` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `trigger` varchar(255) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `created` (`created`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `report_templates` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT '', + `mime_type` varchar(255) NOT NULL DEFAULT 'text/html', + `description` text DEFAULT NULL, + `user_fields` longtext DEFAULT NULL, + `js` longtext DEFAULT NULL, + `hbs` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `report_templates_namespace_foreign` (`namespace`), + CONSTRAINT `report_templates_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `reports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT '', + `description` text DEFAULT NULL, + `report_template` int(10) unsigned NOT NULL, + `params` longtext DEFAULT NULL, + `state` int(11) unsigned NOT NULL DEFAULT 0, + `last_run` timestamp NULL DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `report_template` (`report_template`), + KEY `reports_namespace_foreign` (`namespace`), + CONSTRAINT `reports_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`), + CONSTRAINT `reports_report_template_foreign` FOREIGN KEY (`report_template`) REFERENCES `report_templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `rss` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parent` int(10) unsigned NOT NULL, + `guid` varchar(255) NOT NULL DEFAULT '', + `pubdate` timestamp NULL DEFAULT NULL, + `campaign` int(10) unsigned DEFAULT NULL, + `found` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `parent_2` (`parent`,`guid`), + KEY `parent` (`parent`), + CONSTRAINT `rss_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `segments` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `list` int(10) unsigned NOT NULL, `name` varchar(255) NOT NULL DEFAULT '', - `type` tinyint(4) unsigned NOT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), + `settings` longtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `list` (`list`), - KEY `name` (`name`), - CONSTRAINT `segments_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE + KEY `name` (`name`(191)), + CONSTRAINT `segments_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - +CREATE TABLE `send_configurations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cid` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `from_email` varchar(255) DEFAULT NULL, + `from_email_overridable` tinyint(1) DEFAULT 0, + `from_name` varchar(255) DEFAULT NULL, + `from_name_overridable` tinyint(1) DEFAULT 0, + `reply_to` varchar(255) DEFAULT NULL, + `reply_to_overridable` tinyint(1) DEFAULT 0, + `subject` varchar(255) DEFAULT NULL, + `subject_overridable` tinyint(1) DEFAULT 0, + `verp_hostname` varchar(255) DEFAULT NULL, + `mailer_type` varchar(255) DEFAULT NULL, + `mailer_settings` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned DEFAULT NULL, + `x_mailer` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `send_configurations_namespace_foreign` (`namespace`), + CONSTRAINT `send_configurations_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `send_configurations` (`id`, `cid`, `name`, `description`, `from_email`, `from_email_overridable`, `from_name`, `from_name_overridable`, `reply_to`, `reply_to_overridable`, `subject`, `subject_overridable`, `verp_hostname`, `mailer_type`, `mailer_settings`, `created`, `namespace`, `x_mailer`) VALUES (1,'system','System','Send configuration used to deliver system emails','admin@example.com',1,'My Awesome Company',1,'admin@example.com',1,'Test message',1,NULL,'zone_mta','{\"maxConnections\":5,\"throttling\":0,\"logTransactions\":false,\"maxMessages\":100,\"zoneMtaType\":3}',NOW(),1,NULL); CREATE TABLE `settings` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `key` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', `value` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `key` (`key`) -) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4; - -LOCK TABLES `settings` WRITE; -INSERT INTO `settings` VALUES (1,'smtp_hostname','localhost'),(2,'smtp_port','465'),(3,'smtp_encryption','TLS'),(4,'smtp_user','username'),(5,'smtp_pass','password'),(6,'service_url','http://localhost:3000/'),(7,'admin_email','admin@example.com'),(8,'smtp_max_connections','5'),(9,'smtp_max_messages','100'),(10,'smtp_log',''),(11,'default_sender','My Awesome Company'),(12,'default_postaddress','1234 Main Street'),(13,'default_from','My Awesome Company'),(14,'default_address','admin@example.com'),(15,'default_subject','Test message'),(16,'default_homepage','http://localhost:3000/'); -UNLOCK TABLES; - -CREATE TABLE `subscription` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `cid` varchar(255) CHARACTER SET ascii NOT NULL, - `email` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', - `opt_in_ip` varchar(100) DEFAULT NULL, - `opt_in_country` varchar(2) DEFAULT NULL, - `imported` int(11) unsigned DEFAULT NULL, - `status` tinyint(4) unsigned NOT NULL DEFAULT '1', - `status_change` timestamp NULL DEFAULT NULL, - `latest_open` timestamp NULL DEFAULT NULL, - `latest_click` timestamp NULL DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `first_name` varchar(255) DEFAULT NULL, - `last_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `email` (`email`), - UNIQUE KEY `cid` (`cid`), - KEY `status` (`status`), - KEY `first_name` (`first_name`(191)), - KEY `last_name` (`last_name`(191)) +) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4; +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (51,'uaCode',''); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (52,'shoutout',''); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (53,'adminEmail','admin@example.com'); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (54,'defaultHomepage','http://localhost:3000/'); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (55,'pgpPassphrase',''); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (56,'pgpPrivateKey',''); +CREATE TABLE `shares_campaign` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_campaign_user_foreign` (`user`), + CONSTRAINT `shares_campaign_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_campaign_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_custom_form` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_custom_form_user_foreign` (`user`), + CONSTRAINT `shares_custom_form_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `custom_forms` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_custom_form_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_list` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_list_user_foreign` (`user`), + CONSTRAINT `shares_list_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `lists` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_list_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_mosaico_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_mosaico_template_user_foreign` (`user`), + CONSTRAINT `shares_mosaico_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_mosaico_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_namespace` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_namespace_user_foreign` (`user`), + CONSTRAINT `shares_namespace_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `namespaces` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_namespace_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `shares_namespace` (`entity`, `user`, `role`, `auto`) VALUES (1,1,'master',1); +CREATE TABLE `shares_report` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_report_user_foreign` (`user`), + CONSTRAINT `shares_report_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `reports` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_report_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_report_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_report_template_user_foreign` (`user`), + CONSTRAINT `shares_report_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `report_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_report_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_send_configuration` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_send_configuration_user_foreign` (`user`), + CONSTRAINT `shares_send_configuration_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `send_configurations` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_send_configuration_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_template_user_foreign` (`user`), + CONSTRAINT `shares_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `template_dep_campaigns` ( + `template` int(10) unsigned NOT NULL, + `campaign` int(10) unsigned NOT NULL, + PRIMARY KEY (`campaign`), + KEY `template_dep_campaigns_template_foreign` (`template`), + CONSTRAINT `template_dep_campaigns_campaign_foreign` FOREIGN KEY (`campaign`) REFERENCES `campaigns` (`id`), + CONSTRAINT `template_dep_campaigns_template_foreign` FOREIGN KEY (`template`) REFERENCES `templates` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE `templates` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', - `description` text, - `html` text, - `text` text, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `description` text DEFAULT NULL, + `html` longtext DEFAULT NULL, + `text` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + `data` longtext DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `name` (`name`(191)) + KEY `name` (`name`(191)), + KEY `templates_namespace_foreign` (`namespace`), + CONSTRAINT `templates_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - +CREATE TABLE `trigger_messages` ( + `trigger` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`trigger`,`list`,`subscription`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `triggers` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `description` text DEFAULT NULL, + `enabled` tinyint(4) unsigned NOT NULL DEFAULT 1, + `source_campaign` int(10) unsigned DEFAULT NULL, + `entity` varchar(255) NOT NULL DEFAULT 'column', + `event` varchar(255) DEFAULT NULL, + `seconds` int(11) NOT NULL DEFAULT 0, + `campaign` int(10) unsigned DEFAULT NULL, + `count` int(11) unsigned NOT NULL DEFAULT 0, + `last_check` timestamp NULL DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `name` (`name`(191)), + KEY `source_campaign` (`source_campaign`), + KEY `dest_campaign` (`campaign`), + KEY `column` (`event`), + KEY `active` (`enabled`), + KEY `last_check` (`last_check`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `tzoffset` ( + `tz` varchar(100) NOT NULL DEFAULT '', + `offset` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`tz`) +) ENGINE=InnoDB DEFAULT CHARSET=ascii; +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/abidjan',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/accra',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/addis_ababa',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/algiers',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/asmara',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/asmera',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bamako',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bangui',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/banjul',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bissau',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/blantyre',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/brazzaville',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bujumbura',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/cairo',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/casablanca',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/ceuta',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/conakry',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/dakar',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/dar_es_salaam',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/djibouti',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/douala',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/el_aaiun',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/freetown',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/gaborone',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/harare',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/johannesburg',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/juba',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/kampala',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/khartoum',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/kigali',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/kinshasa',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lagos',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/libreville',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lome',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/luanda',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lubumbashi',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lusaka',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/malabo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/maputo',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/maseru',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/mbabane',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/mogadishu',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/monrovia',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/nairobi',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/ndjamena',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/niamey',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/nouakchott',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/ouagadougou',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/porto-novo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/sao_tome',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/timbuktu',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/tripoli',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/tunis',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/windhoek',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/adak',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/anchorage',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/anguilla',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/antigua',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/araguaina',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/buenos_aires',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/catamarca',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/comodrivadavia',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/cordoba',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/jujuy',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/la_rioja',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/mendoza',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/rio_gallegos',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/salta',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/san_juan',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/san_luis',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/tucuman',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/ushuaia',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/aruba',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/asuncion',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/atikokan',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/atka',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/bahia',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/bahia_banderas',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/barbados',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/belem',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/belize',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/blanc-sablon',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/boa_vista',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/bogota',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/boise',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/buenos_aires',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cambridge_bay',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/campo_grande',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cancun',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/caracas',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/catamarca',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cayenne',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cayman',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/chicago',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/chihuahua',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/coral_harbour',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cordoba',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/costa_rica',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/creston',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cuiaba',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/curacao',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/danmarkshavn',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/dawson',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/dawson_creek',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/denver',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/detroit',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/dominica',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/edmonton',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/eirunepe',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/el_salvador',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/ensenada',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/fortaleza',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/fort_nelson',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/fort_wayne',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/glace_bay',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/godthab',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/goose_bay',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/grand_turk',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/grenada',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guadeloupe',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guatemala',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guayaquil',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guyana',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/halifax',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/havana',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/hermosillo',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/indianapolis',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/knox',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/marengo',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/petersburg',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/tell_city',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/vevay',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/vincennes',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/winamac',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indianapolis',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/inuvik',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/iqaluit',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/jamaica',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/jujuy',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/juneau',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/kentucky/louisville',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/kentucky/monticello',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/knox_in',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/kralendijk',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/la_paz',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/lima',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/los_angeles',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/louisville',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/lower_princes',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/maceio',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/managua',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/manaus',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/marigot',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/martinique',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/matamoros',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/mazatlan',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/mendoza',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/menominee',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/merida',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/metlakatla',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/mexico_city',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/miquelon',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/moncton',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/monterrey',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/montevideo',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/montreal',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/montserrat',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/nassau',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/new_york',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/nipigon',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/nome',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/noronha',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/north_dakota/beulah',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/north_dakota/center',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/north_dakota/new_salem',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/ojinaga',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/panama',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/pangnirtung',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/paramaribo',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/phoenix',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/port-au-prince',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/porto_acre',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/porto_velho',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/port_of_spain',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/puerto_rico',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/punta_arenas',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rainy_river',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rankin_inlet',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/recife',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/regina',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/resolute',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rio_branco',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rosario',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santarem',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santa_isabel',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santiago',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santo_domingo',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/sao_paulo',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/scoresbysund',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/shiprock',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/sitka',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_barthelemy',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_johns',-210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_kitts',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_lucia',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_thomas',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_vincent',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/swift_current',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/tegucigalpa',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/thule',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/thunder_bay',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/tijuana',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/toronto',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/tortola',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/vancouver',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/virgin',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/whitehorse',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/winnipeg',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/yakutat',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/yellowknife',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/casey',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/davis',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/dumontdurville',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/macquarie',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/mawson',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/mcmurdo',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/palmer',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/rothera',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/south_pole',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/syowa',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/troll',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/vostok',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('arctic/longyearbyen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/aden',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/almaty',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/amman',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/anadyr',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/aqtau',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/aqtobe',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ashgabat',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ashkhabad',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/atyrau',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/baghdad',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/bahrain',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/baku',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/bangkok',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/barnaul',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/beirut',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/bishkek',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/brunei',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/calcutta',330); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/chita',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/choibalsan',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/chongqing',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/chungking',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/colombo',330); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dacca',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/damascus',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dhaka',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dili',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dubai',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dushanbe',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/famagusta',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/gaza',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/harbin',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/hebron',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/hong_kong',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/hovd',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ho_chi_minh',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/irkutsk',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/istanbul',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/jakarta',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/jayapura',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/jerusalem',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kabul',270); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kamchatka',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/karachi',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kashgar',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kathmandu',345); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/katmandu',345); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/khandyga',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kolkata',330); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/krasnoyarsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kuala_lumpur',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kuching',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kuwait',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/macao',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/macau',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/magadan',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/makassar',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/manila',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/muscat',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/nicosia',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/novokuznetsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/novosibirsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/omsk',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/oral',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/phnom_penh',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/pontianak',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/pyongyang',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/qatar',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/qyzylorda',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/rangoon',390); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/riyadh',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/saigon',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/sakhalin',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/samarkand',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/seoul',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/shanghai',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/singapore',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/srednekolymsk',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/taipei',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tashkent',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tbilisi',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tehran',210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tel_aviv',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/thimbu',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/thimphu',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tokyo',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tomsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ujung_pandang',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ulaanbaatar',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ulan_bator',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/urumqi',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ust-nera',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/vientiane',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/vladivostok',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yakutsk',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yangon',390); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yekaterinburg',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yerevan',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/azores',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/bermuda',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/canary',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/cape_verde',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/faeroe',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/faroe',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/jan_mayen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/madeira',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/reykjavik',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/south_georgia',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/stanley',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/st_helena',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/act',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/adelaide',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/brisbane',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/broken_hill',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/canberra',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/currie',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/darwin',570); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/eucla',525); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/hobart',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/lhi',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/lindeman',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/lord_howe',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/melbourne',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/north',570); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/nsw',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/perth',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/queensland',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/south',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/sydney',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/tasmania',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/victoria',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/west',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/yancowinna',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/acre',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/denoronha',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/east',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/west',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/atlantic',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/central',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/eastern',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/mountain',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/newfoundland',-210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/pacific',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/saskatchewan',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/yukon',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('cet',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('chile/continental',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('chile/easterisland',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('cst6cdt',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('cuba',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('eet',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('egypt',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('eire',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('est',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('est5edt',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+1',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+10',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+11',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+12',-720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+2',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+3',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+4',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+5',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+6',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+7',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+8',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+9',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-1',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-10',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-11',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-12',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-13',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-14',840); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-2',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-3',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-4',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-5',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-6',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-7',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-8',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-9',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/greenwich',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/uct',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/universal',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/utc',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/zulu',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/amsterdam',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/andorra',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/astrakhan',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/athens',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/belfast',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/belgrade',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/berlin',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/bratislava',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/brussels',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/bucharest',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/budapest',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/busingen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/chisinau',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/copenhagen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/dublin',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/gibraltar',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/guernsey',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/helsinki',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/isle_of_man',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/istanbul',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/jersey',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/kaliningrad',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/kiev',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/kirov',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/lisbon',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/ljubljana',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/london',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/luxembourg',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/madrid',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/malta',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/mariehamn',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/minsk',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/monaco',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/moscow',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/nicosia',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/oslo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/paris',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/podgorica',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/prague',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/riga',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/rome',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/samara',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/san_marino',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/sarajevo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/saratov',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/simferopol',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/skopje',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/sofia',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/stockholm',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/tallinn',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/tirane',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/tiraspol',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/ulyanovsk',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/uzhgorod',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vaduz',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vatican',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vienna',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vilnius',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/volgograd',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/warsaw',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/zagreb',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/zaporozhye',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/zurich',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gb',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gb-eire',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt+0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt-0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('greenwich',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('hongkong',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('hst',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('iceland',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/antananarivo',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/chagos',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/christmas',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/cocos',390); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/comoro',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/kerguelen',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/mahe',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/maldives',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/mauritius',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/mayotte',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/reunion',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('iran',210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('israel',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('jamaica',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('japan',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('kwajalein',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('libya',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('met',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mexico/bajanorte',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mexico/bajasur',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mexico/general',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mst',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mst7mdt',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('navajo',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('nz',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('nz-chat',825); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/apia',840); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/auckland',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/bougainville',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/chatham',825); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/chuuk',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/easter',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/efate',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/enderbury',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/fakaofo',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/fiji',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/funafuti',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/galapagos',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/gambier',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/guadalcanal',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/guam',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/honolulu',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/johnston',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/kiritimati',840); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/kosrae',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/kwajalein',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/majuro',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/marquesas',-570); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/midway',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/nauru',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/niue',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/norfolk',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/noumea',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/pago_pago',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/palau',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/pitcairn',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/pohnpei',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/ponape',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/port_moresby',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/rarotonga',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/saipan',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/samoa',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/tahiti',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/tarawa',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/tongatapu',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/truk',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/wake',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/wallis',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/yap',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('poland',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('portugal',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('prc',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pst8pdt',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('roc',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('rok',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('singapore',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('turkey',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('uct',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('universal',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/alaska',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/aleutian',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/arizona',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/central',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/east-indiana',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/eastern',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/hawaii',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/indiana-starke',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/michigan',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/mountain',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/pacific',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/pacific-new',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/samoa',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('utc',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('w-su',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('wet',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('zulu',0); CREATE TABLE `users` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL DEFAULT '', - `password` varchar(255) NOT NULL DEFAULT '', + `password` varchar(255) DEFAULT NULL, `email` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `access_token` varchar(40) DEFAULT NULL, `reset_token` varchar(255) CHARACTER SET ascii DEFAULT NULL, `reset_expire` timestamp NULL DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + `name` varchar(255) DEFAULT NULL, + `role` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), KEY `username` (`username`(191)), KEY `reset` (`reset_token`), - KEY `check_reset` (`username`(191),`reset_token`,`reset_expire`) + KEY `check_reset` (`username`(191),`reset_token`,`reset_expire`), + KEY `token_index` (`access_token`), + KEY `users_namespace_foreign` (`namespace`), + CONSTRAINT `users_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; - -LOCK TABLES `users` WRITE; -INSERT INTO `users` VALUES (1,'admin','$2a$10$mzKU71G62evnGB2PvQA4k..Wf9jASk.c7a8zRMHh6qQVjYJ2r/g/K','admin@example.com',NULL,NULL,NOW()); -UNLOCK TABLES; +INSERT INTO `users` (`id`, `username`, `password`, `email`, `access_token`, `reset_token`, `reset_expire`, `created`, `namespace`, `name`, `role`) VALUES (1,'admin','$2a$10$mzKU71G62evnGB2PvQA4k..Wf9jASk.c7a8zRMHh6qQVjYJ2r/g/K','admin@example.com',NULL,NULL,NULL,NOW(),1,'Administrator','master'); SET UNIQUE_CHECKS=1; SET FOREIGN_KEY_CHECKS=1; + diff --git a/server/setup/sql/mailtrain.sql b/server/setup/sql/mailtrain.sql index d56c9806..e4d708d7 100644 --- a/server/setup/sql/mailtrain.sql +++ b/server/setup/sql/mailtrain.sql @@ -1,80 +1,83 @@ SET UNIQUE_CHECKS=0; SET FOREIGN_KEY_CHECKS=0; -CREATE TABLE `attachments` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `campaign` int(11) unsigned NOT NULL, - `filename` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', - `content_type` varchar(100) CHARACTER SET ascii NOT NULL DEFAULT '', - `content` longblob, - `size` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, +CREATE TABLE `blacklist` ( + `email` varchar(191) NOT NULL, + PRIMARY KEY (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `campaign_links` ( + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `link` int(10) NOT NULL, + `ip` varchar(100) CHARACTER SET ascii DEFAULT NULL, + `device_type` varchar(50) DEFAULT NULL, + `country` varchar(2) CHARACTER SET ascii DEFAULT NULL, + `count` int(10) unsigned NOT NULL DEFAULT 1, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`campaign`,`list`,`subscription`,`link`), + KEY `created_index` (`created`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `campaign_lists` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `segment` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), - KEY `campaign` (`campaign`), - CONSTRAINT `attachments_ibfk_1` FOREIGN KEY (`campaign`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `campaign` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, - `segment` int(11) unsigned NOT NULL, - `subscription` int(11) unsigned NOT NULL, - `status` tinyint(4) unsigned NOT NULL DEFAULT '0', + KEY `campaign_lists_list_foreign` (`list`), + KEY `campaign_lists_segment_foreign` (`segment`), + KEY `campaign_lists_campaign_foreign` (`campaign`), + CONSTRAINT `campaign_lists_campaign_foreign` FOREIGN KEY (`campaign`) REFERENCES `campaigns` (`id`), + CONSTRAINT `campaign_lists_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`), + CONSTRAINT `campaign_lists_segment_foreign` FOREIGN KEY (`segment`) REFERENCES `segments` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `campaign_messages` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `send_configuration` int(10) unsigned NOT NULL, + `status` tinyint(4) unsigned NOT NULL DEFAULT 0, `response` varchar(255) DEFAULT NULL, `response_id` varchar(255) CHARACTER SET ascii DEFAULT NULL, `updated` timestamp NULL DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), - UNIQUE KEY `list` (`list`,`segment`,`subscription`), + UNIQUE KEY `cls` (`campaign`,`list`,`subscription`), KEY `created` (`created`), KEY `response_id` (`response_id`), KEY `status_index` (`status`), KEY `subscription_index` (`subscription`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE `campaign_tracker` ( - `list` int(11) unsigned NOT NULL, - `subscriber` int(11) unsigned NOT NULL, - `link` int(11) NOT NULL, - `ip` varchar(100) CHARACTER SET ascii DEFAULT NULL, - `device_type` varchar(50) DEFAULT NULL, - `country` varchar(2) CHARACTER SET ascii DEFAULT NULL, - `count` int(11) unsigned NOT NULL DEFAULT '1', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`list`,`subscriber`,`link`), - KEY `created_index` (`created`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `campaigns` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL, - `type` tinyint(4) unsigned NOT NULL DEFAULT '1', - `parent` int(11) unsigned DEFAULT NULL, + `type` tinyint(4) unsigned NOT NULL DEFAULT 1, + `parent` int(10) unsigned DEFAULT NULL, `name` varchar(255) NOT NULL DEFAULT '', - `description` text, - `list` int(11) unsigned NOT NULL, - `segment` int(11) unsigned DEFAULT NULL, - `template` int(11) unsigned NOT NULL, - `source_url` varchar(255) CHARACTER SET ascii DEFAULT NULL, - `editor_name` varchar(50) DEFAULT '', - `editor_data` longtext, + `description` text DEFAULT NULL, `last_check` timestamp NULL DEFAULT NULL, - `check_status` varchar(255) DEFAULT NULL, - `from` varchar(255) DEFAULT '', - `address` varchar(255) DEFAULT '', - `reply_to` varchar(255) DEFAULT '', - `subject` varchar(255) DEFAULT '', - `html` longtext, - `html_prepared` longtext, - `text` longtext, - `status` tinyint(4) unsigned NOT NULL DEFAULT '1', - `tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT '0', + `from_name_override` varchar(255) DEFAULT '', + `from_email_override` varchar(255) DEFAULT '', + `reply_to_override` varchar(255) DEFAULT '', + `subject_override` varchar(255) DEFAULT '', + `unsubscribe_url` varchar(255) NOT NULL DEFAULT '', + `status` tinyint(4) unsigned NOT NULL DEFAULT 1, `scheduled` timestamp NULL DEFAULT NULL, - `status_change` timestamp NULL DEFAULT NULL, - `delivered` int(11) unsigned NOT NULL DEFAULT '0', - `opened` int(11) unsigned NOT NULL DEFAULT '0', - `clicks` int(11) unsigned NOT NULL DEFAULT '0', - `unsubscribed` int(11) unsigned NOT NULL DEFAULT '0', - `bounced` int(1) unsigned NOT NULL DEFAULT '0', - `complained` int(1) unsigned NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `delivered` int(11) unsigned NOT NULL DEFAULT 0, + `blacklisted` int(11) unsigned NOT NULL DEFAULT 0, + `opened` int(11) unsigned NOT NULL DEFAULT 0, + `clicks` int(11) unsigned NOT NULL DEFAULT 0, + `unsubscribed` int(11) unsigned NOT NULL DEFAULT 0, + `bounced` int(1) unsigned NOT NULL DEFAULT 0, + `complained` int(1) unsigned NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `open_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT 0, + `click_tracking_disabled` tinyint(4) unsigned NOT NULL DEFAULT 0, + `namespace` int(10) unsigned NOT NULL, + `data` longtext DEFAULT NULL, + `source` int(10) unsigned NOT NULL, + `send_configuration` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), KEY `name` (`name`(191)), @@ -82,97 +85,206 @@ CREATE TABLE `campaigns` ( KEY `schedule_index` (`scheduled`), KEY `type_index` (`type`), KEY `parent_index` (`parent`), - KEY `check_index` (`last_check`) + KEY `check_index` (`last_check`), + KEY `campaigns_namespace_foreign` (`namespace`), + KEY `campaigns_send_configuration_foreign` (`send_configuration`), + CONSTRAINT `campaigns_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`), + CONSTRAINT `campaigns_send_configuration_foreign` FOREIGN KEY (`send_configuration`) REFERENCES `send_configurations` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `confirmations` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL, - `list` int(11) unsigned NOT NULL, - `email` varchar(255) NOT NULL, - `opt_in_ip` varchar(100) DEFAULT NULL, + `list` int(10) unsigned NOT NULL, + `action` varchar(100) NOT NULL, + `ip` varchar(100) DEFAULT NULL, `data` text NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), KEY `list` (`list`), CONSTRAINT `confirmations_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `custom_fields` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `list` int(10) unsigned NOT NULL, `name` varchar(255) DEFAULT '', `key` varchar(100) CHARACTER SET ascii NOT NULL, `default_value` varchar(255) DEFAULT NULL, `type` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `group` int(11) unsigned DEFAULT NULL, - `group_template` text, + `group` int(10) unsigned DEFAULT NULL, `column` varchar(255) CHARACTER SET ascii DEFAULT NULL, - `visible` tinyint(4) unsigned NOT NULL DEFAULT '1', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `order_subscribe` int(11) DEFAULT NULL, + `order_manage` int(11) DEFAULT NULL, + `order_list` int(11) DEFAULT NULL, + `settings` longtext DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `list` (`list`,`column`), KEY `list_2` (`list`), - CONSTRAINT `custom_fields_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE + CONSTRAINT `custom_fields_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `custom_forms` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT '', - `description` text, - `fields_shown_on_subscribe` varchar(255) DEFAULT '', - `fields_shown_on_manage` varchar(255) DEFAULT '', - `layout` longtext, - `form_input_style` longtext, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `description` text DEFAULT NULL, + `layout` longtext DEFAULT NULL, + `form_input_style` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), - KEY `list` (`list`), - CONSTRAINT `custom_forms_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE + KEY `custom_forms_namespace_foreign` (`namespace`), + CONSTRAINT `custom_forms_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `custom_forms_data` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `form` int(11) unsigned NOT NULL, - `data_key` varchar(255) DEFAULT '', - `data_value` longtext, - PRIMARY KEY (`id`), + `form` int(10) unsigned NOT NULL, + `data_key` varchar(128) NOT NULL, + `data_value` longtext DEFAULT NULL, + PRIMARY KEY (`form`,`data_key`), KEY `form` (`form`), CONSTRAINT `custom_forms_data_ibfk_1` FOREIGN KEY (`form`) REFERENCES `custom_forms` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE `import_failed` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `import` int(11) unsigned NOT NULL, - `email` varchar(255) NOT NULL DEFAULT '', - `reason` varchar(255) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, +CREATE TABLE `files_campaign_attachment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), - KEY `import` (`import`), - CONSTRAINT `import_failed_ibfk_1` FOREIGN KEY (`import`) REFERENCES `importer` (`id`) ON DELETE CASCADE + KEY `files_campaign_attachment_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_campaign_attachment_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE `importer` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, - `type` tinyint(4) unsigned NOT NULL DEFAULT '1', - `path` varchar(255) NOT NULL DEFAULT '', - `size` int(11) unsigned NOT NULL DEFAULT '0', - `delimiter` varchar(1) CHARACTER SET ascii NOT NULL DEFAULT ',', - `emailcheck` tinyint(4) unsigned NOT NULL DEFAULT '1', - `status` tinyint(4) unsigned NOT NULL DEFAULT '0', - `error` varchar(255) DEFAULT NULL, - `processed` int(11) unsigned NOT NULL DEFAULT '0', - `new` int(11) unsigned NOT NULL DEFAULT '0', - `failed` int(11) unsigned NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `mapping` text NOT NULL, +CREATE TABLE `files_campaign_file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_campaign_file_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_campaign_file_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_mosaico_template_block` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_mosaico_template_block_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_mosaico_template_block_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_mosaico_template_file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_mosaico_template_file_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_mosaico_template_file_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `files_template_file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `entity` int(10) unsigned NOT NULL, + `filename` varchar(255) DEFAULT NULL, + `originalname` varchar(255) DEFAULT NULL, + `mimetype` varchar(255) DEFAULT NULL, + `size` int(11) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `files_template_file_entity_originalname_index` (`entity`,`originalname`), + CONSTRAINT `files_template_file_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `generated_role_names` ( + `entity_type` varchar(32) NOT NULL, + `role` varchar(128) NOT NULL, + `name` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`entity_type`,`role`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('campaign','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('customForm','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('global','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('list','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('mosaicoTemplate','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('namespace','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('report','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('reportTemplate','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('sendConfiguration','master','Master','All permissions'); +INSERT INTO `generated_role_names` (`entity_type`, `role`, `name`, `description`) VALUES ('template','master','Master','All permissions'); +CREATE TABLE `import_failed` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `run` int(10) unsigned DEFAULT NULL, + `source_id` int(10) unsigned DEFAULT NULL, + `email` varchar(255) NOT NULL, + `reason` text DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `import_failed_run_foreign` (`run`), + CONSTRAINT `import_failed_run_foreign` FOREIGN KEY (`run`) REFERENCES `import_runs` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `import_runs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `import` int(10) unsigned DEFAULT NULL, + `status` int(10) unsigned NOT NULL, + `mapping` longtext DEFAULT NULL, + `last_id` int(11) DEFAULT NULL, + `new` int(11) DEFAULT 0, + `failed` int(11) DEFAULT 0, + `processed` int(11) DEFAULT 0, + `error` text DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `finished` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), - KEY `list` (`list`), - CONSTRAINT `importer_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE + KEY `import_runs_import_foreign` (`import`), + CONSTRAINT `import_runs_import_foreign` FOREIGN KEY (`import`) REFERENCES `imports` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `imports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `list` int(10) unsigned DEFAULT NULL, + `source` int(10) unsigned NOT NULL, + `status` int(10) unsigned NOT NULL, + `settings` longtext DEFAULT NULL, + `mapping_type` int(10) unsigned NOT NULL, + `mapping` longtext DEFAULT NULL, + `last_run` timestamp NULL DEFAULT NULL, + `error` text DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `imports_list_foreign` (`list`), + CONSTRAINT `imports_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `knex_migrations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `batch` int(11) DEFAULT NULL, + `migration_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `knex_migrations` (`id`, `name`, `batch`, `migration_time`) VALUES (1,'20170506102634_v1_to_v2.js',1,NOW()); +CREATE TABLE `knex_migrations_lock` ( + `index` int(10) unsigned NOT NULL AUTO_INCREMENT, + `is_locked` int(11) DEFAULT NULL, + PRIMARY KEY (`index`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `knex_migrations_lock` (`index`, `is_locked`) VALUES (1,0); CREATE TABLE `links` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `campaign` int(11) unsigned NOT NULL, + `campaign` int(10) unsigned NOT NULL, `url` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `clicks` int(11) unsigned NOT NULL DEFAULT '0', + `visits` int(10) unsigned NOT NULL DEFAULT 0, + `hits` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), UNIQUE KEY `campaign_2` (`campaign`,`url`), @@ -180,174 +292,1023 @@ CREATE TABLE `links` ( CONSTRAINT `links_ibfk_1` FOREIGN KEY (`campaign`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `lists` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cid` varchar(255) CHARACTER SET ascii NOT NULL, `default_form` int(11) unsigned DEFAULT NULL, `name` varchar(255) NOT NULL DEFAULT '', - `description` text, - `subscribers` int(11) unsigned DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `description` text DEFAULT NULL, + `subscribers` int(11) unsigned DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `public_subscribe` tinyint(1) unsigned NOT NULL DEFAULT 1, + `unsubscription_mode` int(11) unsigned NOT NULL DEFAULT 0, + `listunsubscribe_disabled` tinyint(4) unsigned NOT NULL DEFAULT 0, + `namespace` int(10) unsigned NOT NULL, + `contact_email` varchar(255) DEFAULT NULL, + `homepage` varchar(255) DEFAULT NULL, + `to_name` varchar(255) DEFAULT NULL, + `send_configuration` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cid` (`cid`), - KEY `name` (`name`(191)) + KEY `name` (`name`(191)), + KEY `lists_namespace_foreign` (`namespace`), + KEY `lists_send_configuration_foreign` (`send_configuration`), + CONSTRAINT `lists_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`), + CONSTRAINT `lists_send_configuration_foreign` FOREIGN KEY (`send_configuration`) REFERENCES `send_configurations` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `mosaico_templates` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `data` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `mosaico_templates_namespace_foreign` (`namespace`), + CONSTRAINT `mosaico_templates_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `mosaico_templates` (`id`, `name`, `description`, `type`, `data`, `created`, `namespace`) VALUES (1,'Versafix One','Default Mosaico Template','html','{\"html\":\"\\n\\n\\n \\n \\n \\n TITLE\\n \\n \\n \\n \\n\\n\\n\\n
\\n\\n \\n
\\n\\n \\n \\n \\n \\n
\\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n \\n \\n \\n \\n
\\n Preferences\\n \\n
\\n
\\n\\n \\n \\n \\n \\n
\\n \\n View in your browser\\n \\n
\\n\\n
\\n\\n
\\n
\\n\\n
\\n\\n
\\n \\n\\n
\\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n
\\n\\n\\n
\\n
\\n\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n
\\n\\n \\n \\n \\n \\n
\\n\\n
\\n\\n
\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Section Title\\n \\n
 
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

\\n
 
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n Section Title\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n

Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.

\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n Title\\n \\n
\\n

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.

\\n
\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n
 
\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n \\n \\n \\n \\n
\\n BUTTON\\n
\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n \\\"\\\"\\n
\\n \\\"\\\"\\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\n \\\"\\\"\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n \\\"\\\"\\n
\\n \\\"\\\"\\n
\\n \\\"\\\"\\n
\\n\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n \\n \\n \\n \\n
\\n \\\"\\\"\\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n \\n \\n \\n \\n \\n
 
\\n \\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n \\n \\n \\n \\n
\\n\\n\\n\\n
\\n\\n \\n \\n \\n \\n
\\n

Address and Contacts

\\n
\\n\\n
\\n\\n \\n \\n \\n \\n \\n
\\n\\n
\\n\\n\\n\\n
\\n
\\n\\n
\\n \\n\\n
\\n\\n \\n \\n \\n \\n \\n
\\n\\n\\n
\\n \\n \\n \\n \\n \\n \\n \\n\\n \\n \\n \\n

Email sent to [EMAIL]

\\n Unsubscribe\\n
\\n \\\"sponsor\\\"\\n\\n
\\n
\\n\\n
\\n \\n\\n
\\n\\n\\n\"}',NOW(),1); +CREATE TABLE `namespaces` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `namespace` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `namespaces_namespace_foreign` (`namespace`), + CONSTRAINT `namespaces_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `namespaces` (`id`, `name`, `description`, `namespace`) VALUES (1,'Root','Root namespace',NULL); +CREATE TABLE `permissions_campaign` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_campaign_user_foreign` (`user`), + CONSTRAINT `permissions_campaign_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_campaign_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_custom_form` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_custom_form_user_foreign` (`user`), + CONSTRAINT `permissions_custom_form_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `custom_forms` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_custom_form_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_list` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_list_user_foreign` (`user`), + CONSTRAINT `permissions_list_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `lists` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_list_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_mosaico_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_mosaico_template_user_foreign` (`user`), + CONSTRAINT `permissions_mosaico_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_mosaico_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'delete'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'edit'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'manageFiles'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'share'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'view'); +INSERT INTO `permissions_mosaico_template` (`entity`, `user`, `operation`) VALUES (1,1,'viewFiles'); +CREATE TABLE `permissions_namespace` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_namespace_user_foreign` (`user`), + CONSTRAINT `permissions_namespace_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `namespaces` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_namespace_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createCampaign'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createCustomForm'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createList'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createMosaicoTemplate'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createNamespace'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createReport'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createReportTemplate'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createSendConfiguration'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'createTemplate'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'delete'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'edit'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'manageUsers'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'share'); +INSERT INTO `permissions_namespace` (`entity`, `user`, `operation`) VALUES (1,1,'view'); +CREATE TABLE `permissions_report` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_report_user_foreign` (`user`), + CONSTRAINT `permissions_report_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `reports` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_report_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_report_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_report_template_user_foreign` (`user`), + CONSTRAINT `permissions_report_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `report_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_report_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `permissions_send_configuration` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_send_configuration_user_foreign` (`user`), + CONSTRAINT `permissions_send_configuration_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `send_configurations` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_send_configuration_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'delete'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'edit'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'sendWithAllowedOverrides'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'sendWithAnyOverrides'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'sendWithoutOverrides'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'share'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'viewPrivate'); +INSERT INTO `permissions_send_configuration` (`entity`, `user`, `operation`) VALUES (1,1,'viewPublic'); +CREATE TABLE `permissions_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `operation` varchar(128) NOT NULL, + PRIMARY KEY (`entity`,`user`,`operation`), + KEY `permissions_template_user_foreign` (`user`), + CONSTRAINT `permissions_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `permissions_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `queued` ( - `campaign` int(11) unsigned NOT NULL, - `list` int(11) unsigned NOT NULL, - `subscriber` int(11) unsigned NOT NULL, - `source` varchar(255) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`campaign`,`list`,`subscriber`), + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `campaign` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `trigger` varchar(255) DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), KEY `created` (`created`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `report_templates` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT '', + `mime_type` varchar(255) NOT NULL DEFAULT 'text/html', + `description` text DEFAULT NULL, + `user_fields` longtext DEFAULT NULL, + `js` longtext DEFAULT NULL, + `hbs` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `report_templates_namespace_foreign` (`namespace`), + CONSTRAINT `report_templates_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `reports` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT '', + `description` text DEFAULT NULL, + `report_template` int(10) unsigned NOT NULL, + `params` longtext DEFAULT NULL, + `state` int(11) unsigned NOT NULL DEFAULT 0, + `last_run` timestamp NULL DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `report_template` (`report_template`), + KEY `reports_namespace_foreign` (`namespace`), + CONSTRAINT `reports_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`), + CONSTRAINT `reports_report_template_foreign` FOREIGN KEY (`report_template`) REFERENCES `report_templates` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `rss` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `parent` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parent` int(10) unsigned NOT NULL, `guid` varchar(255) NOT NULL DEFAULT '', `pubdate` timestamp NULL DEFAULT NULL, - `campaign` int(11) unsigned DEFAULT NULL, - `found` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `campaign` int(10) unsigned DEFAULT NULL, + `found` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `parent_2` (`parent`,`guid`), KEY `parent` (`parent`), CONSTRAINT `rss_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `segment_rules` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `segment` int(11) unsigned NOT NULL, - `column` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', - `value` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - KEY `segment` (`segment`), - CONSTRAINT `segment_rules_ibfk_1` FOREIGN KEY (`segment`) REFERENCES `segments` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `segments` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `list` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `list` int(10) unsigned NOT NULL, `name` varchar(255) NOT NULL DEFAULT '', - `type` tinyint(4) unsigned NOT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), + `settings` longtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `list` (`list`), KEY `name` (`name`(191)), - CONSTRAINT `segments_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE + CONSTRAINT `segments_list_foreign` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `send_configurations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cid` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `from_email` varchar(255) DEFAULT NULL, + `from_email_overridable` tinyint(1) DEFAULT 0, + `from_name` varchar(255) DEFAULT NULL, + `from_name_overridable` tinyint(1) DEFAULT 0, + `reply_to` varchar(255) DEFAULT NULL, + `reply_to_overridable` tinyint(1) DEFAULT 0, + `subject` varchar(255) DEFAULT NULL, + `subject_overridable` tinyint(1) DEFAULT 0, + `verp_hostname` varchar(255) DEFAULT NULL, + `mailer_type` varchar(255) DEFAULT NULL, + `mailer_settings` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned DEFAULT NULL, + `x_mailer` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `send_configurations_namespace_foreign` (`namespace`), + CONSTRAINT `send_configurations_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +INSERT INTO `send_configurations` (`id`, `cid`, `name`, `description`, `from_email`, `from_email_overridable`, `from_name`, `from_name_overridable`, `reply_to`, `reply_to_overridable`, `subject`, `subject_overridable`, `verp_hostname`, `mailer_type`, `mailer_settings`, `created`, `namespace`, `x_mailer`) VALUES (1,'system','System','Send configuration used to deliver system emails','admin@example.com',1,'My Awesome Company',1,'admin@example.com',1,'Test message',1,NULL,'zone_mta','{\"maxConnections\":5,\"throttling\":0,\"logTransactions\":false,\"maxMessages\":100,\"zoneMtaType\":3}',NOW(),1,NULL); CREATE TABLE `settings` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `key` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '', `value` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `key` (`key`) -) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4; -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (1,'smtp_hostname','smtp-pulse.com'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (2,'smtp_port','465'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (3,'smtp_encryption','TLS'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (4,'smtp_user',''); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (5,'smtp_pass',''); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (6,'service_url','http://localhost:3000/'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (7,'admin_email','admin@example.com'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (8,'smtp_max_connections','5'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (9,'smtp_max_messages','100'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (10,'smtp_log',''); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (11,'default_sender','My Awesome Company'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (12,'default_postaddress','1234 Main Street'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (13,'default_from','My Awesome Company'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (14,'default_address','admin@example.com'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (15,'default_subject','Test message'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (16,'default_homepage','http://localhost:3000/'); -INSERT INTO `settings` (`id`, `key`, `value`) VALUES (17,'db_schema_version','24'); -CREATE TABLE `subscription` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `cid` varchar(255) CHARACTER SET ascii NOT NULL, - `email` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', - `opt_in_ip` varchar(100) DEFAULT NULL, - `opt_in_country` varchar(2) DEFAULT NULL, - `tz` varchar(100) CHARACTER SET ascii DEFAULT NULL, - `imported` int(11) unsigned DEFAULT NULL, - `status` tinyint(4) unsigned NOT NULL DEFAULT '1', - `is_test` tinyint(4) unsigned NOT NULL DEFAULT '0', - `status_change` timestamp NULL DEFAULT NULL, - `latest_open` timestamp NULL DEFAULT NULL, - `latest_click` timestamp NULL DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `first_name` varchar(255) DEFAULT NULL, - `last_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `email` (`email`), - UNIQUE KEY `cid` (`cid`), - KEY `status` (`status`), - KEY `first_name` (`first_name`(191)), - KEY `last_name` (`last_name`(191)), - KEY `subscriber_tz` (`tz`), - KEY `is_test` (`is_test`), - KEY `latest_open` (`latest_open`), - KEY `latest_click` (`latest_click`), - KEY `created` (`created`) +) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4; +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (51,'uaCode',''); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (52,'shoutout',''); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (53,'adminEmail','admin@example.com'); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (54,'defaultHomepage','http://localhost:3000/'); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (55,'pgpPassphrase',''); +INSERT INTO `settings` (`id`, `key`, `value`) VALUES (56,'pgpPrivateKey',''); +CREATE TABLE `shares_campaign` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_campaign_user_foreign` (`user`), + CONSTRAINT `shares_campaign_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_campaign_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_custom_form` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_custom_form_user_foreign` (`user`), + CONSTRAINT `shares_custom_form_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `custom_forms` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_custom_form_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_list` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_list_user_foreign` (`user`), + CONSTRAINT `shares_list_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `lists` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_list_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_mosaico_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_mosaico_template_user_foreign` (`user`), + CONSTRAINT `shares_mosaico_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `mosaico_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_mosaico_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_namespace` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_namespace_user_foreign` (`user`), + CONSTRAINT `shares_namespace_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `namespaces` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_namespace_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO `shares_namespace` (`entity`, `user`, `role`, `auto`) VALUES (1,1,'master',1); +CREATE TABLE `shares_report` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_report_user_foreign` (`user`), + CONSTRAINT `shares_report_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `reports` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_report_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_report_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_report_template_user_foreign` (`user`), + CONSTRAINT `shares_report_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `report_templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_report_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_send_configuration` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_send_configuration_user_foreign` (`user`), + CONSTRAINT `shares_send_configuration_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `send_configurations` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_send_configuration_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `shares_template` ( + `entity` int(10) unsigned NOT NULL, + `user` int(10) unsigned NOT NULL, + `role` varchar(128) NOT NULL, + `auto` tinyint(1) DEFAULT 0, + PRIMARY KEY (`entity`,`user`), + KEY `shares_template_user_foreign` (`user`), + CONSTRAINT `shares_template_entity_foreign` FOREIGN KEY (`entity`) REFERENCES `templates` (`id`) ON DELETE CASCADE, + CONSTRAINT `shares_template_user_foreign` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE `template_dep_campaigns` ( + `template` int(10) unsigned NOT NULL, + `campaign` int(10) unsigned NOT NULL, + PRIMARY KEY (`campaign`), + KEY `template_dep_campaigns_template_foreign` (`template`), + CONSTRAINT `template_dep_campaigns_campaign_foreign` FOREIGN KEY (`campaign`) REFERENCES `campaigns` (`id`), + CONSTRAINT `template_dep_campaigns_template_foreign` FOREIGN KEY (`template`) REFERENCES `templates` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `templates` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', - `description` text, - `editor_name` varchar(50) DEFAULT '', - `editor_data` longtext, - `html` longtext, - `text` longtext, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `description` text DEFAULT NULL, + `html` longtext DEFAULT NULL, + `text` longtext DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + `data` longtext DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `name` (`name`(191)) + KEY `name` (`name`(191)), + KEY `templates_namespace_foreign` (`namespace`), + CONSTRAINT `templates_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE `trigger` ( - `list` int(11) unsigned NOT NULL, - `subscription` int(11) unsigned NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`list`,`subscription`) +CREATE TABLE `trigger_messages` ( + `trigger` int(10) unsigned NOT NULL, + `list` int(10) unsigned NOT NULL, + `subscription` int(10) unsigned NOT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`trigger`,`list`,`subscription`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `triggers` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', - `description` text, - `enabled` tinyint(4) unsigned NOT NULL DEFAULT '1', - `list` int(11) unsigned NOT NULL, - `source_campaign` int(11) unsigned DEFAULT NULL, - `rule` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT 'column', - `column` varchar(255) CHARACTER SET ascii DEFAULT NULL, - `seconds` int(11) NOT NULL DEFAULT '0', - `dest_campaign` int(11) unsigned DEFAULT NULL, - `count` int(11) unsigned NOT NULL DEFAULT '0', + `description` text DEFAULT NULL, + `enabled` tinyint(4) unsigned NOT NULL DEFAULT 1, + `source_campaign` int(10) unsigned DEFAULT NULL, + `entity` varchar(255) NOT NULL DEFAULT 'column', + `event` varchar(255) DEFAULT NULL, + `seconds` int(11) NOT NULL DEFAULT 0, + `campaign` int(10) unsigned DEFAULT NULL, + `count` int(11) unsigned NOT NULL DEFAULT 0, `last_check` timestamp NULL DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `name` (`name`(191)), KEY `source_campaign` (`source_campaign`), - KEY `dest_campaign` (`dest_campaign`), - KEY `list` (`list`), - KEY `column` (`column`), + KEY `dest_campaign` (`campaign`), + KEY `column` (`event`), KEY `active` (`enabled`), - KEY `last_check` (`last_check`), - CONSTRAINT `triggers_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) + KEY `last_check` (`last_check`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `tzoffset` ( `tz` varchar(100) NOT NULL DEFAULT '', - `offset` int(11) NOT NULL DEFAULT '0', + `offset` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`tz`) ) ENGINE=InnoDB DEFAULT CHARSET=ascii; +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/abidjan',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/accra',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/addis_ababa',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/algiers',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/asmara',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/asmera',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bamako',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bangui',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/banjul',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bissau',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/blantyre',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/brazzaville',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/bujumbura',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/cairo',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/casablanca',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/ceuta',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/conakry',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/dakar',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/dar_es_salaam',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/djibouti',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/douala',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/el_aaiun',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/freetown',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/gaborone',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/harare',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/johannesburg',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/juba',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/kampala',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/khartoum',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/kigali',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/kinshasa',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lagos',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/libreville',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lome',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/luanda',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lubumbashi',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/lusaka',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/malabo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/maputo',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/maseru',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/mbabane',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/mogadishu',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/monrovia',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/nairobi',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/ndjamena',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/niamey',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/nouakchott',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/ouagadougou',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/porto-novo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/sao_tome',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/timbuktu',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/tripoli',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/tunis',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('africa/windhoek',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/adak',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/anchorage',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/anguilla',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/antigua',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/araguaina',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/buenos_aires',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/catamarca',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/comodrivadavia',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/cordoba',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/jujuy',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/la_rioja',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/mendoza',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/rio_gallegos',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/salta',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/san_juan',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/san_luis',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/tucuman',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/argentina/ushuaia',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/aruba',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/asuncion',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/atikokan',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/atka',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/bahia',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/bahia_banderas',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/barbados',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/belem',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/belize',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/blanc-sablon',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/boa_vista',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/bogota',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/boise',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/buenos_aires',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cambridge_bay',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/campo_grande',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cancun',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/caracas',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/catamarca',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cayenne',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cayman',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/chicago',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/chihuahua',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/coral_harbour',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cordoba',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/costa_rica',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/creston',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/cuiaba',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/curacao',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/danmarkshavn',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/dawson',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/dawson_creek',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/denver',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/detroit',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/dominica',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/edmonton',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/eirunepe',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/el_salvador',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/ensenada',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/fortaleza',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/fort_nelson',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/fort_wayne',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/glace_bay',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/godthab',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/goose_bay',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/grand_turk',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/grenada',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guadeloupe',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guatemala',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guayaquil',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/guyana',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/halifax',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/havana',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/hermosillo',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/indianapolis',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/knox',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/marengo',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/petersburg',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/tell_city',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/vevay',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/vincennes',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indiana/winamac',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/indianapolis',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/inuvik',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/iqaluit',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/jamaica',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/jujuy',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/juneau',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/kentucky/louisville',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/kentucky/monticello',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/knox_in',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/kralendijk',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/la_paz',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/lima',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/los_angeles',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/louisville',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/lower_princes',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/maceio',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/managua',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/manaus',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/marigot',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/martinique',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/matamoros',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/mazatlan',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/mendoza',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/menominee',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/merida',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/metlakatla',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/mexico_city',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/miquelon',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/moncton',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/monterrey',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/montevideo',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/montreal',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/montserrat',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/nassau',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/new_york',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/nipigon',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/nome',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/noronha',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/north_dakota/beulah',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/north_dakota/center',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/north_dakota/new_salem',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/ojinaga',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/panama',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/pangnirtung',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/paramaribo',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/phoenix',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/port-au-prince',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/porto_acre',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/porto_velho',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/port_of_spain',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/puerto_rico',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/punta_arenas',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rainy_river',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rankin_inlet',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/recife',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/regina',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/resolute',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rio_branco',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/rosario',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santarem',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santa_isabel',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santiago',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/santo_domingo',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/sao_paulo',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/scoresbysund',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/shiprock',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/sitka',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_barthelemy',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_johns',-210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_kitts',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_lucia',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_thomas',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/st_vincent',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/swift_current',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/tegucigalpa',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/thule',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/thunder_bay',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/tijuana',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/toronto',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/tortola',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/vancouver',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/virgin',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/whitehorse',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/winnipeg',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/yakutat',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('america/yellowknife',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/casey',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/davis',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/dumontdurville',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/macquarie',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/mawson',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/mcmurdo',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/palmer',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/rothera',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/south_pole',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/syowa',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/troll',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('antarctica/vostok',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('arctic/longyearbyen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/aden',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/almaty',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/amman',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/anadyr',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/aqtau',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/aqtobe',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ashgabat',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ashkhabad',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/atyrau',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/baghdad',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/bahrain',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/baku',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/bangkok',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/barnaul',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/beirut',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/bishkek',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/brunei',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/calcutta',330); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/chita',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/choibalsan',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/chongqing',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/chungking',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/colombo',330); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dacca',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/damascus',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dhaka',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dili',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dubai',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/dushanbe',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/famagusta',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/gaza',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/harbin',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/hebron',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/hong_kong',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/hovd',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ho_chi_minh',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/irkutsk',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/istanbul',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/jakarta',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/jayapura',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/jerusalem',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kabul',270); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kamchatka',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/karachi',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kashgar',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kathmandu',345); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/katmandu',345); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/khandyga',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kolkata',330); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/krasnoyarsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kuala_lumpur',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kuching',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/kuwait',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/macao',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/macau',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/magadan',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/makassar',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/manila',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/muscat',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/nicosia',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/novokuznetsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/novosibirsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/omsk',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/oral',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/phnom_penh',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/pontianak',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/pyongyang',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/qatar',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/qyzylorda',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/rangoon',390); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/riyadh',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/saigon',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/sakhalin',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/samarkand',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/seoul',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/shanghai',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/singapore',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/srednekolymsk',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/taipei',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tashkent',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tbilisi',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tehran',210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tel_aviv',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/thimbu',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/thimphu',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tokyo',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/tomsk',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ujung_pandang',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ulaanbaatar',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ulan_bator',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/urumqi',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/ust-nera',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/vientiane',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/vladivostok',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yakutsk',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yangon',390); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yekaterinburg',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('asia/yerevan',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/azores',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/bermuda',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/canary',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/cape_verde',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/faeroe',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/faroe',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/jan_mayen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/madeira',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/reykjavik',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/south_georgia',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/stanley',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('atlantic/st_helena',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/act',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/adelaide',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/brisbane',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/broken_hill',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/canberra',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/currie',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/darwin',570); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/eucla',525); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/hobart',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/lhi',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/lindeman',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/lord_howe',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/melbourne',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/north',570); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/nsw',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/perth',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/queensland',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/south',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/sydney',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/tasmania',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/victoria',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/west',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('australia/yancowinna',630); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/acre',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/denoronha',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/east',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('brazil/west',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/atlantic',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/central',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/eastern',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/mountain',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/newfoundland',-210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/pacific',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/saskatchewan',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('canada/yukon',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('cet',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('chile/continental',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('chile/easterisland',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('cst6cdt',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('cuba',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('eet',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('egypt',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('eire',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('est',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('est5edt',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+1',-60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+10',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+11',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+12',-720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+2',-120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+3',-180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+4',-240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+5',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+6',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+7',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+8',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt+9',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-1',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-10',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-11',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-12',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-13',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-14',840); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-2',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-3',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-4',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-5',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-6',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-7',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-8',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt-9',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/gmt0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/greenwich',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/uct',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/universal',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/utc',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('etc/zulu',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/amsterdam',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/andorra',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/astrakhan',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/athens',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/belfast',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/belgrade',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/berlin',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/bratislava',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/brussels',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/bucharest',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/budapest',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/busingen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/chisinau',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/copenhagen',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/dublin',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/gibraltar',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/guernsey',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/helsinki',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/isle_of_man',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/istanbul',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/jersey',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/kaliningrad',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/kiev',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/kirov',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/lisbon',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/ljubljana',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/london',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/luxembourg',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/madrid',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/malta',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/mariehamn',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/minsk',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/monaco',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/moscow',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/nicosia',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/oslo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/paris',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/podgorica',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/prague',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/riga',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/rome',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/samara',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/san_marino',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/sarajevo',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/saratov',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/simferopol',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/skopje',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/sofia',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/stockholm',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/tallinn',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/tirane',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/tiraspol',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/ulyanovsk',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/uzhgorod',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vaduz',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vatican',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vienna',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/vilnius',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/volgograd',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/warsaw',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/zagreb',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/zaporozhye',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('europe/zurich',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gb',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gb-eire',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt+0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt-0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('gmt0',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('greenwich',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('hongkong',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('hst',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('iceland',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/antananarivo',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/chagos',360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/christmas',420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/cocos',390); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/comoro',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/kerguelen',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/mahe',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/maldives',300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/mauritius',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/mayotte',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('indian/reunion',240); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('iran',210); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('israel',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('jamaica',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('japan',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('kwajalein',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('libya',120); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('met',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mexico/bajanorte',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mexico/bajasur',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mexico/general',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mst',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('mst7mdt',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('navajo',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('nz',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('nz-chat',825); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/apia',840); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/auckland',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/bougainville',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/chatham',825); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/chuuk',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/easter',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/efate',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/enderbury',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/fakaofo',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/fiji',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/funafuti',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/galapagos',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/gambier',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/guadalcanal',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/guam',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/honolulu',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/johnston',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/kiritimati',840); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/kosrae',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/kwajalein',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/majuro',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/marquesas',-570); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/midway',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/nauru',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/niue',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/norfolk',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/noumea',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/pago_pago',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/palau',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/pitcairn',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/pohnpei',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/ponape',660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/port_moresby',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/rarotonga',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/saipan',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/samoa',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/tahiti',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/tarawa',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/tongatapu',780); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/truk',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/wake',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/wallis',720); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pacific/yap',600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('poland',60); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('portugal',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('prc',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('pst8pdt',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('roc',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('rok',540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('singapore',480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('turkey',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('uct',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('universal',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/alaska',-540); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/aleutian',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/arizona',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/central',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/east-indiana',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/eastern',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/hawaii',-600); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/indiana-starke',-360); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/michigan',-300); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/mountain',-420); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/pacific',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/pacific-new',-480); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('us/samoa',-660); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('utc',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('w-su',180); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('wet',0); +INSERT INTO `tzoffset` (`tz`, `offset`) VALUES ('zulu',0); CREATE TABLE `users` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL DEFAULT '', - `password` varchar(255) NOT NULL DEFAULT '', + `password` varchar(255) DEFAULT NULL, `email` varchar(255) CHARACTER SET utf8 DEFAULT NULL, `access_token` varchar(40) DEFAULT NULL, `reset_token` varchar(255) CHARACTER SET ascii DEFAULT NULL, `reset_expire` timestamp NULL DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), + `namespace` int(10) unsigned NOT NULL, + `name` varchar(255) DEFAULT NULL, + `role` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), KEY `username` (`username`(191)), KEY `reset` (`reset_token`), KEY `check_reset` (`username`(191),`reset_token`,`reset_expire`), - KEY `token_index` (`access_token`) + KEY `token_index` (`access_token`), + KEY `users_namespace_foreign` (`namespace`), + CONSTRAINT `users_namespace_foreign` FOREIGN KEY (`namespace`) REFERENCES `namespaces` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -INSERT INTO `users` (`id`, `username`, `password`, `email`, `access_token`, `reset_token`, `reset_expire`, `created`) VALUES (1,'admin','$2a$10$mzKU71G62evnGB2PvQA4k..Wf9jASk.c7a8zRMHh6qQVjYJ2r/g/K','admin@example.com',NULL,NULL,NULL,NOW()); +INSERT INTO `users` (`id`, `username`, `password`, `email`, `access_token`, `reset_token`, `reset_expire`, `created`, `namespace`, `name`, `role`) VALUES (1,'admin','$2a$10$mzKU71G62evnGB2PvQA4k..Wf9jASk.c7a8zRMHh6qQVjYJ2r/g/K','admin@example.com',NULL,NULL,NULL,NOW(),1,'Administrator','master'); SET UNIQUE_CHECKS=1; SET FOREIGN_KEY_CHECKS=1; + diff --git a/shared/package-lock.json b/shared/package-lock.json index 2ffe9a41..606f36be 100644 --- a/shared/package-lock.json +++ b/shared/package-lock.json @@ -3543,7 +3543,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -3958,7 +3959,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4014,6 +4016,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4057,12 +4060,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } },