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