lulco/phoenix

Dump Views turn into tables

Closed this issue · 2 comments

When using the dump command, Views in the MySQL database turn into tables in the dump file. I'm not sure what is a good fix for this.

I personally modified the dump file to create views through straight SQL, and I don't expect that this library needs to create views.

Maybe a note of this somewhere would be nice? My ideal behavior would be that the dump command would skip the views and leave a warning for every view not converted so that the end user could handle however they like.

Last issue, I promise :)

lulco commented

Hi :) no worry, if you find issue I can fix quickly it's my pleasure. I am happy somebody uses Phoenix and if it helps.

I don't use views personally, so I need to study something about them. How it works in mysql and also in pgsql. Then I can design something and implement it. I would be happy if it could be some structural way like creating tables is, not just plain queries because they are different in mysql vs pgsql. Dump command was created as a tool for dumping existing structure but also as a tool for migrating from one db engine to another.

So for now we can just add some note to dump command docs. Would you prepare PR?

lulco commented

I've created PR with skipping VIEWs and SYSTEM VIEWs in dump command. Unfortunately I can't provide notice for them in dump file, because I don't load them anymore. But I've created separated issue for views #248