| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230522104210AddTableGoodsSpecs
- */
- class M230522104210AddTableGoodsSpecs extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = "CREATE TABLE `qimall_goods_specs` (
- `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int UNSIGNED NOT NULL COMMENT '商城ID',
- `store_id` int UNSIGNED NOT NULL COMMENT '店铺ID',
- `name` varchar(64) NOT NULL COMMENT '规格名称',
- `values` longtext NOT NULL COMMENT '规格值',
- `updated_at` int UNSIGNED NULL,
- `created_at` int UNSIGNED NULL,
- PRIMARY KEY (`id`)
- );";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230522104210AddTableGoodsSpecs cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230228081131InsertQimallMenu cannot be reverted.\n";
- return false;
- }
- */
- }
|