Переглянути джерело

Crando tabla para el expected target de estudiantes por programa, outcome y semestre

Carlos J Corrada Bravo 3 роки тому
джерело
коміт
552db91495

+ 52
- 0
app/database/migrations/2021_11_12_145021_create_target_outcome_program_table.php Переглянути файл

@@ -0,0 +1,52 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class CreateTargetOutcomeProgramTable extends Migration {
7
+
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('target_outcome_program', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->integer('outcome_id')->unsigned();
18
+			$table->integer('program_id')->unsigned();
19
+			$table->integer('semester_id')->unsigned();
20
+			$table->decimal('expected_target', 5, 2)->default('70.00');
21
+			$table->timestamps();
22
+			$table->foreign('outcome_id')
23
+				->references('id')
24
+				->on('outcomes')
25
+				->onDelete('cascade')
26
+				->onUpdate('cascade');
27
+			$table->foreign('semester_id')
28
+				->references('id')
29
+				->on('semesters')
30
+				->onDelete('cascade')
31
+				->onUpdate('cascade');
32
+
33
+			$table->foreign('program_id')
34
+				->references('id')
35
+				->on('programs')
36
+				->onDelete('cascade')
37
+				->onUpdate('cascade');
38
+
39
+		});
40
+	}
41
+
42
+	/**
43
+	 * Reverse the migrations.
44
+	 *
45
+	 * @return void
46
+	 */
47
+	public function down()
48
+	{
49
+		Schema::drop('target_outcome_program');
50
+	}
51
+
52
+}