From 10d57412951c8b0f5a6a546fad7beb211454f58b Mon Sep 17 00:00:00 2001 From: Roderik van Heijst Date: Tue, 13 Apr 2021 12:38:54 +0200 Subject: [PATCH] fix(docs): Specify table creation order method Signed-off-by: Roderik van Heijst --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d7f36ae..ede7d60 100644 --- a/README.md +++ b/README.md @@ -583,7 +583,14 @@ type, you can: Foreign key constraints can be defined in the model definition. **Note**: The order of table creation is important. A referenced table must -exist before creating a foreign key constraint. +exist before creating a foreign key constraint. The order can be specified +using the optional `SchemaMigrationOptions` argument of `migrateSchema`: + +``` +await app.migrateSchema({ + models: [ 'Customer', 'Order' ] +}); +``` Define your models and the foreign key constraints as follows: