BloomFeed Addons v0.22

This commit is contained in:
Esteban
2026-07-04 20:22:16 +02:00
parent c4d1308497
commit d58f2195f5
22 changed files with 832 additions and 7 deletions
@@ -0,0 +1,37 @@
<?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('notifiers', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->string('type'); // 'discord' | 'webhook'
$table->string('name');
$table->string('url', 2048);
$table->string('scope')->default('all'); // 'all' | 'feeds'
$table->boolean('enabled')->default(true);
$table->timestamp('last_triggered_at')->nullable();
$table->string('last_error')->nullable();
$table->timestamps();
$table->index(['user_id', 'enabled']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('notifiers');
}
};
@@ -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
{
// Table name follows Laravel's belongsToMany convention: alphabetical
// order of the two model names ("feed" < "notifier").
Schema::create('feed_notifier', function (Blueprint $table) {
$table->foreignId('notifier_id')->constrained()->cascadeOnDelete();
$table->foreignId('feed_id')->constrained()->cascadeOnDelete();
$table->primary(['notifier_id', 'feed_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('feed_notifier');
}
};