-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Merged migrations file into one, use and setup tiptap editor
- Loading branch information
1 parent
70e5c9c
commit bac058d
Showing
20 changed files
with
1,157 additions
and
874 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
database/migrations/2024_04_10_000005_create_ngeblog_tables.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?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('ngeblog_posts', function (Blueprint $table) { | ||
$table->id(); | ||
$table->foreignId('author_id') | ||
->nullable() | ||
->constrained('users') | ||
->nullOnDelete(); | ||
$table->string('title'); | ||
$table->string('slug')->unique(); | ||
$table->boolean('is_visible')->default(false); | ||
$table->string('content_type')->default('richtext'); | ||
$table->string('cover_image_path')->nullable(); | ||
$table->timestamp('first_published_at')->nullable(); | ||
$table->timestamp('schedule_publish_at')->nullable(); | ||
$table->text('excerpt')->nullable(); | ||
$table->longText('content'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
|
||
Schema::create('ngeblog_tags', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('title'); | ||
$table->string('slug')->unique(); | ||
$table->boolean('is_visible')->default(false); | ||
$table->text('description')->nullable(); | ||
$table->timestamps(); | ||
}); | ||
|
||
Schema::create('ngeblog_post_tag', function (Blueprint $table) { | ||
$table->id(); | ||
$table->foreignId('post_id')->constrained('ngeblog_posts')->cascadeOnDelete(); | ||
$table->foreignId('tag_id')->constrained('ngeblog_tags')->cascadeOnDelete(); | ||
$table->timestamps(); | ||
|
||
$table->unique(['post_id', 'tag_id']); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('ngeblog_posts'); | ||
Schema::dropIfExists('ngeblog_tags'); | ||
Schema::dropIfExists('ngeblog_post_tag'); | ||
} | ||
}; |
38 changes: 0 additions & 38 deletions
38
database/migrations/2024_04_10_000005_create_posts_table.php
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
database/migrations/2024_04_10_000006_create_tags_table.php
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
database/migrations/2024_04_10_000007_create_post_tag_table.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.