|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use Illuminate\Support\Facades\Schema; |
|
4
|
|
|
use Illuminate\Database\Schema\Blueprint; |
|
5
|
|
|
use Illuminate\Database\Migrations\Migration; |
|
6
|
|
|
|
|
7
|
|
|
class ReferenceFrequencyOnWorkEnvironment extends Migration |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* Run the migrations. |
|
11
|
|
|
* |
|
12
|
|
|
* @return void |
|
13
|
|
|
*/ |
|
14
|
|
|
public function up() |
|
15
|
|
|
{ |
|
16
|
|
|
Schema::table('work_environments', function (Blueprint $table) { |
|
17
|
|
|
$table->dropColumn('remote_allowed'); |
|
18
|
|
|
$table->dropColumn('telework_allowed'); |
|
19
|
|
|
$table->dropColumn('flexible_allowed'); |
|
20
|
|
|
|
|
21
|
|
|
$table->boolean('remote_work_allowed')->nullable(); |
|
22
|
|
|
$table->integer('telework_allowed_frequency_id')->unsigned()->nullable(); |
|
23
|
|
|
$table->integer('flexible_hours_frequency_id')->unsigned()->nullable(); |
|
24
|
|
|
}); |
|
25
|
|
|
|
|
26
|
|
|
Schema::table('work_environments', function (Blueprint $table) { |
|
27
|
|
|
$table->foreign('telework_allowed_frequency_id')->references('id')->on('frequencies')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
|
28
|
|
|
$table->foreign('flexible_hours_frequency_id')->references('id')->on('frequencies')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
|
29
|
|
|
}); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Reverse the migrations. |
|
34
|
|
|
* |
|
35
|
|
|
* @return void |
|
36
|
|
|
*/ |
|
37
|
|
|
public function down() |
|
38
|
|
|
{ |
|
39
|
|
|
Schema::table('work_environments', function (Blueprint $table) { |
|
40
|
|
|
$table->dropForeign('work_environments_telework_allowed_frequency_id_foreign'); |
|
41
|
|
|
$table->dropForeign('work_environments_flexible_hours_frequency_id_foreign'); |
|
42
|
|
|
}); |
|
43
|
|
|
|
|
44
|
|
|
Schema::table('work_environments', function (Blueprint $table) { |
|
45
|
|
|
$table->dropColumn('remote_work_allowed'); |
|
46
|
|
|
$table->dropColumn('telework_allowed_frequency_id'); |
|
47
|
|
|
$table->dropColumn('flexible_hours_frequency_id'); |
|
48
|
|
|
|
|
49
|
|
|
$table->string('remote_allowed')->nullable(); |
|
50
|
|
|
$table->string('telework_allowed')->nullable(); |
|
51
|
|
|
$table->string('flexible_allowed')->nullable(); |
|
52
|
|
|
}); |
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|