12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- use yii\db\Schema;
- use yii\db\Migration;
- class m230918_092723_inquirer_log extends Migration
- {
- public function init()
- {
- $this->db = 'db';
- parent::init();
- }
- public function safeUp()
- {
- $tableOptions = 'ENGINE=InnoDB';
- $this->createTable(
- '{{%inquirer_log}}',
- [
- 'id'=> $this->primaryKey()->unsigned(),
- 'idq'=> $this->integer()->unsigned()->notNull(),
- 'hash'=> $this->string(64)->notNull(),
- 'dt'=> $this->timestamp()->notNull()->defaultExpression("CURRENT_TIMESTAMP"),
- ],$tableOptions
- );
- $this->createIndex('idq','{{%inquirer_log}}',['idq'],false);
- }
- public function safeDown()
- {
- $this->dropIndex('idq', '{{%inquirer_log}}');
- $this->dropTable('{{%inquirer_log}}');
- }
- }
|