| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- 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::create('receipts_rows', function (Blueprint $table) {
- $table->id();
- $table->unsignedBigInteger('receip_id')->nullable();
- $table->foreign('receip_id')->nullable()->references('id')->on('receipts')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('causal_id');
- $table->foreign('causal_id')->nullable()->references('id')->on('causals')->onUpdate('cascade')->onDelete('cascade');
- $table->json('when')->nullable();
- $table->integer('commercial')->default(1);
- $table->decimal('amount', $precision = 8, $scale = 2);
- $table->string('note')->nullable();
- $table->softDeletes();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('receipts_rows');
- }
- };
|