From cdb188dc5fc983a8840470f9ccf51b9553eeba29 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Fri, 12 Mar 2021 22:48:28 +0100 Subject: [PATCH] Document how to delete columns --- docs/pages/docs/Advanced Features/migrations.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/pages/docs/Advanced Features/migrations.md b/docs/pages/docs/Advanced Features/migrations.md index 3760ce2d..5b279ac6 100644 --- a/docs/pages/docs/Advanced Features/migrations.md +++ b/docs/pages/docs/Advanced Features/migrations.md @@ -136,6 +136,17 @@ transformation: await m.alterTable(TableMigration(todos)); ``` +### Deleting columns + +Deleting a column that's not referenced by a foreign key constraint is easy too: + +```dart +await m.alterTable(TableMigration(yourTable)); +``` + +To delete a column referenced by a foreign key, you'd have to migrate the referencing +tables first. + ### Renaming columns If you're renaming a column in Dart, note that the easiest way is to just rename the getter and use