Skip to content

Commit

Permalink
fix: older blomstra versions cannot upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
luceos committed Nov 8, 2024
1 parent f94d262 commit e0cebe5
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@
* LICENSE file that was distributed with this source code.
*/

use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;

return Migration::addColumns('gdpr_erasure', [
'cancelled_at' => ['datetime', 'nullable' => true],
]);
return [
'up' => function (Builder $schema) {
if (! $schema->hasColumn('gdpr_erasure', 'cancelled_at')) {
$schema->table('gdpr_erasure', function (Blueprint $table) {
$table->dateTime('cancelled_at')->nullable();
});
}
},
'down' => function (Builder $schema) {
if ($schema->hasColumn('gdpr_erasure', 'cancelled_at')) {
$schema->table('gdpr_erasure', function (Blueprint $table) {
$table->dropColumn('cancelled_at');
});
}
},
];

0 comments on commit e0cebe5

Please sign in to comment.