|
|
|
@@ -0,0 +1,57 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
use App\Models\ReceiptIssuingOrderSeqNumber; |
|
|
|
use App\Util\MigrationHelper; |
|
|
|
use Illuminate\Database\Migrations\Migration; |
|
|
|
use Illuminate\Database\Schema\Blueprint; |
|
|
|
use Illuminate\Support\Facades\Schema; |
|
|
|
|
|
|
|
return new class extends Migration |
|
|
|
{ |
|
|
|
/** |
|
|
|
* Run the migrations. |
|
|
|
* |
|
|
|
* @return void |
|
|
|
*/ |
|
|
|
public function up() |
|
|
|
{ |
|
|
|
Schema::dropIfExists('receipt_issuing_order_seq_numbers'); |
|
|
|
|
|
|
|
Schema::table('receipt_issuing_orders', function (Blueprint $table) { |
|
|
|
$table->dropColumn("seq_number"); |
|
|
|
}); |
|
|
|
Schema::table('receipt_issuing_order_histories', function (Blueprint $table) { |
|
|
|
$table->dropColumn("seq_number"); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Reverse the migrations. |
|
|
|
* |
|
|
|
* @return void |
|
|
|
*/ |
|
|
|
public function down() |
|
|
|
{ |
|
|
|
MigrationHelper::createTable('receipt_issuing_order_seq_numbers', $this->schema()); |
|
|
|
|
|
|
|
ReceiptIssuingOrderSeqNumber::create([ |
|
|
|
ReceiptIssuingOrderSeqNumber::COL_NAME_SEQ_NUMBER => 0, |
|
|
|
]); |
|
|
|
|
|
|
|
Schema::table('receipt_issuing_orders', function (Blueprint $table) { |
|
|
|
$table->bigInteger("seq_number", false, true)->nullable()->comment("通番"); |
|
|
|
}); |
|
|
|
Schema::table('receipt_issuing_order_histories', function (Blueprint $table) { |
|
|
|
$table->bigInteger("seq_number", false, true)->nullable()->comment("通番"); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private function schema() |
|
|
|
{ |
|
|
|
|
|
|
|
return function (Blueprint $table, MigrationHelper $helper) { |
|
|
|
$helper->baseColumn(); |
|
|
|
$table->string('seq_number')->comment("通番"); |
|
|
|
}; |
|
|
|
} |
|
|
|
}; |