M221111063020InsertIntoQimallTown.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. *
  6. * Class M221111063020InsertIntoQimallTown
  7. */
  8. class M221111063020InsertIntoQimallTown extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql = "
  17. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '拓东街道', 1594555254, 1594555254);
  18. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '鼓楼街道', 1594555254, 1594555254);
  19. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '联盟街道', 1594555254, 1594555254);
  20. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '金辰街道', 1594555254, 1594555254);
  21. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '青云街道', 1594555254, 1594555254);
  22. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '龙泉街道', 1594555254, 1594555254);
  23. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '茨坝街道', 1594555254, 1594555254);
  24. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '松华街道', 1594555254, 1594555254);
  25. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '双龙街道', 1594555254, 1594555254);
  26. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '滇源街道', 1594555254, 1594555254);
  27. INSERT INTO `qimall_town`( `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES ( 2608, 530103, '阿子营街道', 1594555254, 1594555254);
  28. ";
  29. $this->execute($sql);
  30. } catch (\Exception $e) {
  31. }
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function safeDown()
  37. {
  38. echo "M221111063020InsertIntoQimallTown cannot be reverted.\n";
  39. return false;
  40. }
  41. /*
  42. // Use up()/down() to run migration code without a transaction.
  43. public function up()
  44. {
  45. }
  46. public function down()
  47. {
  48. echo "M221111063020InsertIntoQimallTown cannot be reverted.\n";
  49. return false;
  50. }
  51. */
  52. }