mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 07:33:36 +08:00
Change TIMESTAMP columns to DATETIME manually
This commit is contained in:
parent
a13175600f
commit
fdcb78a48c
|
@ -14,14 +14,15 @@ use Illuminate\Database\Schema\Builder;
|
|||
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->table('registration_tokens', function (Blueprint $table) {
|
||||
$table->dateTime('created_at')->change();
|
||||
});
|
||||
// do this manually because dbal doesn't recognize timestamp columns
|
||||
$connection = $schema->getConnection();
|
||||
$prefix = $connection->getTablePrefix();
|
||||
$connection->statement("ALTER TABLE {$prefix}registration_tokens MODIFY created_at DATETIME");
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('registration_tokens', function (Blueprint $table) {
|
||||
$table->timestamp('created_at')->change();
|
||||
});
|
||||
$connection = $schema->getConnection();
|
||||
$prefix = $connection->getTablePrefix();
|
||||
$connection->statement("ALTER TABLE {$prefix}registration_tokens MODIFY created_at TIMESTAMP");
|
||||
}
|
||||
];
|
||||
|
|
|
@ -14,14 +14,15 @@ use Illuminate\Database\Schema\Builder;
|
|||
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->table('email_tokens', function (Blueprint $table) {
|
||||
$table->dateTime('created_at')->change();
|
||||
});
|
||||
// do this manually because dbal doesn't recognize timestamp columns
|
||||
$connection = $schema->getConnection();
|
||||
$prefix = $connection->getTablePrefix();
|
||||
$connection->statement("ALTER TABLE {$prefix}email_tokens MODIFY created_at DATETIME");
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('email_tokens', function (Blueprint $table) {
|
||||
$table->timestamp('created_at')->change();
|
||||
});
|
||||
$connection = $schema->getConnection();
|
||||
$prefix = $connection->getTablePrefix();
|
||||
$connection->statement("ALTER TABLE {$prefix}email_tokens MODIFY created_at TIMESTAMP");
|
||||
}
|
||||
];
|
||||
|
|
|
@ -14,14 +14,15 @@ use Illuminate\Database\Schema\Builder;
|
|||
|
||||
return [
|
||||
'up' => function (Builder $schema) {
|
||||
$schema->table('password_tokens', function (Blueprint $table) {
|
||||
$table->dateTime('created_at')->change();
|
||||
});
|
||||
// do this manually because dbal doesn't recognize timestamp columns
|
||||
$connection = $schema->getConnection();
|
||||
$prefix = $connection->getTablePrefix();
|
||||
$connection->statement("ALTER TABLE {$prefix}password_tokens MODIFY created_at DATETIME");
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('password_tokens', function (Blueprint $table) {
|
||||
$table->timestamp('created_at')->change();
|
||||
});
|
||||
$connection = $schema->getConnection();
|
||||
$prefix = $connection->getTablePrefix();
|
||||
$connection->statement("ALTER TABLE {$prefix}password_tokens MODIFY created_at TIMESTAMP");
|
||||
}
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue
Block a user