Migration_20221028_105818.php
3 months ago
Migration_20221110_151621.php
3 years ago
Migration_20230111_120000.php
2 years ago
Migration_20230111_130000.php
3 years ago
Migration_20230215_050813.php
3 months ago
Migration_20230221_200520.php
3 years ago
Migration_20230421_135915.php
3 years ago
Migration_20230503_210945.php
3 years ago
Migration_20230605_174836.php
3 years ago
Migration_20230703_105957.php
3 years ago
Migration_20230716_130221_Db.php
2 years ago
Migration_20230824_054259_Db.php
2 years ago
Migration_20230831_124214_Db.php
2 years ago
Migration_20230831_143755_Db.php
1 year ago
Migration_20240119_113943_Db.php
2 years ago
Migration_20240617_122847_Db.php
2 years ago
Migration_20240725_182318_Db.php
2 years ago
Migration_20241007_170437_Db.php
1 year ago
Migration_20241108_103249_Db.php
3 months ago
Migration_20250903_151331_Db.php
11 months ago
Migration_20250926_153050_Db.php
10 months ago
Migration_20260415_090055_Db.php
3 months ago
Migration_20260427_100000.php
3 months ago
Migration_20260428_120000.php
3 months ago
Migration_20260430_103000_Db.php
3 months ago
Migration_20260430_120000.php
3 months ago
Migration_20260504_120000_Db.php
3 months ago
Migration_20260514_120000_Db.php
3 months ago
Migration_20260609_120000_Db.php
2 months ago
Migration_20260610_120000_Db.php
1 month ago
Migration_20260622_120000_Db.php
1 month ago
Migration_20260709_120000_Db.php
1 month ago
Migration_20260715_100000_Db.php
1 month ago
index.php
3 years ago
Migration_20260715_100000_Db.php
35 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Migrations\Db; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Entities\SubscriberEntity; |
| 9 | use MailPoet\Migrator\DbMigration; |
| 10 | |
| 11 | /** |
| 12 | * Adds per-subscriber tracking consent columns (CNIL/Garante email tracking |
| 13 | * consent rules). Tri-state: existing subscribers land in 'unknown' — we have |
| 14 | * never asked them — which is deliberately distinct from 'granted'. The |
| 15 | * `tracking.consent.track_unknown` setting (default true) preserves today's |
| 16 | * behaviour for sites with no EU exposure. |
| 17 | * |
| 18 | * `tracking_consent_updated_at`, `_method` and `_copy` exist for compliance |
| 19 | * record-keeping (when, how, and against what wording the choice was made). |
| 20 | */ |
| 21 | class Migration_20260715_100000_Db extends DbMigration { |
| 22 | public function run(): void { |
| 23 | $subscribersTable = $this->getTableName(SubscriberEntity::class); |
| 24 | if (!$this->columnExists($subscribersTable, 'tracking_consent')) { |
| 25 | $this->connection->executeStatement(" |
| 26 | ALTER TABLE `{$subscribersTable}` |
| 27 | ADD COLUMN `tracking_consent` varchar(20) NOT NULL DEFAULT 'unknown', |
| 28 | ADD COLUMN `tracking_consent_updated_at` timestamp NULL DEFAULT NULL, |
| 29 | ADD COLUMN `tracking_consent_method` varchar(40) NULL DEFAULT NULL, |
| 30 | ADD COLUMN `tracking_consent_copy` text NULL DEFAULT NULL |
| 31 | "); |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 |