@@ -23,13 +23,13 @@ public function up()
2323 $ table_name_files = $ this ->config ['table_name ' ]['files ' ];
2424 $ table_name_pages = $ this ->table_name ;
2525
26- $ table ->foreign ('main_image ' , ' cms_pages_ibfk_main_image ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
27- $ table ->foreign ('main_banner ' , ' cms_pages_ibfk_main_banner ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
28- $ table ->foreign ('extra_image_1 ' , ' cms_pages_ibfk_extra_image_1 ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
29- $ table ->foreign ('extra_image_2 ' , ' cms_pages_ibfk_extra_image_2 ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
30- $ table ->foreign ('extra_image_3 ' , ' cms_pages_ibfk_extra_image_3 ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
31- $ table ->foreign ('parent_id ' , ' cms_pages_ibfk_parent_id ' )->references ('id ' )->on ($ table_name_pages )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
32- //$table->foreign('user_id', 'cms_pages_ibfk_user_id ')->references('id')->on('users')->onUpdate('RESTRICT')->onDelete('SET NULL');
26+ $ table ->foreign ('main_image ' , $ this -> table_name . ' _ibfk_main_image ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
27+ $ table ->foreign ('main_banner ' , $ this -> table_name . ' _ibfk_main_banner ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
28+ $ table ->foreign ('extra_image_1 ' , $ this -> table_name . ' _ibfk_extra_image_1 ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
29+ $ table ->foreign ('extra_image_2 ' , $ this -> table_name . ' _ibfk_extra_image_2 ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
30+ $ table ->foreign ('extra_image_3 ' , $ this -> table_name . ' _ibfk_extra_image_3 ' )->references ('id ' )->on ($ table_name_files )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
31+ $ table ->foreign ('parent_id ' , $ this -> table_name . ' _ibfk_parent_id ' )->references ('id ' )->on ($ table_name_pages )->onUpdate ('RESTRICT ' )->onDelete ('SET NULL ' );
32+ //$table->foreign('user_id', $this->table_name . '_ibfk_user_id ')->references('id')->on('users')->onUpdate('RESTRICT')->onDelete('SET NULL');
3333 });
3434 }
3535
@@ -39,12 +39,12 @@ public function up()
3939 public function down ()
4040 {
4141 Schema::table ($ this ->table_name , function (Blueprint $ table ) {
42- $ table ->dropForeign (' cms_pages_ibfk_main_image ' );
43- $ table ->dropForeign (' cms_pages_ibfk_main_banner ' );
44- $ table ->dropForeign (' cms_pages_ibfk_extra_image_1 ' );
45- $ table ->dropForeign (' cms_pages_ibfk_extra_image_2 ' );
46- $ table ->dropForeign (' cms_pages_ibfk_extra_image_3 ' );
47- //$table->dropForeign('cms_pages_ibfk_user_id ');
42+ $ table ->dropForeign ($ this -> table_name . ' _ibfk_main_image ' );
43+ $ table ->dropForeign ($ this -> table_name . ' _ibfk_main_banner ' );
44+ $ table ->dropForeign ($ this -> table_name . ' _ibfk_extra_image_1 ' );
45+ $ table ->dropForeign ($ this -> table_name . ' _ibfk_extra_image_2 ' );
46+ $ table ->dropForeign ($ this -> table_name . ' _ibfk_extra_image_3 ' );
47+ //$table->dropForeign($this->table_name . '_ibfk_user_id ');
4848 });
4949 }
5050}
0 commit comments