Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
try {
if (Schema::hasColumn('users', 'radio_points')) {
DB::statement('CREATE INDEX IF NOT EXISTS users_radio_points_index ON users (radio_points)');
}
if (Schema::hasTable('radio_listener_points')) {
DB::statement('CREATE INDEX IF NOT EXISTS rlp_user_earned_index ON radio_listener_points (user_id, earned_at)');
DB::statement('CREATE INDEX IF NOT EXISTS rlp_earned_index ON radio_listener_points (earned_at)');
}
} catch (Exception $e) {
report($e);
}
}
public function down(): void
{
try {
DB::statement('DROP INDEX IF EXISTS users_radio_points_index ON users');
DB::statement('DROP INDEX IF EXISTS rlp_user_earned_index ON radio_listener_points');
DB::statement('DROP INDEX IF EXISTS rlp_earned_index ON radio_listener_points');
} catch (Exception $e) {
report($e);
}
}
};