Hilal Najem
Hilal Najem

Reputation: 177

Laravel MyISAM to InnoDB migration

I have a database that my laravel applications connects to, that has MyISAM tables.

So it doesn't show foreign keys, although they are implemented.

I created this migration to fix the issue and then I altered the line 'engine' => 'InnoDB', in database.php config for this connection; but I can't see that foreign keys are fixed in the designer (phpmyadmin)

$tables = [
    'categories',
    'currencies',
    ...
];
foreach ($tables as $table) {
    DB::statement('ALTER TABLE ' . $table . ' ENGINE = InnoDB');
}

How can I fix that?

Upvotes: 0

Views: 44

Answers (0)

Related Questions