Skip to content

A self-hosted media server and file management system

fix: date_scanned exists as extra on metadata table

aminnausin7675cce143ae
diff --git a/database/migrations/2026_01_28_041925_remove_date_scanned_from_metadata.php b/database/migrations/2026_01_28_041925_remove_date_scanned_from_metadata.php
new file mode 100644
index 00000000..b8a5633e
--- /dev/null
+++ b/database/migrations/2026_01_28_041925_remove_date_scanned_from_metadata.php
@@ -0,0 +1,28 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration {
+ /**
+ * Run the migrations.
+ */
+ public function up(): void {
+ Schema::table('metadata', function (Blueprint $table) {
+ $table->dropColumn("date_scanned");
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void {
+ Schema::table('metadata', function (Blueprint $table) {
+ $table->date("date_scanned")->nullable();
+ });
+
+ DB::table('metadata')->whereNotNull('file_scanned_at')->update(['date_scanned' => DB::raw('DATE(file_scanned_at)')]);
+ }
+};