Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
sangnguyenplus committed Feb 6, 2025
1 parent e1bd23e commit d9864b9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
return new class () extends Migration {
public function up(): void
{
if (Schema::hasTable('fob_ticket_categories')) {
return;
}

Schema::create('fob_ticket_categories', function (Blueprint $table) {
$table->id();
$table->string('name');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
return new class () extends Migration {
public function up(): void
{
if (Schema::hasTable('fob_tickets')) {
return;
}

Schema::create('fob_tickets', function (Blueprint $table) {
$table->id();
$table->foreignId('category_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
return new class () extends Migration {
public function up(): void
{
if (Schema::hasTable('fob_ticket_messages')) {
return;
}

Schema::create('fob_ticket_messages', function (Blueprint $table) {
$table->id();
$table->morphs('sender');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
return new class () extends Migration {
public function up(): void
{
if (! Schema::hasColumn('fob_tickets', 'category_id')) {
return;
}

Schema::table('fob_tickets', function (Blueprint $table) {
$table->foreignId('category_id')->nullable()->change();
});
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"provider": "FriendsOfBotble\\Ticksify\\Providers\\TicksifyServiceProvider",
"author": "Friends Of Botble",
"url": "https://friendsofbotble.com",
"version": "1.0.1",
"version": "1.0.2",
"description": "Easily to manage and organize your customer support tickets.",
"minimum_core_version": "7.3.0"
}
1 change: 0 additions & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Plugin extends PluginOperationAbstract
public static function remove(): void
{
Schema::dropIfExists('fob_ticket_messages');
Schema::dropIfExists('fob_ticket_category');
Schema::dropIfExists('fob_tickets');
Schema::dropIfExists('fob_ticket_categories');
}
Expand Down

0 comments on commit d9864b9

Please sign in to comment.