mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-24 07:55:35 +00:00
Update 2022_02_06_194000_create_shoppingcart_items_table.php
This commit is contained in:
@@ -19,9 +19,12 @@ class CreateShoppingcartItemsTable extends Migration
|
|||||||
/* Relation CartItem to Cart */
|
/* Relation CartItem to Cart */
|
||||||
$table->unsignedBigInteger('cart_id');
|
$table->unsignedBigInteger('cart_id');
|
||||||
$table->foreign('cart_id')->references('id')->on(Config::get('cart.database.tables.cart'));
|
$table->foreign('cart_id')->references('id')->on(Config::get('cart.database.tables.cart'));
|
||||||
|
|
||||||
/* Make id and rowid primary so there can not be duplicates */
|
/* Make id and rowid primary so there can not be duplicates */
|
||||||
$table->primary(['cart_id', 'row_id']);
|
$table->primary(['cart_id', 'row_id']);
|
||||||
|
|
||||||
|
/* Columns required for the morphTo relationship being the id and FQCN of the model */
|
||||||
|
$table->morphs('model');
|
||||||
|
|
||||||
/* The price of the CartItem */
|
/* The price of the CartItem */
|
||||||
$table->unsignedBigInteger('price')->nullable();
|
$table->unsignedBigInteger('price')->nullable();
|
||||||
|
|||||||
Reference in New Issue
Block a user