Skip to content

Commit c5e72db

Browse files
authored
Merge pull request #444 from 0x0aNL/0x0anl-doc-mysql-fk-order
fix(docs): Specify table creation order method
2 parents c681b2d + 10d5741 commit c5e72db

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,14 @@ type, you can:
583583
Foreign key constraints can be defined in the model definition.
584584
585585
**Note**: The order of table creation is important. A referenced table must
586-
exist before creating a foreign key constraint.
586+
exist before creating a foreign key constraint. The order can be specified
587+
using the optional <a href="https://loopback.io/doc/en/lb4/apidocs.repository.schemamigrationoptions.html">`SchemaMigrationOptions`</a> argument of `migrateSchema`:
588+
589+
```
590+
await app.migrateSchema({
591+
models: [ 'Customer', 'Order' ]
592+
});
593+
```
587594
588595
Define your models and the foreign key constraints as follows:
589596

0 commit comments

Comments
 (0)