chore: format & fix docs

This commit is contained in:
Zach Daniel 2023-09-22 17:16:47 -04:00
parent cca5f0244b
commit b00dcf20c9
3 changed files with 9 additions and 5 deletions

View file

@ -41,10 +41,10 @@ end
| `base_filter_sql` | `String.t` | | A raw sql version of the base_filter, e.g `representative = true`. Required if trying to create a unique constraint on a resource with a base_filter |
| `simple_join_first_aggregates` | `list(atom)` | `[]` | A list of `:first` type aggregate names that can be joined to using a simple join. Use when you have a `:first` aggregate that uses a to-many relationship , but your `filter` statement ensures that there is only one result. Optimizes the generated query. |
| `skip_unique_indexes` | `list(atom) \| atom` | `false` | Skip generating unique indexes when generating migrations |
| `unique_index_names` | `{list(atom), String.t} \| {list(atom), String.t, String.t}` | `[]` | A list of unique index names that could raise errors that are not configured in identities, or an mfa to a function that takes a changeset and returns the list. In the format `{[:affected, :keys], "name_of_constraint"}` or `{[:affected, :keys], "name_of_constraint", "custom error message"}` |
| `unique_index_names` | `list({list(atom), String.t} \| {list(atom), String.t, String.t})` | `[]` | A list of unique index names that could raise errors that are not configured in identities, or an mfa to a function that takes a changeset and returns the list. In the format `{[:affected, :keys], "name_of_constraint"}` or `{[:affected, :keys], "name_of_constraint", "custom error message"}` |
| `exclusion_constraint_names` | ``any`` | `[]` | A list of exclusion constraint names that could raise errors. Must be in the format `{:affected_key, "name_of_constraint"}` or `{:affected_key, "name_of_constraint", "custom error message"}` |
| `identity_index_names` | ``any`` | `[]` | A keyword list of identity names to the unique index name that they should use when being managed by the migration generator. |
| `foreign_key_names` | `{atom, String.t} \| {String.t, String.t}` | `[]` | A list of foreign keys that could raise errors, or an mfa to a function that takes a changeset and returns a list. In the format: `{:key, "name_of_constraint"}` or `{:key, "name_of_constraint", "custom error message"}` |
| `foreign_key_names` | `list({atom, String.t} \| {String.t, String.t})` | `[]` | A list of foreign keys that could raise errors, or an mfa to a function that takes a changeset and returns a list. In the format: `{:key, "name_of_constraint"}` or `{:key, "name_of_constraint", "custom error message"}` |
| `migration_ignore_attributes` | `list(atom)` | `[]` | A list of attributes that will be ignored when generating migrations. |
| `table` | `String.t` | | The table to store and read the resource from. If this is changed, the migration generator will not remove the old table. |
| `schema` | `String.t` | | The schema that the table is located in. Schema-based multitenancy will supercede this option. If this is changed, the migration generator will not remove the old schema. |

View file

@ -311,7 +311,10 @@ defmodule AshPostgres.DataLayer do
doc: "Skip generating unique indexes when generating migrations"
],
unique_index_names: [
type: {:list, {:or, [{:tuple, [{:list, :atom}, :string]}, {:tuple, [{:list, :atom}, :string, :string]}]}},
type:
{:list,
{:or,
[{:tuple, [{:list, :atom}, :string]}, {:tuple, [{:list, :atom}, :string, :string]}]}},
default: [],
doc: """
A list of unique index names that could raise errors that are not configured in identities, or an mfa to a function that takes a changeset and returns the list. In the format `{[:affected, :keys], "name_of_constraint"}` or `{[:affected, :keys], "name_of_constraint", "custom error message"}`

View file

@ -158,7 +158,7 @@ defmodule AshPostgres.MixProject do
AshPostgres.Tsvector
],
Extensions: [
AshPostgres.Extensions.Vector,
AshPostgres.Extensions.Vector
],
"Custom Aggregates": [
AshPostgres.CustomAggregate
@ -229,7 +229,8 @@ defmodule AshPostgres.MixProject do
],
"spark.formatter": "spark.formatter --extensions AshPostgres.DataLayer",
"spark.cheat_sheets": "spark.cheat_sheets --extensions AshPostgres.DataLayer",
"spark.cheat_sheets_in_search": "spark.cheat_sheets_in_search --extensions AshPostgres.DataLayer",
"spark.cheat_sheets_in_search":
"spark.cheat_sheets_in_search --extensions AshPostgres.DataLayer",
"test.generate_migrations": "ash_postgres.generate_migrations",
"test.check_migrations": "ash_postgres.generate_migrations --check",
"test.migrate_tenants": "ash_postgres.migrate --tenants",