diff options
author | dartcafe <github@dartcafe.de> | 2019-12-23 00:21:23 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2019-12-23 00:21:23 +0300 |
commit | 66f8977b374ec8ee6caa87bc912550db0630c447 (patch) | |
tree | 939a61ee7c780cf854aa030f7f1d8fbaa6cf6cdf /lib/Migration | |
parent | 923fe1897f3f6962d95a94577b2d03ae5bc512ad (diff) |
logging for scheduled mails
Diffstat (limited to 'lib/Migration')
-rw-r--r-- | lib/Migration/Version0010Date20191221183157.php | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/lib/Migration/Version0010Date20191221183157.php b/lib/Migration/Version0010Date20191221183157.php index 98b26af5..a1bef29f 100644 --- a/lib/Migration/Version0010Date20191221183157.php +++ b/lib/Migration/Version0010Date20191221183157.php @@ -66,8 +66,8 @@ class Version0010Date20191221183157 extends SimpleMigrationStep { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); - if (!$schema->hasTable('polls_send_mail')) { - $table = $schema->createTable('polls_send_mail'); + if (!$schema->hasTable('polls_notice')) { + $table = $schema->createTable('polls_notice'); $table->addColumn('id', Type::INTEGER, [ 'autoincrement' => true, 'notnull' => true, @@ -75,6 +75,10 @@ class Version0010Date20191221183157 extends SimpleMigrationStep { $table->addColumn('poll_id', Type::INTEGER, [ 'notnull' => true ]); + $table->addColumn('channel', Type::STRING, [ + 'notnull' => false, + 'length' => 64 + ]); $table->addColumn('user_id', Type::STRING, [ 'notnull' => false, 'length' => 1024 @@ -95,6 +99,45 @@ class Version0010Date20191221183157 extends SimpleMigrationStep { 'notnull' => false, 'length' => 1024 ]); + + $table->setPrimaryKey(['id']); + } + + if (!$schema->hasTable('polls_log')) { + $table = $schema->createTable('polls_log'); + $table->addColumn('id', Type::INTEGER, [ + 'autoincrement' => true, + 'notnull' => true + ]); + $table->addColumn('created', Type::DATETIME, [ + 'notnull' => true + ]); + $table->addColumn('processed', Type::BOOLEAN, [ + 'notnull' => true, + 'default' => false + ]); + $table->addColumn('processed_date', Type::DATETIME, [ + 'notnull' => true + ]); + $table->addColumn('poll_id', Type::INTEGER, [ + 'notnull' => true + ]); + $table->addColumn('user_id', Type::STRING, [ + 'notnull' => false, + 'length' => 1024 + ]); + $table->addColumn('display_name', Type::STRING, [ + 'notnull' => false, + 'length' => 64 + ]); + $table->addColumn('message_id', Type::STRING, [ + 'notnull' => false, + 'length' => 64 + ]); + $table->addColumn('message', Type::STRING, [ + 'notnull' => false, + 'length' => 1024 + ]); $table->setPrimaryKey(['id']); } |