Skip to content

A self-hosted media server and file management system

migrations

aminnausin895f4b45c172
diff --git a/database/migrations/2024_02_10_212124_create_folders_table.php b/database/migrations/2024_02_10_212124_create_folders_table.php
index 82a4383b..7627bd5f 100644
--- a/database/migrations/2024_02_10_212124_create_folders_table.php
+++ b/database/migrations/2024_02_10_212124_create_folders_table.php
@@ -13,9 +13,9 @@ return new class extends Migration
{
Schema::create('folders', function (Blueprint $table) {
$table->id();
+ $table->unsignedBigInteger('category_id');
$table->string('name');
$table->string('path')->unique();
- $table->foreignId('category_id')->constrained();
$table->foreign('category_id')
->references('id')
->on('categories')
diff --git a/database/migrations/2024_02_10_212508_create_videos_table.php b/database/migrations/2024_02_10_212508_create_videos_table.php
index 6504a491..ad09b975 100644
--- a/database/migrations/2024_02_10_212508_create_videos_table.php
+++ b/database/migrations/2024_02_10_212508_create_videos_table.php
@@ -13,6 +13,7 @@ return new class extends Migration
{
Schema::create('videos', function (Blueprint $table) {
$table->id();
+ $table->unsignedBigInteger('folder_id');
$table->string('name');
$table->string('path')->unique();
$table->string('date');
diff --git a/database/migrations/2024_02_27_183528_create_records_table.php b/database/migrations/2024_02_27_183528_create_records_table.php
index f8029b8f..830c3a18 100644
--- a/database/migrations/2024_02_27_183528_create_records_table.php
+++ b/database/migrations/2024_02_27_183528_create_records_table.php
@@ -18,12 +18,13 @@ return new class extends Migration
$table->foreign('user_id')
->references('id')
->on('users')
- ->onDelete('cascade');
+ ->cascadeOnDelete();
$table->foreign('video_id')
+ ->nullable()
->references('id')
->on('videos')
- ->nullable()
- ->onDelete('set null');
+ ->nullOnDelete();
+ $table->string('video_title')->nullable()->default(null);
$table->timestamps();
});
}
diff --git a/database/migrations/2024_07_03_040909_cascade_videos.php b/database/migrations/2024_07_03_040909_cascade_videos.php
deleted file mode 100644
index b02eca3f..00000000
--- a/database/migrations/2024_07_03_040909_cascade_videos.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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('videos', function (Blueprint $table) {
- //
- });
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::table('videos', function (Blueprint $table) {
- //
- });
- }
-};
diff --git a/database/migrations/2024_07_03_040919_cascade_folders.php b/database/migrations/2024_07_03_040919_cascade_folders.php
deleted file mode 100644
index 92faa0db..00000000
--- a/database/migrations/2024_07_03_040919_cascade_folders.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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('folders', function (Blueprint $table) {
- $table->foreign('category_id')
- ->references('id')
- ->on('categories')
- ->onDelete('cascade')
- ->change();
- });
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::table('folders', function (Blueprint $table) {
- //
- });
- }
-};
diff --git a/database/migrations/2024_07_03_040938_nullable_records.php b/database/migrations/2024_07_03_040938_nullable_records.php
deleted file mode 100644
index 47f53fd2..00000000
--- a/database/migrations/2024_07_03_040938_nullable_records.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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('records', function (Blueprint $table) {
- //
- });
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::table('records', function (Blueprint $table) {
- //
- });
- }
-};
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php
index 21dce038..ea5c49a4 100644
--- a/resources/views/auth/register.blade.php
+++ b/resources/views/auth/register.blade.php
@@ -43,7 +43,7 @@
</div>
<div class="flex items-center justify-end mt-4">
- <a class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800" href="http://127.0.0.1:8000/login">
+ <a class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800" href="/login">
Already registered?
</a>