@@ -627,6 +627,17 @@ The `up` and `down` options available when creating tables, adding columns and r
627627_Example: move `email` column from `users` to `profiles` table_
628628
629629```toml
630+[[actions]]
631+type = "remove_column"
632+table = "users"
633+column = "email"
634+
635+ # When `profiles` is changed in the new schema, we write the email address back to the removed column
636+ [actions.down]
637+ table = "profiles"
638+ value = "profiles.email"
639+ where = "users.id = profiles.user_id"
640+
630641[[actions]]
631642type = "add_column"
632643table = "profiles"
@@ -641,17 +652,6 @@ table = "profiles"
641652 table = "users"
642653 value = "users.email"
643654 where = "profiles.user_id = users.id"
644−
645−[[actions]]
646−type = "remove_column"
647−table = "users"
648−column = "email"
649−
650− # When `profiles` is changed in the new schema, we write the email address back to the removed column
651− [actions.down]
652− table = "profiles"
653− value = "profiles.email"
654− where = "users.id = profiles.user_id"
655655```
656656
657657_Example: turn a 1:N relationship between `users` and `accounts` into N:M and change the format of the associated `role`_
@@ -675,7 +675,6 @@ primary_key = ["account_id", "user_id"]
675675 [[actions.columns]]
676676 name = "role"
677677 type = "TEXT"
678− nullable = false
679678
680679 # Backfill the new table from `users` and uppercase the `role`
681680 [actions.up]