unfinish: seeder and fix migration

This commit is contained in:
Hafizh A. Y
2026-01-07 16:09:08 +07:00
parent 4ee5bf3628
commit 8a57d439dc
4 changed files with 5 additions and 3 deletions
@@ -1 +1,2 @@
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();
+1
View File
@@ -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
+1 -1
View File
@@ -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"`