Total Complexity | 4 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class CreateMedFormFieldValTabTables extends Migration |
||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | if (!Schema::hasTable('med_form_field_val_tab')) { |
||
17 | Schema::create('med_form_field_val_tab', function (Blueprint $table) { |
||
18 | $table->id(); |
||
19 | $table->unsignedBigInteger('form_field_id')->nullable(); |
||
20 | $table->foreign('form_field_id') |
||
21 | ->references('id') |
||
22 | ->on('med_form_fields') |
||
23 | ->onDelete('set null'); |
||
24 | $table->string('table_name'); |
||
25 | $table->timestamps(); |
||
26 | }); |
||
27 | } |
||
28 | |||
29 | if (!Schema::hasTable('med_form_field_val_tab_translations')) { |
||
30 | Schema::create('med_form_field_val_tab_translations', function (Blueprint $table) { |
||
31 | $table->id(); |
||
32 | $table->string('value'); |
||
33 | $table->text('text')->nullable(); |
||
34 | $table->unsignedBigInteger('val_tab_id')->nullable(); |
||
35 | $table->foreign('val_tab_id') |
||
36 | ->references('id') |
||
37 | ->on('med_form_field_val_tab') |
||
38 | ->onDelete('set null'); |
||
39 | $table->string('locale')->nullable(); |
||
40 | $table->text('description')->nullable(); |
||
41 | $table->timestamps(); |
||
42 | }); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Reverse the migrations. |
||
48 | * |
||
49 | * @return void |
||
50 | */ |
||
51 | public function down() |
||
55 | } |
||
56 | } |