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


Messages In This Thread
What is the proper way to abort a migration? - by objecttothis - 02-21-2023, 05:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB