123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- use yii\db\Migration;
- use yii\db\Schema;
- /**
- * Class m180112_145718_rabbit_log
- */
- class m180112_145718_rabbit_log extends Migration
- {
- /**
- * @inheritdoc
- */
- public function safeUp()
- {
- }
- /**
- * @inheritdoc
- */
- public function safeDown()
- {
- echo "m180112_145718_rabbit_log cannot be reverted.\n";
- return false;
- }
- public function up()
- {
- $tableOptions = null;
- if ($this->db->driverName === 'mysql') {
- $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="rabbit log"';
- }
- $this->createTable('{{%rabbit_log}}', [
- //'name'=>Schema::TYPE_STRING.'(200) PRIMARY KEY NOT NULL',
- 'id'=>Schema::TYPE_PK,
- 'channel'=>Schema::TYPE_TEXT.' NULL COMMENT "频道"',
- 'queue'=>Schema::TYPE_TEXT.' NULL COMMENT "队列"',
- 'msg'=>Schema::TYPE_TEXT.' NULL COMMENT "发送的所有信息"',
- 'msg_body'=>Schema::TYPE_TEXT.' NULL COMMENT "信息体"',
- 'msg_delivery_tag'=>Schema::TYPE_TEXT.' NULL COMMENT "路由标签"',
- 'addtime'=>Schema::TYPE_DATETIME.' NULL COMMENT "操作时间"',
- 'describe'=>Schema::TYPE_TEXT.' NULL COMMENT "备注"',
- ], $tableOptions);
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "m180112_145718_rabbit_log cannot be reverted.\n";
- return false;
- }
- */
- }
|