James Cole
2025-10-25 11:50:34 +02:00
parent 535e5e4f50
commit 0bdb4f2e69

View File

@@ -11,6 +11,7 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
if (!Schema::hasTable('period_statistics')) {
Schema::create('period_statistics', function (Blueprint $table) { Schema::create('period_statistics', function (Blueprint $table) {
$table->id(); $table->id();
$table->timestamps(); $table->timestamps();
@@ -34,12 +35,13 @@ return new class extends Migration
$table->string('start_tz', 50)->nullable(); $table->string('start_tz', 50)->nullable();
$table->dateTime('end')->nullable(); $table->dateTime('end')->nullable();
$table->string('end_tz', 50)->nullable(); $table->string('end_tz', 50)->nullable();
$table->string('type',255); $table->string('type', 255);
$table->integer('count', false, true)->default(0); $table->integer('count', false, true)->default(0);
$table->decimal('amount', 32, 12); $table->decimal('amount', 32, 12);
$table->foreign('user_group_id')->references('id')->on('user_groups')->onDelete('cascade'); $table->foreign('user_group_id')->references('id')->on('user_groups')->onDelete('cascade');
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.