PATH:
home
/
lab2454c
/
costbloc.com
/
Modules
/
Coupon
/
Database
/
Migrations
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddForeignKeysToCouponsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('coupons', function (Blueprint $table) { $table->foreign(['vendor_id'])->references(['id'])->on('vendors')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign(['shop_id'])->references(['id'])->on('shops')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('coupons', function (Blueprint $table) { $table->dropForeign('coupons_vendor_id_foreign'); $table->dropForeign('coupons_shop_id_foreign'); }); } }
[-] 2021_11_25_072819_coupon_trigger.php
[edit]
[-] 2021_10_10_065932_add_foreign_keys_to_product_coupons_table.php
[edit]
[-] 2021_10_10_065931_create_product_coupons_table.php
[edit]
[+]
..
[-] 2021_10_10_065928_add_foreign_keys_to_coupons_table.php
[edit]
[-] 2022_09_05_073603_add_foreign_keys_to_coupons_meta_table.php
[edit]
[-] 2021_10_10_065929_create_coupon_redeems_table.php
[edit]
[-] 2021_10_10_065927_create_coupons_table.php
[edit]
[-] 2021_10_10_065930_add_foreign_keys_to_coupon_redeems_table.php
[edit]
[-] 2022_09_04_050839_create_coupons_meta_table.php
[edit]