1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use Illuminate\Support\Facades\Schema; |
4
|
|
|
use Illuminate\Database\Schema\Blueprint; |
5
|
|
|
use Illuminate\Database\Migrations\Migration; |
6
|
|
|
|
7
|
|
|
class ReferenceFrequencyOnManager extends Migration |
|
|
|
|
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Run the migrations. |
11
|
|
|
* |
12
|
|
|
* @return void |
13
|
|
|
*/ |
14
|
|
|
public function up() |
15
|
|
|
{ |
16
|
|
|
Schema::table('managers', function (Blueprint $table) { |
17
|
|
|
$table->integer('work_review_frequency_id')->unsigned(); |
18
|
|
|
$table->integer('stay_late_frequency_id')->unsigned(); |
19
|
|
|
$table->integer('engage_team_frequency_id')->unsigned(); |
20
|
|
|
$table->integer('development_opportunity_frequency_id')->unsigned(); |
21
|
|
|
$table->integer('refuse_low_value_work_frequency_id')->unsigned(); |
22
|
|
|
}); |
23
|
|
|
|
24
|
|
|
Schema::table('managers', function (Blueprint $table) { |
25
|
|
|
$table->foreign('work_review_frequency_id')->references('id')->on('frequencies')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
26
|
|
|
$table->foreign('stay_late_frequency_id')->references('id')->on('frequencies')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
27
|
|
|
$table->foreign('engage_team_frequency_id')->references('id')->on('frequencies')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
28
|
|
|
$table->foreign('development_opportunity_frequency_id')->references('id')->on('frequencies')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
29
|
|
|
$table->foreign('refuse_low_value_work_frequency_id')->references('id')->on('frequencies')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
30
|
|
|
}); |
31
|
|
|
|
32
|
|
|
Schema::table('manager_translations', function (Blueprint $table) { |
33
|
|
|
$table->dropColumn('review_options'); |
34
|
|
|
$table->dropColumn('staylate'); |
35
|
|
|
$table->dropColumn('engage'); |
36
|
|
|
$table->dropColumn('opportunities'); |
37
|
|
|
$table->dropColumn('low_value_work_requests'); |
38
|
|
|
}); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Reverse the migrations. |
43
|
|
|
* |
44
|
|
|
* @return void |
45
|
|
|
*/ |
46
|
|
|
public function down() |
47
|
|
|
{ |
48
|
|
|
Schema::table('managers', function (Blueprint $table) { |
49
|
|
|
$table->dropForeign('managers_work_review_frequency_id_foreign'); |
50
|
|
|
$table->dropForeign('managers_stay_late_frequency_id_foreign'); |
51
|
|
|
$table->dropForeign('managers_engage_team_frequency_id_foreign'); |
52
|
|
|
$table->dropForeign('managers_development_opportunity_frequency_id_foreign'); |
53
|
|
|
$table->dropForeign('managers_refuse_low_value_work_frequency_id_foreign'); |
54
|
|
|
|
55
|
|
|
$table->dropColumn('work_review_frequency_id'); |
56
|
|
|
$table->dropColumn('stay_late_frequency_id'); |
57
|
|
|
$table->dropColumn('engage_team_frequency_id'); |
58
|
|
|
$table->dropColumn('development_opportunity_frequency_id'); |
59
|
|
|
$table->dropColumn('refuse_low_value_work_frequency_id'); |
60
|
|
|
}); |
61
|
|
|
|
62
|
|
|
Schema::table('manager_translations', function (Blueprint $table) { |
63
|
|
|
$table->string('review_options')->nullable(); |
64
|
|
|
$table->string('staylate')->nullable(); |
65
|
|
|
$table->string('engage')->nullable(); |
66
|
|
|
$table->string('opportunities')->nullable(); |
67
|
|
|
$table->string('low_value_work_requests')->nullable(); |
68
|
|
|
}); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.