This commit is contained in:
salam committed 2026-02-05 18:48:51 +01:00
1 parent b0a002c7c1
commit 23cf804865
23 files changed
+283 -123

No files matched your search

@@ -0,0 +1,33 @@
<?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
{
Schema::create('personal_notifications', function (Blueprint $table) {
$table->id();
$table->integer('user_id')->index()->references('id')->on('users');
$table->integer('sport_id')->index()->references('id')->on('sports');
$table->integer('bookmaker_id')->index()->references('id')->on('bookmakers');
$table->integer('alarm_level_id')->default(0);
$table->boolean('notify_by_system')->default(false);
$table->boolean('notify_by_email')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_notifications');
}
};
@@ -11,16 +11,12 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('event_user_notifications', function (Blueprint $table) {
Schema::create('personal_notification_sends', function (Blueprint $table) {
$table->id();
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
$table->integer('bookmaker_id')->default(0);
$table->integer('user_id')->index()->references('id')->on('users');
$table->integer('odds_table_id')->index()->references('id')->on('odds_tables');
$table->integer('bookmaker_id')->index()->references('id')->on('bookmakers');
$table->integer('alarm_level_id')->default(0);
$table->boolean('notify_by_email')->default(false);
$table->boolean('deleted')->default(false);
$table->boolean('is_notified')->default(false);
$table->timestamps();
});
}
@@ -30,6 +26,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('event_user_notifications');
Schema::dropIfExists('personal_notification_sends');
}
};
@@ -0,0 +1,30 @@
<?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
{
Schema::create('alarm_levels', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('color');
$table->decimal('default_threshold', 3, 2)->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('alarm_levels');
}
};
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class AlarmLevelSeeder extends Seeder
{
public function run(): void
{
/**
* Clients
*/
$sql = "INSERT INTO `alarm_levels` (`id`, `name`, `color`, `default_threshold`, `created_at`, `updated_at`)
VALUES
(1, 'LEVEL 1', 'info', 0.01, NULL, NULL),
(2, 'LEVEL 2', 'warning', 0.20, NULL, NULL),
(3, 'LEVEL 3', 'danger', 0.30, NULL, NULL);
";
DB::unprepared($sql);
}
}
+1
View File
@@ -24,6 +24,7 @@ class DatabaseSeeder extends Seeder
TxoddsMarketsSeeder::class,
CountryItalianSeeder::class,
OddsTableSeeder::class,
AlarmLevelSeeder::class,
]);
}
}