File tree 1 file changed +43
-0
lines changed
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Illuminate \Support \Facades \Schema ;
4
+ use Illuminate \Database \Schema \Blueprint ;
5
+ use Illuminate \Database \Migrations \Migration ;
6
+
7
+ class CascadeDeleteSignedOffWines extends Migration
8
+ {
9
+ /**
10
+ * Run the migrations.
11
+ *
12
+ * @return void
13
+ */
14
+ public function up ()
15
+ {
16
+
17
+ Schema::table ('wines_chosen_signed_off ' , function (Blueprint $ table ) {
18
+ $ table ->dropForeign ('wines_chosen_signed_off_competition_id_foreign ' );
19
+ $ table ->foreign ('competition_id ' )
20
+ ->references ('id ' )
21
+ ->on ('competition ' )
22
+ ->onDelete ('cascade ' )
23
+ ->onUpdate ('cascade ' );
24
+ });
25
+ }
26
+
27
+ /**
28
+ * Reverse the migrations.
29
+ *
30
+ * @return void
31
+ */
32
+ public function down ()
33
+ {
34
+ Schema::table ('wines_chosen_signed_off ' , function (Blueprint $ table ) {
35
+ $ table ->dropForeign ('wines_chosen_signed_off_competition_id_foreign ' );
36
+ $ table ->foreign ('competition_id ' )
37
+ ->references ('id ' )
38
+ ->on ('competition ' )
39
+ ->onDelete ('no action ' )
40
+ ->onUpdate ('cascade ' );
41
+ });
42
+ }
43
+ }
You can’t perform that action at this time.
0 commit comments