diff --git a/database/migrations/2025_04_05_195221_create_pages_table.php b/database/migrations/2025_04_05_195221_create_pages_table.php new file mode 100644 index 0000000..1b596bb --- /dev/null +++ b/database/migrations/2025_04_05_195221_create_pages_table.php @@ -0,0 +1,35 @@ +id(); + $table->foreignId('user_id')->constrained()->onDelete('cascade'); + $table->string('uuid')->unique(); + $table->string('title'); + $table->string('slug'); + $table->json('content'); + $table->boolean('is_published')->default(false); + $table->boolean('main')->default(false); + $table->boolean('linked')->default(false); + $table->integer('linkorder')->default(0); + $table->enum('visibility', ['public', 'private'])->default('public'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void { + Schema::dropIfExists('pages'); + } +}; diff --git a/database/migrations/2025_04_05_201915_create_page_revisions_table.php b/database/migrations/2025_04_05_201915_create_page_revisions_table.php new file mode 100644 index 0000000..a3c822b --- /dev/null +++ b/database/migrations/2025_04_05_201915_create_page_revisions_table.php @@ -0,0 +1,34 @@ +id(); + $table->foreignId('page_id')->constrained()->onDelete('cascade'); + $table->foreignId('user_id')->nullable()->constrained()->nullOnDelete(); + $table->string('uuid')->unique(); + $table->unsignedInteger('version'); + $table->json('content'); + $table->string('title'); + $table->string('slug'); + $table->enum('label', ['auto-save', 'manual-save', 'published', 'restored'])->default('manual-save'); + $table->boolean('active')->default(false); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void { + Schema::dropIfExists('page_revisions'); + } +};