Fix migration table naming and migrate:commit exit code

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-19 22:56:36 +00:00
parent 2fdf0ab9be
commit c8d87f47b7
116 changed files with 90 additions and 77 deletions

View File

@@ -508,16 +508,18 @@ class Maint_Migrate extends Command
{
try {
// Try to query the migrations table
DB::select('SELECT 1 FROM migrations LIMIT 1');
$table = config('database.migrations', 'migrations');
DB::select("SELECT 1 FROM {$table} LIMIT 1");
} catch (\Exception $e) {
// Table doesn't exist, create it
$table = config('database.migrations', 'migrations');
$this->info('Creating migrations table...');
DB::statement("
CREATE TABLE IF NOT EXISTS migrations (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
migration VARCHAR(255) NOT NULL,
batch INT NOT NULL
CREATE TABLE IF NOT EXISTS {$table} (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
migration VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
batch BIGINT NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
");