Closed MrJico closed 10 months ago
Note : foreign key constraints in db, cascade setting are planned in the roadmap found here roadmap
Thanks for filing. I'm going to edit the title to be more specific about what exactly doesn't get generated.
I think Database schema generation doesn't create relations
would be a better name for the issue
See https://github.com/Electron100/butane/issues/166 for the next part of this - cascading the delete.
First, I would like to thank you for this beautifull 😍project😍.
so i oppened this issue becuase i have tested this crate on two diffrent setups and both with backends(sqllite, pg). but the generated sql code for the relations is ether completly broken or there is something wrong with my setup.
basicly i copy pasted the getting started page and made the migrations. which in theory should generate all the necessary sql code for the relation ships. but it does not.
here is an example of the sql output: ⬇️
and here in this image visualized with dbeaver:![image](https://user-images.githubusercontent.com/63163262/209447812-57965033-7c64-4556-b62e-c56598c726ff.png)
yet there are not relations(foreign keys, reffrences) generated for the tables.
here an example of what the generated sql code should be: ⬇️
and in this image visualized with dbeaver:
please keep in mind that in the example above i have not included any constraints or onupdate and ondelete and they are not generated ether.
P.S: for the example out put above,
butane
is version0.5.0
and featuresdefault
andpg
are enabled.