Project

General

Profile

Actions

Feature #163

closed
ES ES

DB | Product schema cleanup and seeder idempotency

Feature #163: DB | Product schema cleanup and seeder idempotency

Added by Eugene Suhanov 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
08/13/2026
Due date:
% Done:

0%

Estimated time:
0:00 h
Spent time:

Description

Deploy blocker, first. Remote seeding fails on Duplicate entry '0001' for key 'products.products_code_unique'. ProductSeeder keys updateOrCreate on slug while the unique
constraint is on code — legacy rows carry code = '0001' with slug = '0001-elegantna-…', so
the match misses and the insert collides. Invisible locally because migrate:fresh --seed starts
empty. Fix: key on code, add a guarded migration realigning legacy slugs, check the other seeders
for the same shape. Also confirm why the remote reports Database: app when production was renamed
to db_nota.

Schema cleanup. Six changes to products, all working on MySQL and SQLite:

  1. Rename the products_code_unique index to code (drop + re-add, not renameIndex).
  2. Drop short_description — nothing renders it. Use Tailwind line-clamp-* instead.
  3. Move meta_title/meta_description to one polymorphic seo_meta table covering products and
    categories.
  4. Drop the images JSON column; the MediaLibrary gallery collection becomes the only source. No
    media_id column — a single FK can't hold 3–4 photos. ⚠️ Must not merge alone: this removes
    the offline-image fallback and production has no MinIO yet.
  5. Drop is_available_today; derive it from pickup_available.
  6. is_premium/is_trend/is_urgent become a labels table + pivot. BadgeResolver and its
    tests move with it; eager-load labels in the listing controllers.

ES Updated by Eugene Suhanov 4 months ago Actions #1

  • Description updated (diff)
  • Estimated time set to 0:00 h

ES Updated by Eugene Suhanov 4 months ago Actions #2

  • Status changed from New to In Progress

ES Updated by Eugene Suhanov 3 months ago Actions #3

  • Status changed from In Progress to Resolved

SN Updated by Serhii Neliubov 3 months ago Actions #4

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom