m180525_143244_create_subscribe_table.php 805 Bytes
<?php
    
    use yii\db\Migration;
    
    /**
     * Handles the creation of table `subscribe`.
     */
    class m180525_143244_create_subscribe_table extends Migration
    {
        /**
         * {@inheritdoc}
         */
        public function safeUp()
        {
            $this->createTable(
                'subscribe',
                [
                    'id'     => $this->primaryKey(),
                    'name'   => $this->string(),
                    'email'  => $this->string(),
                    'domain' => $this->string(),
                    'time'   => $this->string(),
                ]
            );
        }
        
        /**
         * {@inheritdoc}
         */
        public function safeDown()
        {
            $this->dropTable('subscribe');
        }
    }