Replies: 1 comment 1 reply
-
|
This is exactly the discussion I was about to create before I saw yours. I support this! I'm suggesting |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Several of my projects need to create and update
VIEWSfor computation purposes, and over time, I have become quite clear of the limitations in the framework currently.Often, I'm told to just put it in a
migration, but there are problems:VIEWSmust always run in order to keep up to date with the newmigrationsmigrationsare tracked to run only once, so not suitableVIEWSis after the full DB schema is complete, i.e. at the end of all migrationsmigrationsfilenames have a timestamp, so not suitableIn short, there are challenges in using
migrationsto create/update aVIEW.It also does not make sense to create/update a
VIEWin aseedersince it is dealing with the schema after all and also requires the developer to explicitly--seedwhen runningartisan migrateevery single time. Forgetting to do so will result in an incomplete schema.My proposal is to introduce a new section at the end of
artisan migrateandartisan migrate:freshthat runs every time. Think of it like an implicitseeder, but dealing with schema instead of data.Happy to do a PR, but probably need to decide on the naming first, since
viewsis also used to refer toblade views.Beta Was this translation helpful? Give feedback.
All reactions