From e3bb4d2f1ce9c7f61f49dc2e09446ebd8dfd023e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= <hello@iamgergo.com>
Date: Tue, 24 Sep 2024 20:57:58 +0200
Subject: [PATCH] wip

---
 ...1_000400_create_bazar_categories_table.php |  1 +
 ...10_182923_alter_bazar_categories_table.php | 30 -------------------
 ...28_082227_create_bazar_tax_rates_table.php |  1 +
 3 files changed, 2 insertions(+), 30 deletions(-)
 delete mode 100644 database/migrations/2024_04_10_182923_alter_bazar_categories_table.php

diff --git a/database/migrations/2020_01_01_000400_create_bazar_categories_table.php b/database/migrations/2020_01_01_000400_create_bazar_categories_table.php
index 3d78b873..ee137f40 100644
--- a/database/migrations/2020_01_01_000400_create_bazar_categories_table.php
+++ b/database/migrations/2020_01_01_000400_create_bazar_categories_table.php
@@ -13,6 +13,7 @@ public function up(): void
     {
         Schema::create('bazar_categories', static function (Blueprint $table): void {
             $table->id();
+            $table->foreignId('parent_id')->nullable()->constrained('bazar_categories')->nullOnDelete();
             $table->string('name');
             $table->string('slug')->unique();
             $table->text('description')->nullable();
diff --git a/database/migrations/2024_04_10_182923_alter_bazar_categories_table.php b/database/migrations/2024_04_10_182923_alter_bazar_categories_table.php
deleted file mode 100644
index 47e6f518..00000000
--- a/database/migrations/2024_04_10_182923_alter_bazar_categories_table.php
+++ /dev/null
@@ -1,30 +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('bazar_categories', static function (Blueprint $table): void {
-            $table->after('id', static function (Blueprint $table): void {
-                $table->foreignId('parent_id')->nullable()->constrained('bazar_categories')->nullOnDelete();
-            });
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     */
-    public function down(): void
-    {
-        Schema::table('bazar_categories', static function (Blueprint $table): void {
-            $table->dropColumn('parent_id');
-        });
-    }
-};
diff --git a/database/migrations/2024_07_28_082227_create_bazar_tax_rates_table.php b/database/migrations/2024_07_28_082227_create_bazar_tax_rates_table.php
index 6c583cb1..411b8f92 100644
--- a/database/migrations/2024_07_28_082227_create_bazar_tax_rates_table.php
+++ b/database/migrations/2024_07_28_082227_create_bazar_tax_rates_table.php
@@ -13,6 +13,7 @@ public function up(): void
     {
         Schema::create('bazar_tax_rates', static function (Blueprint $table): void {
             $table->id();
+            $table->string('name');
             $table->integer('value')->unsigned();
             $table->boolean('shipping')->default(false);
             $table->timestamps();