mirror of https://github.com/AMT-Cheif/drift.git
Document how to delete columns
This commit is contained in:
parent
3701af3808
commit
cdb188dc5f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue