Skip to content

Commit 610e71c

Browse files
committed
Store more info when doing migrations.
1 parent bdb6d59 commit 610e71c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

system/Database/MigrationRunner.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ public function version(string $targetVersion, $group='default')
234234
throw new \RuntimeException(sprintf(lang('Migrations.migMissingMethod'), $method));
235235
}
236236

237-
call_user_func([$instance, $method]);
237+
$instance->{$method}();
238238

239239
$currentVersion = $number;
240-
if ($method === 'up') $this->addHistory($currentVersion, $instance->getDBGroup());
241-
elseif ($method === 'down') $this->removeHistory($currentVersion, $instance->getDBGroup());
240+
if ($method === 'up') $this->addHistory(basename($file, '.php'), $instance->getDBGroup());
241+
elseif ($method === 'down') $this->removeHistory(basename($file, '.php'), $instance->getDBGroup());
242242
}
243243
}
244244

@@ -500,17 +500,17 @@ protected function ensureTable()
500500

501501
$forge->addField([
502502
'version' => [
503-
'type' => 'BIGINT',
504-
'constraint' => 20,
503+
'type' => 'VARCHAR',
504+
'constraint' => 255,
505505
'null' => false
506506
],
507507
'group' => [
508-
'type' => 'varchar',
508+
'type' => 'VARCHAR',
509509
'constraint' => 255,
510510
'null' => false
511511
],
512512
'time' => [
513-
'type' => 'timestamp',
513+
'type' => 'TIMESTAMP',
514514
'null' => false
515515
]
516516
]);

0 commit comments

Comments
 (0)