Repository navigation
Conversation
Admin.Repo becomes an AshPostgres.Repo; ash, ash_postgres and picosat_elixir are added. A generated migration installs the ash functions and btree_gist, and a hand-written one adds the item_membership (account_id, item_path) gist index concurrently (ADR 0003). Item, ItemMembership, ItemVisibility and Account resources sit over core's tables with migrate? false and core's constraint and index names, in the Admin.Core.Items, Memberships and Members domains. Item carries the shared item policies: the effective_permission calculation taking account_id, the AtLeast check, and get_item/2 with authorize_with: :error for 403 vs 404. mix precommit and CI run ash_postgres.generate_migrations --check.
A failed concurrent index build leaves an invalid index under the same name, which create_if_not_exists would then skip: drop it first. Account's moduledoc no longer says core owns the schema (ADR 0002). The ~s() fixture docs closed at their inner parenthesis.
This branch has not been deployed
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.
Closes #342
Summary
Ash in admin, step 1 of ADR 0003's transition.
Admin.Repobecomes anAshPostgres.Repo, and the first resources sit over core's tables withmigrate? falseand core's constraint and index names.The item read policy, in order:
mix precommitand CI runmix ash_postgres.generate_migrations --check.poisonand pointing ex_aws at Jason were already onmain.Admin.Core.*domains.Evidence
test/admin/core/items_test.exsdoesn't exist.After: 12 tests pass:
get_item/2:forbid_if expr(is_hidden)removed, the two Hidden Item tests fail.mix precommit: 477 tests, 0 failures.credo --strictis clean.Admin.Release.migrate()on a fresh database runs both migrations. The index rolls back and rebuilds valid (indisvalid = t).Merge Danger
Door: two-way, mostly. The code reverts cleanly. The migrations add functions, an extension and an index to the shared database, and a revert leaves them in place, where they do no harm. Both migrations have a
down.Blast Radius: database
Admin.Release.migrateruns:CREATE EXTENSION IF NOT EXISTS btree_gist, which needs the migration role to own the database;ash_*,uuid_generate_v7), created inpublic;item_membership, about 144k rows on the 2026-11-12 dump.Admin.Repochanges module type. The existing Ecto code works unchanged (the full suite passes).Admin.ItemsTest"get_descendants" is flaky onmain(two items tie on the sort order). This PR doesn't touch it.