db->createCommand($check_table_sql)->execute(); if (!empty($res)) return ''; $this->createTable($table, [ 'id' => $this->primaryKey(), 'user_id' => $this->integer(11)->notNull()->defaultValue(0)->comment('User ID'), 'mall_id' => $this->integer(11)->notNull()->defaultValue(0)->comment('Mall ID'), 'status' => $this->tinyInteger(1)->notNull()->defaultValue(1)->comment('状态,-1:已删除;0:禁用;1:正常'), 'third_party_address' => $this->text()->comment('Third Party Address'), 'created_at' => $this->integer(11)->notNull()->defaultValue(0)->comment('Created At'), 'updated_at' => $this->integer(11)->notNull()->defaultValue(0)->comment('Updated At'), ]); } /** * {@inheritdoc} */ public function safeDown() { // $this->dropTable('{{%user_third_party_address}}'); } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M221123070250CreateUserThirdPartyAddressTable cannot be reverted.\n"; return false; } */ }