You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --use_fragments option to resource generator | Closes#437 (#709)
Add a new `--use_fragments` (`-f`) flag to `mix ash_postgres.gen.resources`
that generates attributes and relationships in a separate fragment file.
This allows the fragment to be regenerated without affecting user
customizations in the main resource file.
When enabled:
- Creates fragment at `{Resource}.Model` (e.g., `MyApp.Accounts.User.Model`)
- Fragment contains attributes, relationships, and identities
- Main resource includes `fragments: [FragmentModule]` option
- If resource already exists, only regenerates the fragment
* refactor: rename --use_fragments to --fragments and remove -f alias
Copy file name to clipboardExpand all lines: lib/mix/tasks/ash_postgres.gen.resources.ex
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ if Code.ensure_loaded?(Igniter) do
34
34
- `public` - Mark all attributes and relationships as `public? true`. Defaults to `true`.
35
35
- `no-migrations` - Do not generate snapshots & migrations for the resources. Defaults to `false`.
36
36
- `skip-unknown` - Skip any attributes with types that we don't have a corresponding Elixir type for, and relationships that we can't assume the name of.
37
+
- `fragments` - Generate attributes and relationships in a separate fragment file. This allows the fragment to be regenerated without affecting user customizations in the main resource file. Defaults to `false`.
37
38
38
39
## Tables
39
40
@@ -61,7 +62,8 @@ if Code.ensure_loaded?(Igniter) do
61
62
skip_unknown: :boolean,
62
63
migrations: :boolean,
63
64
snapshots_only: :boolean,
64
-
domain: :keep
65
+
domain: :keep,
66
+
fragments: :boolean
65
67
],
66
68
aliases: [
67
69
t: :tables,
@@ -74,7 +76,8 @@ if Code.ensure_loaded?(Igniter) do
0 commit comments