mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
unfinish: seeder and fix migration
This commit is contained in:
@@ -1 +1,2 @@
|
||||
DROP TABLE IF EXISTS expenses;
|
||||
DROP SEQUENCE IF EXISTS expenses_ref_seq;
|
||||
DROP TABLE IF EXISTS expenses;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
-- Drop function and sequence for sales order numbers
|
||||
DROP FUNCTION IF EXISTS generate_so_number();
|
||||
DROP SEQUENCE IF EXISTS so_number_seq;
|
||||
DROP FUNCTION IF EXISTS generate_so_number();
|
||||
|
||||
@@ -299,6 +299,7 @@ func seedProducts(tx *gorm.DB, createdBy uint, uoms map[string]uint, categories
|
||||
Tax: tax,
|
||||
ExpiryPeriod: seed.Expiry,
|
||||
CreatedBy: createdBy,
|
||||
IsVisible: seed.IsVisible,
|
||||
}
|
||||
if err := tx.Create(&product).Error; err != nil {
|
||||
return err
|
||||
|
||||
@@ -21,7 +21,7 @@ type Product struct {
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
IsVisible bool `gorm:"column:is_visible;default:true"`
|
||||
IsVisible bool ``
|
||||
|
||||
CreatedUser User `gorm:"foreignKey:CreatedBy;references:Id"`
|
||||
Uom Uom `gorm:"foreignKey:UomId;references:Id"`
|
||||
|
||||
Reference in New Issue
Block a user