You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following scenario:
In a table users, I have an address but due to business requirements, a user should be able to enter multiple addresses. So I would like to do a migration that:
Creates a new table (address) and initialize the columns
Each address has a foreign key constraint referencing the user's id
The current address in the user table should be moved to the new table
Is this possible with pgroll without using plain SQL migrations?
The text was updated successfully, but these errors were encountered:
Thanks @andrew-farries. So maybe it would be sufficient for now, to extend the docs for raw SQL migrations.
It's not clear to me, how this is supposed to work. My thought is, that I need 2 migrations to achieve this, because the docs says a SQL migration cannot run along with other migrations:
Create the new table with constraints etc. (could be done with a regular pgroll migration)
Define up and down migrations via raw SQL migration (e.g. copy data from the old table to the new table etc)
I would expect that pgroll then will take care of creating the new schema, copying data and create triggers, is this correct?
I have the following scenario:
In a table users, I have an address but due to business requirements, a user should be able to enter multiple addresses. So I would like to do a migration that:
Is this possible with pgroll without using plain SQL migrations?
The text was updated successfully, but these errors were encountered: