@@ -5,19 +5,19 @@ |
||
5 | 5 | |
6 | 6 | class CreateRegenciesTable extends Migration { |
7 | 7 | |
8 | - public function up() |
|
9 | - { |
|
10 | - Schema::create('regencies', function(Blueprint $table) { |
|
11 | - $table->increments('id'); |
|
12 | - $table->integer('province_id')->unsigned()->nullable()->index(); |
|
13 | - $table->string('name', 191)->index(); |
|
14 | - $table->timestamps(); |
|
15 | - $table->softDeletes(); |
|
16 | - }); |
|
17 | - } |
|
8 | + public function up() |
|
9 | + { |
|
10 | + Schema::create('regencies', function(Blueprint $table) { |
|
11 | + $table->increments('id'); |
|
12 | + $table->integer('province_id')->unsigned()->nullable()->index(); |
|
13 | + $table->string('name', 191)->index(); |
|
14 | + $table->timestamps(); |
|
15 | + $table->softDeletes(); |
|
16 | + }); |
|
17 | + } |
|
18 | 18 | |
19 | - public function down() |
|
20 | - { |
|
21 | - Schema::drop('regencies'); |
|
22 | - } |
|
19 | + public function down() |
|
20 | + { |
|
21 | + Schema::drop('regencies'); |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | \ No newline at end of file |
@@ -5,18 +5,18 @@ |
||
5 | 5 | |
6 | 6 | class CreateProvincesTable extends Migration { |
7 | 7 | |
8 | - public function up() |
|
9 | - { |
|
10 | - Schema::create('provinces', function(Blueprint $table) { |
|
11 | - $table->increments('id'); |
|
12 | - $table->string('name', 191)->index(); |
|
13 | - $table->timestamps(); |
|
14 | - $table->softDeletes(); |
|
15 | - }); |
|
16 | - } |
|
8 | + public function up() |
|
9 | + { |
|
10 | + Schema::create('provinces', function(Blueprint $table) { |
|
11 | + $table->increments('id'); |
|
12 | + $table->string('name', 191)->index(); |
|
13 | + $table->timestamps(); |
|
14 | + $table->softDeletes(); |
|
15 | + }); |
|
16 | + } |
|
17 | 17 | |
18 | - public function down() |
|
19 | - { |
|
20 | - Schema::drop('provinces'); |
|
21 | - } |
|
18 | + public function down() |
|
19 | + { |
|
20 | + Schema::drop('provinces'); |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -6,35 +6,35 @@ |
||
6 | 6 | |
7 | 7 | class CreateForeignKeys extends Migration { |
8 | 8 | |
9 | - public function up() |
|
10 | - { |
|
11 | - Schema::table('dashboard_apels', function(Blueprint $table) { |
|
12 | - $table->foreign('province_id')->references('id')->on('provinces') |
|
13 | - ->onDelete('set null') |
|
14 | - ->onUpdate('restrict'); |
|
15 | - }); |
|
16 | - Schema::table('dashboard_apels', function(Blueprint $table) { |
|
17 | - $table->foreign('regency_id')->references('id')->on('regencies') |
|
18 | - ->onDelete('set null') |
|
19 | - ->onUpdate('restrict'); |
|
20 | - }); |
|
21 | - Schema::table('regencies', function(Blueprint $table) { |
|
22 | - $table->foreign('province_id')->references('id')->on('provinces') |
|
23 | - ->onDelete('set null') |
|
24 | - ->onUpdate('restrict'); |
|
25 | - }); |
|
26 | - } |
|
9 | + public function up() |
|
10 | + { |
|
11 | + Schema::table('dashboard_apels', function(Blueprint $table) { |
|
12 | + $table->foreign('province_id')->references('id')->on('provinces') |
|
13 | + ->onDelete('set null') |
|
14 | + ->onUpdate('restrict'); |
|
15 | + }); |
|
16 | + Schema::table('dashboard_apels', function(Blueprint $table) { |
|
17 | + $table->foreign('regency_id')->references('id')->on('regencies') |
|
18 | + ->onDelete('set null') |
|
19 | + ->onUpdate('restrict'); |
|
20 | + }); |
|
21 | + Schema::table('regencies', function(Blueprint $table) { |
|
22 | + $table->foreign('province_id')->references('id')->on('provinces') |
|
23 | + ->onDelete('set null') |
|
24 | + ->onUpdate('restrict'); |
|
25 | + }); |
|
26 | + } |
|
27 | 27 | |
28 | - public function down() |
|
29 | - { |
|
30 | - Schema::table('dashboard_apels', function(Blueprint $table) { |
|
31 | - $table->dropForeign('dashboard_apels_province_id_foreign'); |
|
32 | - }); |
|
33 | - Schema::table('dashboard_apels', function(Blueprint $table) { |
|
34 | - $table->dropForeign('dashboard_apels_regency_id_foreign'); |
|
35 | - }); |
|
36 | - Schema::table('regencies', function(Blueprint $table) { |
|
37 | - $table->dropForeign('regencies_province_id_foreign'); |
|
38 | - }); |
|
39 | - } |
|
28 | + public function down() |
|
29 | + { |
|
30 | + Schema::table('dashboard_apels', function(Blueprint $table) { |
|
31 | + $table->dropForeign('dashboard_apels_province_id_foreign'); |
|
32 | + }); |
|
33 | + Schema::table('dashboard_apels', function(Blueprint $table) { |
|
34 | + $table->dropForeign('dashboard_apels_regency_id_foreign'); |
|
35 | + }); |
|
36 | + Schema::table('regencies', function(Blueprint $table) { |
|
37 | + $table->dropForeign('regencies_province_id_foreign'); |
|
38 | + }); |
|
39 | + } |
|
40 | 40 | } |
41 | 41 | \ No newline at end of file |
@@ -5,23 +5,23 @@ |
||
5 | 5 | |
6 | 6 | class CreateDashboardApelsTable extends Migration { |
7 | 7 | |
8 | - public function up() |
|
9 | - { |
|
10 | - Schema::create('dashboard_apels', function(Blueprint $table) { |
|
11 | - $table->increments('id'); |
|
12 | - $table->string('negara', 191); |
|
13 | - $table->integer('province_id')->unsigned()->nullable()->index(); |
|
14 | - $table->boolean('kab_kota')->index(); |
|
15 | - $table->integer('regency_id')->unsigned()->nullable()->index(); |
|
16 | - $table->string('tahun', 191); |
|
17 | - $table->decimal('data')->index(); |
|
18 | - $table->timestamps(); |
|
19 | - $table->softDeletes(); |
|
20 | - }); |
|
21 | - } |
|
8 | + public function up() |
|
9 | + { |
|
10 | + Schema::create('dashboard_apels', function(Blueprint $table) { |
|
11 | + $table->increments('id'); |
|
12 | + $table->string('negara', 191); |
|
13 | + $table->integer('province_id')->unsigned()->nullable()->index(); |
|
14 | + $table->boolean('kab_kota')->index(); |
|
15 | + $table->integer('regency_id')->unsigned()->nullable()->index(); |
|
16 | + $table->string('tahun', 191); |
|
17 | + $table->decimal('data')->index(); |
|
18 | + $table->timestamps(); |
|
19 | + $table->softDeletes(); |
|
20 | + }); |
|
21 | + } |
|
22 | 22 | |
23 | - public function down() |
|
24 | - { |
|
25 | - Schema::drop('dashboard_apels'); |
|
26 | - } |
|
23 | + public function down() |
|
24 | + { |
|
25 | + Schema::drop('dashboard_apels'); |
|
26 | + } |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |