I'm having issues adding a Foreign Key to link 2 existing tables together. Table A
has data, and I need it to reference Table B
(which also has data).
I will need to insert a row (or rows) into Table B
which Table A
will reference.
In this case it is acceptable to insert a row into Table B
and then use that as the default value for the migration. That would require that I know the ID of the row that I'm inserting.
I think that I can handle everything except figuring out the ID of the row that I insert into Table B
.
Is it possible to return data inside of Migrations?