avram icon indicating copy to clipboard operation
avram copied to clipboard

SchemaEnforcer doesn't know about views

Open jwoertink opened this issue 5 years ago • 7 comments

If you have a view or materialzed view, and then create a model where the table is that view, the SchemaEnforcer throws the error that the table is missing.

jwoertink avatar Jul 10 '20 21:07 jwoertink

This seems like an advanced use case but I like this as a feature.

jkthorne avatar Jul 11 '20 02:07 jkthorne

Yeah this does seem tricky, but would be cool to at least validate the view name.

Also, does the error message tell you you can use skip_schema_enforcer? If not we should definitely add that so people know how to disable it per-model

paulcsmith avatar Jul 13 '20 20:07 paulcsmith

@jwoertink Can you verify that this is fixed with https://github.com/luckyframework/avram/commit/361a9e84d4b1d3cf35346f6eb361c9388bcaccf0

matthewmcgarvey avatar Oct 19 '20 23:10 matthewmcgarvey

It might take me some time. My app won't compile with those changes, but I think it's related to something else. I'll try to get it in this week if I can.

jwoertink avatar Oct 20 '20 15:10 jwoertink

@jwoertink I believe this has been fixed. There's even a spec verifying SchemaEnforcer with a view https://github.com/luckyframework/avram/pull/555/files#diff-0bd470554a459e4fceec90dca2d35618538153443dfb87154139529eed832206R24-R27

matthewmcgarvey avatar Dec 26 '20 19:12 matthewmcgarvey

I'm sure this is probably good now. I just haven't had a chance to try it. I only use Materialzed Views though... do you think this will work on those?

jwoertink avatar Dec 28 '20 17:12 jwoertink

@jwoertink I believe so, but definitely double check

matthewmcgarvey avatar Dec 28 '20 17:12 matthewmcgarvey