Skip to content

Commit

Permalink
fix update db
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Oct 29, 2024
1 parent 10155d4 commit 6725a9f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/Database/Migrations/2024_08_20_185850_create_cms_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,83 @@ public function up(): void
// create cms categories table
Schema::create('cms_categories', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->integer('parent_id')->default(0);
$table->integer('order')->default(0);
$table->integer('status')->default(1);
$table->integer('created_by')->default(0);
$table->integer('updated_by')->default(0);
$table->integer('deleted_by')->default(0);
$table->softDeletes();
$table->integer('deleted_at')->nullable();
$table->timestamps();
});

// create cms categories translations table
Schema::create('cms_categories_translations', function (Blueprint $table) {
$table->id();
$table->integer('cms_category_id');
$table->string('locale');
$table->string('name');
$table->string('slug');
$table->timestamps();
});

// create cms tags table
Schema::create('cms_tags', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->integer('status')->default(1);
$table->integer('created_by')->default(0);
$table->integer('updated_by')->default(0);
$table->integer('deleted_by')->default(0);
$table->softDeletes();
$table->timestamps();
});

// create cms tags translations table
Schema::create('cms_tags_translations', function (Blueprint $table) {
$table->id();
$table->integer('cms_tag_id');
$table->string('locale');
$table->string('name');
$table->string('slug');
$table->timestamps();
});

// create cms posts table
Schema::create('cms_posts', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug')->unique();
$table->text('content');
$table->integer('status')->default(1);
$table->integer('created_by')->default(0);
$table->integer('updated_by')->default(0);
$table->integer('deleted_by')->default(0);
$table->softDeletes();
$table->integer('deleted_at')->nullable();
$table->integer('category_id');
$table->integer('featured')->default(0);
$table->integer('views')->default(0);
$table->integer('likes')->default(0);
$table->integer('dislikes')->default(0);
$table->integer('shares')->default(0);
$table->integer('comments')->default(0);
$table->integer('published_at')->nullable();
$table->timestamps();
});

// create cms posts translations table
Schema::create('cms_posts_translations', function (Blueprint $table) {
$table->id();
$table->integer('cms_post_id');
$table->string('locale');
$table->string('title');
$table->string('slug');
$table->text('content');
$table->timestamps();
});
}
Expand All @@ -75,5 +122,13 @@ public function up(): void
public function down(): void
{
Schema::dropIfExists('cms');
Schema::dropIfExists('cms_post_meta');
Schema::dropIfExists('cms_categories');
Schema::dropIfExists('cms_categories_translations');
Schema::dropIfExists('cms_tags');
Schema::dropIfExists('cms_tags_translations');
Schema::dropIfExists('cms_posts');
Schema::dropIfExists('cms_posts_translations');

}
};

0 comments on commit 6725a9f

Please sign in to comment.