summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorgrothedev <grothedev@gmail.com>2026-03-06 11:14:32 -0600
committergrothedev <grothedev@gmail.com>2026-03-06 11:14:32 -0600
commit11e296dc247d2f7d15fe677c0b1b3be659cc135d (patch)
tree9d2ee95dfc064f7c348f33ffe462cd71957303ac /database
parent4e4827e9f5ef58085e032a88276dc8ae2b4462b0 (diff)
clean up unused stuff. though i want to hold on to the idea i was working with
Diffstat (limited to 'database')
-rw-r--r--database/migrations/2025_01_04_021047_inventory.php24
-rw-r--r--database/migrations/2025_01_04_021054_transaction.php24
-rw-r--r--database/migrations/2025_01_04_021120_item.php24
-rw-r--r--database/migrations/2026_03_06_171040_fix_links_table_description_nullable_and_fk.php50
4 files changed, 50 insertions, 72 deletions
diff --git a/database/migrations/2025_01_04_021047_inventory.php b/database/migrations/2025_01_04_021047_inventory.php
deleted file mode 100644
index 88fa2f3..0000000
--- a/database/migrations/2025_01_04_021047_inventory.php
+++ /dev/null
@@ -1,24 +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
- {
- //
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- //
- }
-};
diff --git a/database/migrations/2025_01_04_021054_transaction.php b/database/migrations/2025_01_04_021054_transaction.php
deleted file mode 100644
index 88fa2f3..0000000
--- a/database/migrations/2025_01_04_021054_transaction.php
+++ /dev/null
@@ -1,24 +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
- {
- //
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- //
- }
-};
diff --git a/database/migrations/2025_01_04_021120_item.php b/database/migrations/2025_01_04_021120_item.php
deleted file mode 100644
index 88fa2f3..0000000
--- a/database/migrations/2025_01_04_021120_item.php
+++ /dev/null
@@ -1,24 +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
- {
- //
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- //
- }
-};
diff --git a/database/migrations/2026_03_06_171040_fix_links_table_description_nullable_and_fk.php b/database/migrations/2026_03_06_171040_fix_links_table_description_nullable_and_fk.php
new file mode 100644
index 0000000..9787a5d
--- /dev/null
+++ b/database/migrations/2026_03_06_171040_fix_links_table_description_nullable_and_fk.php
@@ -0,0 +1,50 @@
+<?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('links', function (Blueprint $table) {
+ // Make description nullable (was NOT NULL)
+ $table->string('description')->nullable()->change();
+
+ // Fix user_id column type to match users.id (bigint unsigned)
+ $table->unsignedBigInteger('user_id')->nullable()->change();
+ });
+
+ // Add proper foreign key constraint if it doesn't exist
+ try {
+ Schema::table('links', function (Blueprint $table) {
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ });
+ } catch (\Exception $e) {
+ // FK may already exist
+ }
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ try {
+ Schema::table('links', function (Blueprint $table) {
+ $table->dropForeign(['user_id']);
+ });
+ } catch (\Exception $e) {
+ // FK may not exist
+ }
+
+ Schema::table('links', function (Blueprint $table) {
+ $table->string('description')->nullable(false)->change();
+ $table->integer('user_id')->change();
+ });
+ }
+};