mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +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 [
|
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");
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user