New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support views in migrations #1805
Comments
Definitely want that, I have a few view's in my system right now but I setup and tear them down via SQL. |
Will be keeping an eye on this. The frontend to one of our biggest apps relies fairly heavily on views, would be very nice to manage them natively |
What about materialized views? |
@joshuataylor we can support a |
can i work on this one? |
Yes, please! |
I was just thinking about introducing it by myself. What would be useful with this one is:
As it would allow us to create additional things that would be useful with views. |
We should carefully consider if we're able in any way to provide something more usable than create function("""
some sql
""") and I'm not sure I see advantage over execute """
CREATE FUNCTION some sql
""" |
@michalmuskala there is one: autocreate |
Hi, I want to start contributing to Ecto (and Elixir in general) and I was about to suggest this feature. Is anyone working on it? Is it still in discussion? I am new to open source projects so forgive me if I don't understand part of the workflow on this. Thanks! |
I don't think there is someone working on it right now. If you want to start contributing on this area, maybe #1832 is a better starting point, for you to get acquainted with the codebase. :) |
@josevalim Nice, I will try that. Tks |
We have stepped down from this feature because using Ecto.Query to generate views had unwarranted side-effects. A discussion of other approaches, which could be encapsulated in helpers that will be part of future Ecto versions, can be found in #1805. |
Sooo, currently the only way is still |
@KristerV you can use |
Yeah I realized, that your migrations need to be static (and not connected to any schemas or anything), so best is raw strings anyway. For future lurkers :) |
The idea is to introduce functions called
view/1
andview/2
such that:create
requires a query to be given to the view,drop
does not.We will also introduce a
create_or_replace/1
function, similar tocreate/1
, but mean to be used with views.The text was updated successfully, but these errors were encountered: