Gutschriften

This commit is contained in:
Kevin Adametz 2021-04-23 14:52:25 +02:00
parent 35ae3da244
commit 6ac9fcc4d2
20 changed files with 510 additions and 63 deletions

View file

@ -34,6 +34,8 @@ class CreateShoppingOrderMarginsTable extends Migration
$table->timestamp('partner_commission_pending_to')->nullable();
$table->boolean('partner_commission_paid')->default(false);
$table->unsignedBigInteger('user_credit_id')->nullable();
$table->text('content')->nullable();

View file

@ -0,0 +1,52 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserPayCreditsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_pay_credits', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('user_id');
$table->decimal('credit', 13, 2)->nullable();
$table->decimal('old_credit_total', 13, 2)->nullable();
$table->decimal('new_credit_total', 13, 2)->nullable();
$table->text('message')->nullable();
$table->unsignedTinyInteger('status')->index()->default(0);
$table->unsignedInteger('shopping_order_id')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_pay_credits');
}
}