Skip to content

Commit

Permalink
Add nullable convert_unit_id column to nexopos_procurements_products …
Browse files Browse the repository at this point in the history
…table
  • Loading branch information
Blair2004 committed Jan 26, 2024
1 parent 8dd0537 commit 6162b70
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/nexopos.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* This is the core version of NexoPOS. This is used to displays on the
* dashboard and to ensure a compatibility with the modules.
*/
'version' => '5.0.2',
'version' => '5.0.3',

/**
* --------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function up()
});

Schema::table('nexopos_procurements_products', function (Blueprint $table) {
if (Schema::hasColumn('nexopos_procurements_products', 'convert_unit_id')) {
if (!Schema::hasColumn('nexopos_procurements_products', 'convert_unit_id')) {
$table->integer('convert_unit_id')->nullable();
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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
{
if (Schema::hasTable('nexopos_expenses')) {
Schema::rename('nexopos_expenses', 'nexopos_transactions');
}

if (Schema::hasTable('nexopos_expense_categories')) {
Schema::rename('nexopos_expense_categories', 'nexopos_transactions_accounts');
}

if (Schema::hasTable('nexopos_cash_flow')) {
Schema::rename('nexopos_cash_flow', 'nexopos_transactions_histories');
}
}

/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

0 comments on commit 6162b70

Please sign in to comment.