From 1ef885c1a14415bc4d82afd34555d3e26c63fa97 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 26 Nov 2023 04:30:48 -0700 Subject: [PATCH] Add migration to add state and other fields to places table --- ...39_add_state_and_score_to_places_table.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 database/migrations/2023_11_26_082439_add_state_and_score_to_places_table.php diff --git a/database/migrations/2023_11_26_082439_add_state_and_score_to_places_table.php b/database/migrations/2023_11_26_082439_add_state_and_score_to_places_table.php new file mode 100644 index 000000000..d7f95aa3f --- /dev/null +++ b/database/migrations/2023_11_26_082439_add_state_and_score_to_places_table.php @@ -0,0 +1,34 @@ +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'); + }); + } +};