| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240618082145AddIsPrintToQimallOrderTable
- */
- class M240618082145AddIsPrintToQimallOrderTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = <<<SQL
- ALTER TABLE `qimall_order`
- ADD COLUMN `is_print` TINYINT(1) NULL DEFAULT 0 COMMENT '是否已打印 0 否 1 是';
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- echo "Error adding column is_print to table qimall_order: " . $e->getMessage() . "\n";
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240618082145AddIsPrintToQimallOrderTable cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240618082145AddIsPrintToQimallOrderTable cannot be reverted.\n";
- return false;
- }
- */
- }
|