@@ 8-37 (lines=30) @@ | ||
5 | use Illuminate\Database\Schema\Blueprint; |
|
6 | use Illuminate\Support\Facades\Schema; |
|
7 | ||
8 | class CreateBuildsTable extends Migration |
|
9 | { |
|
10 | /** |
|
11 | * Run the migrations. |
|
12 | * |
|
13 | * @return void |
|
14 | */ |
|
15 | public function up() |
|
16 | { |
|
17 | Schema::create('fg_app_builds', function (Blueprint $table) { |
|
18 | $table->string('id')->index(); |
|
19 | $table->string('ministry_id', 150)->index(); |
|
20 | $table->string('version'); |
|
21 | $table->enum('status', Build::BUILD_STATUS)->default('building'); |
|
22 | $table->timestamps(); |
|
23 | ||
24 | $table->foreign('ministry_id')->references('id')->on('fg_ministries')->onDelete('cascade'); |
|
25 | }); |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * Reverse the migrations. |
|
30 | * |
|
31 | * @return void |
|
32 | */ |
|
33 | public function down() |
|
34 | { |
|
35 | Schema::dropIfExists('fg_app_builds'); |
|
36 | } |
|
37 | } |
|
38 |
@@ 7-37 (lines=31) @@ | ||
4 | use Illuminate\Database\Schema\Blueprint; |
|
5 | use Illuminate\Support\Facades\Schema; |
|
6 | ||
7 | class CreateBuildLogsTable extends Migration |
|
8 | { |
|
9 | /** |
|
10 | * Run the migrations. |
|
11 | * |
|
12 | * @return void |
|
13 | */ |
|
14 | public function up() |
|
15 | { |
|
16 | Schema::create('fg_build_logs', function (Blueprint $table) { |
|
17 | $table->string('id')->index(); |
|
18 | $table->string('build_id', 150)->index(); |
|
19 | $table->string('task'); |
|
20 | $table->text('result'); |
|
21 | $table->boolean('success'); |
|
22 | $table->timestamps(); |
|
23 | ||
24 | $table->foreign('build_id')->references('id')->on('fg_app_builds')->onDelete('cascade'); |
|
25 | }); |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * Reverse the migrations. |
|
30 | * |
|
31 | * @return void |
|
32 | */ |
|
33 | public function down() |
|
34 | { |
|
35 | Schema::dropIfExists('fg_build_logs'); |
|
36 | } |
|
37 | } |
|
38 |