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
VIEWS
for 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:VIEWS
must always run in order to keep up to date with the newmigrations
migrations
are tracked to run only once, so not suitableVIEWS
is after the full DB schema is complete, i.e. at the end of all migrationsmigrations
filenames have a timestamp, so not suitableIn short, there are challenges in using
migrations
to create/update aVIEW
.It also does not make sense to create/update a
VIEW
in aseeder
since it is dealing with the schema after all and also requires the developer to explicitly--seed
when runningartisan migrate
every 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 migrate
andartisan migrate:fresh
that 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
views
is also used to refer toblade views
.Beta Was this translation helpful? Give feedback.
All reactions