Welcome Guest, Not a member yet? Register   Sign In
What is the proper way to abort a migration?
#1

CI 4.3.1

If, in the up() function of a migration I have some check that causes me to want to abort the migration so that the migration does not continue and does not get added to the migrations table in the database, how would I do this?

PHP Code:
public function up(): void
{
    if(
$foo !== $bar)
    {
        
//abort the migration
    
}


I would like to be able to send the error back to the Login controller so that the view can gracefully display that the migration failed.
Reply
#2

The only thing I see in the documentation is the regress command that allows going back.

Database Migration -> Class Reference -> regress

I did not see any type of abort commands.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB