PATH:
home
/
lab2454c
/
costbloc.com
/
Modules
/
Blog
/
Database
/
Migrations
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class BlogTrigger extends Migration { /** * Run the migrations. * * @return void */ public function up() { // -- trigger on after delete blog category \DB::unprepared(' CREATE TRIGGER `blog_category_AFDEL` AFTER DELETE ON `blog_categories` FOR EACH ROW UPDATE blogs SET category_id = "1" WHERE category_id = OLD.id '); } /** * Reverse the migrations. * * @return void */ public function down() { \DB::unprepared('DROP TRIGGER `blog_category_AFDEL`'); } }
[+]
..
[-] 2023_01_05_023932_blog_trigger.php
[edit]
[-] 2021_12_15_064237_create_blog_categories_table.php
[edit]
[-] 2021_12_15_064237_create_blogs_table.php
[edit]