This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

hai1533
hai1533

I am having trouble figuring out how to rollback to a version of my plugin in the database. Is there a command for that? I can run october:down, but I think it'll rollback all the migrations? Thanks.

Flynsarmy
Flynsarmy

I haven't seen a down, however you can do php artisan plugin:refresh My.Plugin to go all the way down and up again. You'll need to reseed though.

hai1533
hai1533

Is there a way to rollback to a previous version in the version.yml file for a plugin?

benfreke
benfreke

No. You'll have to manually add/remove lines from the version file.

dimti
dimti

"plugin:refresh" performs full down of the plugin (i.e. fully down and up all migrations from clear list) or "plugin:refresh" performs accurate migration down from current version in database to version in yaml-file?

hpanic32253
hpanic32253

You can using: php artisan plugin:rollback {plugin name} {version}

dimti
dimti

Thank you. I try to probe it.

g.vanto67453
g.vanto67453

Being able to roll back the last migration (and reapply) like Laravel's php artisan migrate:rollback would be very handy for OctoberCMS plugins ...

(I don't always want to reapply ALL a plugin's migrations, even during development)

g.frenken68086
g.frenken68086

g.vanto67453 said:

Being able to roll back the last migration (and reapply) like Laravel's php artisan migrate:rollback would be very handy for OctoberCMS plugins ...

(I don't always want to reapply ALL a plugin's migrations, even during development)

Check out the docs on refreshing plugins: https://docs.octobercms.com/2.x/console/commands.html#refresh-plugin

You can roll back to a specific version of your plugin using php artisan plugin:refresh AuthorName.PluginName --rollback=1.0.3

g.vanto67453
g.vanto67453

g.frenken68086 said:

g.vanto67453 said:

Being able to roll back the last migration (and reapply) like Laravel's php artisan migrate:rollback would be very handy for OctoberCMS plugins ...

(I don't always want to reapply ALL a plugin's migrations, even during development)

Check out the docs on refreshing plugins: https://docs.octobercms.com/2.x/console/commands.html#refresh-plugin

You can roll back to a specific version of your plugin using php artisan plugin:refresh AuthorName.PluginName --rollback=1.0.3

Oh shucks I didn't RTFM! Thanks for this

1-10 of 10

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.