From df5034d76f8712d0d5976870e64a1bdb192b931e Mon Sep 17 00:00:00 2001 From: liapples Date: Sun, 26 Sep 2021 10:54:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MySQL_change.sql | 3 +++ app/Models/ProductSpec.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/MySQL_change.sql b/MySQL_change.sql index 263f655..32a85de 100644 --- a/MySQL_change.sql +++ b/MySQL_change.sql @@ -130,3 +130,6 @@ ALTER TABLE `product_specs` ALTER TABLE `agent_product_specs` DROP COLUMN `name`, DROP COLUMN `date`; +ALTER TABLE `product_specs` + ADD COLUMN `deleted_at` TIMESTAMP NULL DEFAULT NULL AFTER `price`; + diff --git a/app/Models/ProductSpec.php b/app/Models/ProductSpec.php index f6bb574..6ceabc6 100644 --- a/app/Models/ProductSpec.php +++ b/app/Models/ProductSpec.php @@ -4,10 +4,11 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class ProductSpec extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $guarded = ['id'];