Welcome Guest, Not a member yet? Register   Sign In
Migrations inside composer scripts
#3

(This post was last modified: 10-16-2021, 03:23 PM by ARAmiss.)

I would like auto start migrations when "composer require ..." and "composer update". Not manual.
The composer allows to do this. For example:
https://getcomposer.org/doc/articles/scr...hp-scripts

But the command "spark migrate -all" can be called in the ROOTPATH. How can i call this from project root path?

The another way (similar to spark migrate) is to call controller method like this:
spark install index
spark update index

And this is the same question - how to call from root.



The way is to create own spark file in the package root. And then we can call it something like this:

Code:
    "scripts": {
        "post-package-install": [
            "@composer run-migrations"
        ],
        "run-migrations": [
            "@php spark -install -index"
        ]
    }


And how can we pass execution from our package spark to default /project-root-path/spark?
Reply


Messages In This Thread
Migrations inside composer scripts - by ARAmiss - 10-14-2021, 04:29 AM
RE: Migrations inside composer scripts - by ARAmiss - 10-16-2021, 03:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB