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