File tree Expand file tree Collapse file tree 5 files changed +16
-53
lines changed Expand file tree Collapse file tree 5 files changed +16
-53
lines changed Original file line number Diff line number Diff line change 88* Repositórios DB e FILE
99* Integração Contínua
1010* Política de consumo da api
11+
12+ ## [ 1.0.1] - 31/01/2021
13+
14+ ### Melhorias
15+
16+ * Semea cids com insert
Original file line number Diff line number Diff line change 66
77class CreateCid10Table extends Migration
88{
9- /**
10- * Run the migrations.
11- *
12- * @return void
13- */
149 public function up ()
1510 {
1611 Schema::create ('cid10 ' , function (Blueprint $ table ) {
@@ -19,12 +14,7 @@ public function up()
1914 $ table ->string ('nome ' , 254 );
2015 });
2116 }
22-
23- /**
24- * Reverse the migrations.
25- *
26- * @return void
27- */
17+
2818 public function down ()
2919 {
3020 Schema::dropIfExists ('cid10 ' );
Original file line number Diff line number Diff line change 11<?php
2- /**
3- * Created by Atila Silva.
4- * Date: sáb, ou 2021 21:59:31 +0000.
5- */
62
73use Illuminate \Support \Facades \Schema ;
84use Illuminate \Database \Schema \Blueprint ;
95use Illuminate \Database \Migrations \Migration ;
106
11- /**
12- * Class CreateVisitorsTable
13- */
147class CreateVisitorsTable extends Migration
158{
16- /**
17- * Run the migrations.
18- *
19- * @return void
20- */
219 public function up ()
2210 {
2311 Schema::create ('visitors ' , function (Blueprint $ table ) {
@@ -28,11 +16,6 @@ public function up()
2816 });
2917 }
3018
31- /**
32- * Reverse the migrations.
33- *
34- * @return void
35- */
3619 public function down ()
3720 {
3821 Schema::dropIfExists ('visitors ' );
Original file line number Diff line number Diff line change 44
55class DatabaseSeeder extends Seeder
66{
7- /**
8- * Run the database seeds.
9- *
10- * @return void
11- */
127 public function run ()
138 {
14- $ this ->call (' cid10TableSeeder ' );
9+ $ this ->call (cid10TableSeeder::class );
1510 }
1611}
Original file line number Diff line number Diff line change 11<?php
22
3+ use App \Cid10 ;
34use Illuminate \Database \Seeder ;
4- use Illuminate \Support \Facades \DB ;
55
66class cid10TableSeeder extends Seeder
77{
8- /**
9- * Run the database seeds.
10- *
11- * @return void
12- */
138 public function run ()
149 {
15- $ cids = json_decode (file_get_contents (__DIR__ . '/cid10.json ' ));
10+ $ cids = (array ) json_decode (file_get_contents (__DIR__ . '/cid10.json ' ));
11+
12+ $ inserts = [];
1613
17- if (env ('APP_ENV ' ) === 'test ' ){
18- DB ::table ('cid10 ' )->insert ([
19- 'nome ' =>$ cids [0 ]->nome ,
20- 'codigo ' => $ cids [0 ]->codigo
21- ]);
22- }else {
23- foreach ($ cids as $ cid ){
24- DB ::table ('cid10 ' )->insert ([
25- 'nome ' =>$ cid ->nome ,
26- 'codigo ' => $ cid ->codigo
27- ]);
28- }
14+ foreach ($ cids as $ cid ){
15+ array_push ($ inserts , (array ) $ cid );
2916 }
17+
18+ Cid10::insert ($ inserts );
3019 }
3120}
You can’t perform that action at this time.
0 commit comments