feat(subscribe): update inventory logic in subscribe table and add migration scripts
This commit is contained in:
parent
518294a528
commit
577490749c
@ -0,0 +1,5 @@
|
||||
|
||||
-- This migration script reverts the inventory values in the 'subscribe' table
|
||||
UPDATE `subscribe`
|
||||
SET `inventory` = 0
|
||||
WHERE `inventory` = -1;
|
||||
4
initialize/migrate/database/02125_subscribe_stock.up.sql
Normal file
4
initialize/migrate/database/02125_subscribe_stock.up.sql
Normal file
@ -0,0 +1,4 @@
|
||||
-- Update the `subscribe` table to set `inventory` to -1 where it is currently 0
|
||||
UPDATE `subscribe`
|
||||
SET `inventory` = -1
|
||||
WHERE `inventory` = 0;
|
||||
@ -15,7 +15,7 @@ type Subscribe struct {
|
||||
UnitTime string `gorm:"type:varchar(255);not null;default:'';comment:Unit Time"`
|
||||
Discount string `gorm:"type:text;comment:Discount"`
|
||||
Replacement int64 `gorm:"type:int;not null;default:0;comment:Replacement"`
|
||||
Inventory int64 `gorm:"type:int;not null;default:0;comment:Inventory"`
|
||||
Inventory int64 `gorm:"type:int;not null;default:-1;comment:Inventory"`
|
||||
Traffic int64 `gorm:"type:int;not null;default:0;comment:Traffic"`
|
||||
SpeedLimit int64 `gorm:"type:int;not null;default:0;comment:Speed Limit"`
|
||||
DeviceLimit int64 `gorm:"type:int;not null;default:0;comment:Device Limit"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user