| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Schema;
- class AddStationDatas1 extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- $sqls=["delete from bswas.stations where id>0;"
- ,"insert into bswas.stations (id,station_type_id)values(1,1),(2,1),(4,1),(6,1),(7,1),(10,1),(11,1),(12,1),(13,1),(14,1),(15,1),(16,1),(17,1),(18,1),(19,1),(20,1),(21,1),(22,1),(23,1),(24,1),(25,1),(26,1),(27,1),(28,1);"
- ,"UPDATE bswas.stations SET parent_id = 2, name = 'U型线入货口01', code = 'BIN-OUT1', station_type_id = 1, sequence = 1, created_at = '2020-12-02 13:46:55', updated_at = '2020-12-02 13:46:55' WHERE id = 1;"
- ,"UPDATE bswas.stations SET parent_id = null, name = '料箱监视器01', code = 'ULine01', station_type_id = 3, sequence = 1, created_at = '2020-12-04 18:16:36', updated_at = '2020-12-04 18:16:36' WHERE id = 2;"
- ,"UPDATE bswas.stations SET parent_id = null, name = '立库', code = null, station_type_id = 4, sequence = 1, created_at = '2021-03-30 16:19:33', updated_at = '2021-03-30 17:00:20' WHERE id = 4;"
- ,"UPDATE bswas.stations SET parent_id = null, name = '缓存架01', code = 'B1', station_type_id = 5, sequence = null, created_at = '2021-04-27 14:11:56', updated_at = '2021-05-13 16:37:55' WHERE id = 6;"
- ,"UPDATE bswas.stations SET parent_id = null, name = '缓存架02', code = 'B2', station_type_id = 5, sequence = null, created_at = '2021-04-27 14:11:56', updated_at = '2021-05-13 16:37:55' WHERE id = 7;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-02-02', code = 'HAIB1-02-02', station_type_id = 5, sequence = null, created_at = '2021-05-13 16:47:55', updated_at = '2021-05-13 16:47:55' WHERE id = 10;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-01-01', code = 'HAIB1-01-01', station_type_id = 5, sequence = null, created_at = '2021-05-18 16:54:16', updated_at = '2021-05-18 16:54:16' WHERE id = 11;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-01-02', code = 'HAIB1-01-02', station_type_id = 5, sequence = null, created_at = '2021-05-21 15:12:28', updated_at = '2021-05-21 15:12:28' WHERE id = 12;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-01-03', code = 'HAIB1-01-03', station_type_id = 5, sequence = null, created_at = '2021-05-21 15:12:28', updated_at = '2021-05-21 15:12:28' WHERE id = 13;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-02-01', code = 'HAIB1-02-01', station_type_id = 5, sequence = null, created_at = '2021-05-21 15:12:28', updated_at = '2021-05-21 15:12:28' WHERE id = 14;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-02-03', code = 'HAIB1-02-03', station_type_id = 5, sequence = null, created_at = '2021-05-21 15:12:28', updated_at = '2021-05-21 15:12:28' WHERE id = 15;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-03-01', code = 'HAIB1-03-01', station_type_id = 5, sequence = null, created_at = '2021-05-21 15:12:28', updated_at = '2021-05-21 15:12:28' WHERE id = 16;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-03-02', code = 'HAIB1-03-02', station_type_id = 5, sequence = null, created_at = '2021-05-21 15:12:29', updated_at = '2021-05-21 15:12:29' WHERE id = 17;"
- ,"UPDATE bswas.stations SET parent_id = 6, name = 'HAIB1-03-03', code = 'HAIB1-03-03', station_type_id = 5, sequence = null, created_at = '2021-05-21 15:12:29', updated_at = '2021-05-21 15:12:29' WHERE id = 18;"
- ,"UPDATE bswas.stations SET parent_id = 2, name = 'U型线拍灯01', code = 'IN1-01-01', station_type_id = 6, sequence = null, created_at = '2021-06-04 09:06:35', updated_at = '2021-06-04 09:06:35' WHERE id = 19;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-01-01', code = 'HAIB2-01-01', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 20;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-01-02', code = 'HAIB2-01-02', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 21;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-01-03', code = 'HAIB2-01-03', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 22;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-02-01', code = 'HAIB2-02-01', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 23;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-02-02', code = 'HAIB2-02-02', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 24;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-02-03', code = 'HAIB2-02-03', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 25;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-03-01', code = 'HAIB2-03-01', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 26;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-03-02', code = 'HAIB2-03-02', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 27;"
- ,"UPDATE bswas.stations SET parent_id = 7, name = 'HAIB2-03-03', code = 'HAIB2-03-03', station_type_id = 5, sequence = null, created_at = '2021-06-28 00:00:00', updated_at = '2021-06-28 00:00:00' WHERE id = 28;"
- ,"delete from bswas.station_types where id>0;"
- ,"insert into bswas.station_types (id,name)values(1,''),(2,''),(3,''),(4,''),(5,''),(6,''),(7,'');"
- ,"UPDATE bswas.station_types SET name = '料箱出货口', created_at = '2020-12-02 13:46:55', updated_at = '2020-12-02 13:46:55' WHERE id = 1;"
- ,"UPDATE bswas.station_types SET name = '料箱入货口', created_at = '2020-12-02 13:46:55', updated_at = '2020-12-02 13:46:55' WHERE id = 2;"
- ,"UPDATE bswas.station_types SET name = '料箱监视器', created_at = '2020-12-02 13:46:55', updated_at = '2020-12-02 13:46:55' WHERE id = 3;"
- ,"UPDATE bswas.station_types SET name = '立库', created_at = '2021-03-30 16:19:56', updated_at = '2021-03-30 16:19:58' WHERE id = 4;"
- ,"UPDATE bswas.station_types SET name = '缓存架', created_at = '2021-04-27 14:11:56', updated_at = '2021-04-27 14:11:56' WHERE id = 5;"
- ,"UPDATE bswas.station_types SET name = 'U型线拍灯', created_at = '2021-06-04 09:06:35', updated_at = '2021-06-04 09:06:35' WHERE id = 6;"
- ,"UPDATE bswas.station_types SET name = '镜像架', created_at = '2021-06-07 18:35:50', updated_at = '2021-06-07 18:35:50' WHERE id = 7;"
- ];
- array_walk($sqls,function ($sql){
- DB::statement($sql);
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- $sql="delete from bswas.stations where id>0;";
- DB::statement($sql);
- }
- }
|