Add migration to add state and other fields to places table

This commit is contained in:
Daniel Supernault 2023-11-26 04:30:48 -07:00
parent b0e8810a91
commit 1ef885c1a1
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -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');
});
}
};