Phase 6 (Teil 1): Dokumente und Organigramm
- Dokumente-Plugin: Ordnerbaum mit vererbten Rechten und Sichtbarkeit, Hochladen per Ziehen und Ablegen, Versionen, Suche, Pagebuilder-Block - Organigramm aus den Vorgesetzten, Vorgesetzte im Admin pflegbar - Personensuche im Kopf übernimmt nur noch Suchbegriffe des Verzeichnisses Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
21c706e5f5
commit
d6d5d4b0fe
110 changed files with 2209 additions and 208 deletions
|
|
@ -0,0 +1,60 @@
|
|||
<?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('document_folders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('parent_id')->nullable()->constrained('document_folders')->restrictOnDelete();
|
||||
$table->string('name');
|
||||
$table->string('description', 500)->nullable();
|
||||
$table->unsignedInteger('sort')->default(0);
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['parent_id', 'sort']);
|
||||
});
|
||||
|
||||
Schema::create('documents', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('folder_id')->constrained('document_folders')->restrictOnDelete();
|
||||
$table->string('title');
|
||||
$table->text('description')->nullable();
|
||||
// Aktuelle Fassung; ältere bleiben in document_versions abrufbar.
|
||||
$table->unsignedBigInteger('current_version_id')->nullable();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['folder_id', 'title']);
|
||||
});
|
||||
|
||||
Schema::create('document_versions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('document_id')->constrained('documents')->cascadeOnDelete();
|
||||
$table->unsignedInteger('version');
|
||||
$table->string('name');
|
||||
$table->string('path');
|
||||
$table->string('mime', 150)->nullable();
|
||||
$table->unsignedBigInteger('size')->default(0);
|
||||
$table->string('note', 500)->nullable();
|
||||
$table->foreignId('uploaded_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('created_at')->nullable();
|
||||
|
||||
$table->unique(['document_id', 'version']);
|
||||
$table->index('name');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('document_versions');
|
||||
Schema::dropIfExists('documents');
|
||||
Schema::dropIfExists('document_folders');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue