Skip to content

migrations generated by devtools cannot be reimported #1219

Closed
@loeken

Description

@loeken

Expected and Actual Behavior

I have a few tables with foreign key relations I export them using the migration function, i then clear the database and try reimporing those generated migration files

Provide output if related

An unexpected error has occurred. SQLSTATE[HY000]: General error: 1005 Can't create table databasename.tablename (errno: 150 "Foreign key constraint is incorrectly formed")

Details

lets say i have a "blogpost" and a "user" table. and blogpost(user_id) references user(id)

From what i can see the devtools use alphabetical order and would start importing "blogpost", which fails because the user table doesnt exist yet.

For the commandline i could use --table user,blogpost to force the order

Ideally i would like to use the webtools to jump between database versions when working on different branches.

I am not sure if its a bug ( to my understanding when you export something you should be able import that in the same software without any issues ) or if that is expected behavior

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions