@@ -500,8 +500,8 @@ column = "email"
500 # For backwards compatibility, we will write back to the removed `email` column whenever `profiles` is changed
500 # For backwards compatibility, we will write back to the removed `email` column whenever `profiles` is changed
501 [actions.down]
501 [actions.down]
502 table = "profiles"
502 table = "profiles"
503− value = "email"
503+ value = "profiles.email"
504− where = "id = user_id"
504+ where = "users.id = profiles.user_id"
507### Indices
507### Indices
@@ -635,8 +635,8 @@ column = "email"
635 # When `profiles` is changed in the new schema, we write the email address back to the removed column
635 # When `profiles` is changed in the new schema, we write the email address back to the removed column
636 [actions.down]
636 [actions.down]
637 table = "profiles"
637 table = "profiles"
638− value = "email"
638+ value = "profiles.email"
639− where = "id = user_id"
639+ where = "users.id = profiles.user_id"
641[[actions]]
641[[actions]]
642type = "add_column"
642type = "add_column"
@@ -650,8 +650,8 @@ table = "profiles"
650 # When `users` is updated in the old schema, we write the email value to `profiles`
650 # When `users` is updated in the old schema, we write the email value to `profiles`
651 [actions.up]
651 [actions.up]
652 table = "users"
652 table = "users"
653− value = "email"
653+ value = "users.email"
654− where = "user_id = id"
654+ where = "profiles.user_id = users.id"
657_Example: turn a 1:N relationship between `users` and `accounts` into N:M and change the format of the associated `role`_
657_Example: turn a 1:N relationship between `users` and `accounts` into N:M and change the format of the associated `role`_
@@ -680,7 +680,7 @@ primary_key = ["account_id", "user_id"]
680 [actions.up]
680 [actions.up]
681 table = "users"
681 table = "users"
682 values = { user_id = "id", account_id = "account_id", role = "UPPER(account_role)" }
682 values = { user_id = "id", account_id = "account_id", role = "UPPER(account_role)" }
683− where = "user_id = id"
683+ where = "user_account_connections.user_id = users.id"
685[[actions]]
685[[actions]]
686type = "remove_column"
686type = "remove_column"
@@ -690,8 +690,8 @@ column = "account_id"
690 # When `user_account_connections` is updated, we write the `account_id` back to `users`
690 # When `user_account_connections` is updated, we write the `account_id` back to `users`
691 [actions.down]
691 [actions.down]
692 table = "user_account_connections"
692 table = "user_account_connections"
693− value = "account_id"
693+ value = "user_account_connections.account_id"
694− where = "id = user_id"
694+ where = "users.id = user_account_connections.user_id"
696[[actions]]
696[[actions]]
697type = "remove_column"
697type = "remove_column"
@@ -701,8 +701,8 @@ column = "account_role"
701 # When `user_account_connections` is updated, we write the lowercase role back to `users`
701 # When `user_account_connections` is updated, we write the lowercase role back to `users`
702 [actions.down]
702 [actions.down]
703 table = "user_account_connections"
703 table = "user_account_connections"
704− value = "LOWER(role)"
704+ value = "LOWER(user_account_connections.role)"
705− where = "id = user_id"
705+ where = "users.id = user_account_connections.user_id"
708## Commands and options
708## Commands and options