fix: add missing module dependencies to auth presets + add b2b:storage preset#1082
Merged
pyramation merged 1 commit intomainfrom May 9, 2026
Merged
fix: add missing module dependencies to auth presets + add b2b:storage preset#1082pyramation merged 1 commit intomainfrom
pyramation merged 1 commit intomainfrom
Conversation
…+ add b2b:storage Every auth preset (auth:email, auth:email+magic, auth:sso, auth:passkey, auth:hardened) included memberships_module:app but was missing the three modules it requires via NOT NULL FKs: - permissions_module:app (grants_table_id) - limits_module:app (caps_table_id) - levels_module:app (levels_table_id) Provisioning with any of these presets would fail with: null value in column "grants_table_id" of relation "memberships_module" violates not-null constraint Also adds b2b:storage preset (b2b + storage_module) for B2B apps that need file upload infrastructure. Proven empirically via CI failures in constructive-db PR #1067.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Every auth preset (
auth:email,auth:email+magic,auth:sso,auth:passkey,auth:hardened) includedmemberships_module:appbut was missing three modules it requires via NOT NULL foreign keys:permissions_module:app→grants_table_idlimits_module:app→caps_table_idlevels_module:app→levels_table_idProvisioning a database with any of these presets would fail with:
This was proven empirically via CI failures in constructive-db PR #1067 when switching tests from
{all}to targeted presets.Also adds a new
b2b:storagepreset (b2b+storage_module) for B2B apps that need file upload infrastructure.Review & Testing Checklist for Human
memberships_modulerows actually have NOT NULL constraints ongrants_table_id,caps_table_id, andlevels_table_idinprovision_database_modules. The fix is based on empirical CI failures, but the exact column names inincludes_notesshould be double-checked against the DDL.b2b:storageis a strict superset ofb2b: Verify the module list inb2b-storage.tscontains every module fromb2b.tsplus onlystorage_module. Module ordering differs between the two files but should be irrelevant pertypes.ts("Order doesn't matter — provisioning resolves dependencies").auth:email: The summary now says "with app-level permissions" — previously positioned as "no permissions" (it was inomits_notes). This is technically accurate (the modules are structural dependencies, not feature-level RBAC), but may affect how the preset is presented in CLIs/UIs.Recommended test plan: Provision a database using the
auth:emailpreset module list in constructive-db and confirm it succeeds without constraint violations. The constructive-db test suite already does this viaMODULE_PRESETS.AUTH_EMAIL— a cross-repo CI run or localprovision_database_modulescall is the real validation.Notes
PresetFull(full) is unchanged — renaming it is tracked separately.v_modulesarray). The actual provisioning logic lives inconstructive-db'sprovision_database_modulesSQL function.Link to Devin session: https://app.devin.ai/sessions/e9b410376491419a8fbc4cf3d6f831bd
Requested by: @pyramation