|
@@ -0,0 +1,42 @@
|
|
1
|
+<?php
|
|
2
|
+
|
|
3
|
+use Illuminate\Database\Schema\Blueprint;
|
|
4
|
+use Illuminate\Database\Migrations\Migration;
|
|
5
|
+
|
|
6
|
+class CreateAnnualCycle extends Migration
|
|
7
|
+{
|
|
8
|
+
|
|
9
|
+ public function up()
|
|
10
|
+ {
|
|
11
|
+ Schema::create('annual_cycle', function (Blueprint $table) {
|
|
12
|
+
|
|
13
|
+ $table->increments('id');
|
|
14
|
+ $table->string('academic_year');
|
|
15
|
+ $table->integer('semester_start')->unsigned();
|
|
16
|
+ $table->integer('semester_end')->unsigned();
|
|
17
|
+ $table->foreign('semester_start')
|
|
18
|
+ ->references('id')
|
|
19
|
+ ->on('semesters')
|
|
20
|
+ ->onDelete('cascade')
|
|
21
|
+ ->onUpdate('cascade');
|
|
22
|
+ $table->integer('user_id')->unsigned();
|
|
23
|
+ $table->foreign('semester_end')
|
|
24
|
+ ->references('id')
|
|
25
|
+ ->on('semesters')
|
|
26
|
+ ->onDelete('cascade')
|
|
27
|
+ ->onUpdate('cascade');
|
|
28
|
+ $table->timestamps();
|
|
29
|
+ });
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+ /**
|
|
34
|
+ * Reverse the migrations.
|
|
35
|
+ *
|
|
36
|
+ * @return void
|
|
37
|
+ */
|
|
38
|
+ public function down()
|
|
39
|
+ {
|
|
40
|
+ Schema::drop('annual_cycle');
|
|
41
|
+ }
|
|
42
|
+}
|