CodeIgniter Forums
Config/Migrations: default enabled/disabled confusion - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Config/Migrations: default enabled/disabled confusion (/showthread.php?tid=76047)



Config/Migrations: default enabled/disabled confusion - bivanbi - 04-09-2020

Good day,

I am doing an upgrade from 4.0.0-alpha2  to 4.0.2, and I am honestly confused here:
app/Config/Migrations.php: 
4.0.0-alpha2:
Code:
    /*
    |--------------------------------------------------------------------------
    | Enable/Disable Migrations
    |--------------------------------------------------------------------------
    |
    | Migrations are disabled by default for security reasons.
    | You should enable migrations whenever you intend to do a schema migration
    | and disable it back when you're done.
    |
    */
    public $enabled = false;


4.0.2:
Code:
    /*
    |--------------------------------------------------------------------------
    | Enable/Disable Migrations
    |--------------------------------------------------------------------------
    |
    | Migrations are enabled by default for security reasons.
    | You should enable migrations whenever you intend to do a schema migration
    | and disable it back when you're done.
    |
    */
    public $enabled = true;

First, release version is doing the absolute opposite than before. And what confuses me even more, 4.0.2 has this in the description: "enabled by default for security reasons" vs. "enable whenever you intend to do a schema migration and disable it back when you're done"

Could somebody please explain the best course of actions? So it should be enabled by default, do whatever migration by default, and then disable it and keep it disabled unless doing migration?

Thanks!


RE: Config/Migrations: default enabled/disabled confusion - includebeer - 04-10-2020

Lonnie changed the default value to "true" in this commit Migrations should be enabled by default to remove a frustration of getting started.

I think the comment in the configuration file should be improved for more clarity, because it is confusing!


RE: Config/Migrations: default enabled/disabled confusion - kilishan - 04-10-2020

Yes, looks like I missed changing the comment out. But things should be expected to change from a beta to a final release. Smile


RE: Config/Migrations: default enabled/disabled confusion - includebeer - 04-10-2020

Yes it's totally fine if things change. For my part, what I find confusing is the part where it says "enabled by default for security reasons". It should probably be something more like "enabled by default for your convenience".


RE: Config/Migrations: default enabled/disabled confusion - bivanbi - 04-10-2020

Thanks for the clarification! So in the end, it should be kept disabled most of the time, except when actually doing DB migrations.