Umfragen-Plugin (0.32.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 5m33s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 5m25s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 6m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m54s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m9s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m55s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m12s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 1m26s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m52s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 5m33s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 5m25s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 6m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m54s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m9s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m55s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m12s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 1m26s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m52s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
08953d52cb
commit
3f67fde50b
153 changed files with 2075 additions and 329 deletions
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('polls', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->text('description')->nullable();
|
||||
$table->json('questions');
|
||||
$table->boolean('anonymous')->default(false);
|
||||
// after_vote | after_end | editors
|
||||
$table->string('results_visibility', 20)->default('after_vote');
|
||||
$table->timestamp('published_at')->nullable();
|
||||
$table->timestamp('closes_at')->nullable();
|
||||
$table->timestamp('announced_at')->nullable();
|
||||
$table->boolean('announce')->default(false);
|
||||
$table->foreignId('author_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['published_at', 'closes_at']);
|
||||
});
|
||||
|
||||
// Anonyme Umfragen: keine Person, nur ein nicht umkehrbarer Schlüssel gegen doppelte Stimmen
|
||||
// und nur das Datum (keine Uhrzeit, die sich mit Protokollen abgleichen ließe).
|
||||
Schema::create('poll_responses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('poll_id')->constrained('polls')->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->char('voter', 64);
|
||||
$table->json('answers');
|
||||
$table->date('submitted_on');
|
||||
|
||||
$table->unique(['poll_id', 'voter']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('poll_responses');
|
||||
Schema::dropIfExists('polls');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue