Repository navigation
fix: demo extras seed completes on PostgreSQL - #407
Merged
navneetkumar-pim-webkul merged 5 commits intoMay 26, 2026
Merged
navneetkumar-pim-webkul merged 5 commits into
navneetkumar-pim-webkul merged 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Unopim’s demo extras seeding so unopim:install:demo-data can complete on PostgreSQL by normalizing boolean payloads, temporarily bypassing FK enforcement during the dump replay, and preventing PostgreSQL sequence repair from running on tables that cannot support it.
Changes:
- Add schema-driven casting of
0/1integers to PHP booleans forbooleancolumns before inserting demo rows. - Add driver-specific FK/trigger bypass during demo dump application and ensure failures rethrow to avoid leaving partial demo state.
- Filter the table list passed to
DatabaseSequenceHelper::fixSequences()to only those whoseidcolumn is integer-like; add regression tests around these behaviors.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/Webkul/Installer/src/Database/Seeders/DemoExtrasTableSeeder.php | Adds boolean casting, PostgreSQL FK/trigger bypass, sequence-table filtering, and rethrow-on-failure behavior. |
| packages/Webkul/Installer/tests/Unit/DemoExtrasBooleanCastTest.php | Adds unit coverage for boolean casting behavior (int 0/1 → bool only on boolean columns). |
| packages/Webkul/Installer/tests/Unit/DemoExtrasPgsqlFkBypassTest.php | Adds unit coverage asserting driver-specific FK/trigger bypass statements are emitted. |
| packages/Webkul/Installer/tests/Unit/DemoExtrasSequenceFilterTest.php | Adds unit coverage for filtering out tables without integer id (e.g., join tables, UUID PKs). |
| packages/Webkul/AdminApi/tests/Feature/Catalog/ApiCategoryTest.php | Makes locale selection deterministic (via orderBy('id')) in “all locales” category tests. |
…-pgsql-boolean-cast # Conflicts: # packages/Webkul/Installer/src/Database/Seeders/DemoExtrasTableSeeder.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixesed Demo seed on pgsql failed in 3 stacked ways, leaving the dashboard half-populated:
booleancolumns → SQLSTATE 42804setval(MAX(id)+1)on join tables (no id) andoauth_clients(uuid id) → SQLSTATE 42703 / 42883Fix (all in
DemoExtrasTableSeeder, Core helper untouched)Schema::getColumnsfixSequencesTest plan
unopim:install:demo-dataon pgsql completes, dashboard full