mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Add migration to add state and other fields to places table
This commit is contained in:
parent
b0e8810a91
commit
1ef885c1a1
1 changed files with 34 additions and 0 deletions
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('places', function (Blueprint $table) {
|
||||||
|
$table->string('state')->nullable()->index()->after('name');
|
||||||
|
$table->tinyInteger('score')->default(0)->index()->after('long');
|
||||||
|
$table->unsignedBigInteger('cached_post_count')->nullable();
|
||||||
|
$table->timestamp('last_checked_at')->nullable()->index();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('places', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('state');
|
||||||
|
$table->dropColumn('score');
|
||||||
|
$table->dropColumn('cached_post_count');
|
||||||
|
$table->dropColumn('last_checked_at');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue