Skip to content

Commit 1cc17ac

Browse files
committed
no-mistakes(review): Document that custom schemaConventions reach only the TS toolchain
1 parent 26a841f commit 1cc17ac

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎docs/features/migrations-and-drift.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,11 @@ export default defineConfig({
535535
});
536536
```
537537

538+
Such an object reaches only the TypeScript toolchain: `meta migrate`, `meta verify --db`, and
539+
the TypeScript generators resolve it. The C# and Kotlin generators read only the
540+
`migrate.conventions` preset name from `.metaobjects/config.json` and apply the default rule for
541+
every derived name, foreign-key indexes included.
542+
538543
**Changing the conventions of an existing database.** On Postgres, a primary key, FK, CHECK or
539544
index whose definition is unchanged and whose name differs is renamed in place (`RENAME
540545
CONSTRAINT` / `ALTER INDEX … RENAME`), never dropped and re-created; new FK indexes are created.
@@ -589,6 +594,12 @@ setting, so the mapping and the database agree:
589594
Java (OMDB is data access only and maps no indexes) and Python (Pydantic models and routes, no
590595
ORM mapping) generate nothing that declares an index, so the option changes no output there.
591596

597+
A project that pairs its own conventions object with `migrate.foreignKeyIndexes` and a C# or
598+
Kotlin mapping should make the object's `foreignKeyIndexes` match the default rule (index each
599+
foreign key nothing leads with, named `<table>_<columns>_idx`) or leave the option off;
600+
otherwise the C# DbContext or Kotlin Exposed tables may declare an index `meta migrate` did not
601+
create.
602+
592603
## How CHECK constraints and expression indexes are compared
593604

594605
Postgres rewrites an expression before it stores it (`"k" IN ('x')` becomes `k = 'x'::text`,

0 commit comments

Comments
 (0)