-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from BBrunekreeft/master
Remove obsolete database fields
- Loading branch information
Showing
4 changed files
with
43 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
migrations/m170217_124201_drop_obsolete_columns_from_mail_queue_table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
use yii\db\Migration; | ||
use nterms\mailqueue\MailQueue; | ||
|
||
/** | ||
* Handles adding swift_message to table `mail_queue`. | ||
*/ | ||
class m170217_124201_drop_obsolete_columns_from_mail_queue_table extends Migration | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function up() | ||
{ | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'from'); | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'to'); | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'cc'); | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'bcc'); | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'html_body'); | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'text_body'); | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'reply_to'); | ||
$this->dropColumn(Yii::$app->get(MailQueue::NAME)->table, 'charset'); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function down() | ||
{ | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'from', 'text'); | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'to', 'text'); | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'cc', 'text'); | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'bcc', 'text'); | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'html_body', 'text'); | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'text_body', 'text'); | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'reply_to', 'text'); | ||
$this->addColumn(Yii::$app->get(MailQueue::NAME)->table, 'charset', 'string'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters