Document how to delete columns

This commit is contained in:
Simon Binder 2021-03-12 22:48:28 +01:00
parent 3701af3808
commit cdb188dc5f
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 11 additions and 0 deletions

View File

@ -136,6 +136,17 @@ transformation:
await m.alterTable(TableMigration(todos)); 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 ### Renaming columns
If you're renaming a column in Dart, note that the easiest way is to just rename the getter and use If you're renaming a column in Dart, note that the easiest way is to just rename the getter and use