product on shelf

This commit is contained in:
2026-08-31 14:59:48 +05:30
parent ffc66462fc
commit 4bce5ac854
6 changed files with 103 additions and 0 deletions

13
main.go
View File

@@ -156,6 +156,19 @@ func main() {
ON catalogueuploads (tenantid, locationid, created DESC)`).Error; err != nil {
log.Println("⚠️ could not add catalogueuploads scope index:", err)
}
// The sheet's own prices and opening stock, kept so shelving can happen
// after the browser that uploaded it is gone.
//
// Added separately from the CREATE above because the table already exists in
// production without it. The ingest service holds none of this — its
// catalogue is shared by every merchant and carries no price and no stock —
// so before this column the join could only be made in the tab that did the
// upload, and that tab is normally long closed by the time their admin
// releases the drop and the run finishes.
if err := db.DB.Exec(
`ALTER TABLE catalogueuploads ADD COLUMN IF NOT EXISTS sheetrows jsonb`).Error; err != nil {
log.Fatal("could not add catalogueuploads.sheetrows:", err)
}
f := facade.NewFacade(db.DB, db.CatalogueDB)