Files
sam-api/database/migrations/2025_07_23_132401_create_boards_table.php
hskwon 609ac39ffb feat : 테이블 및 DB 마이그레이션 파일 추가
products
  - common_codes
  - parts
  - products
  - files
  - price_histories
  - boms
  - bom_items

  boards
  - boards
  - board_settings
  - posts
  - board_comments
  - board_files
  - post_custom_field_values

  permissions
  - menus
  - roles
  - user_menu_permissions
  - role_menu_permissions

  tenants
  - tenants
  - plans
  - subscriptions
  - payments
2025-07-23 15:41:01 +09:00

32 lines
1.5 KiB
PHP

<?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('boards', function (Blueprint $table) {
$table->id()->comment('게시판 고유번호');
$table->unsignedBigInteger('tenant_id')->comment('테넌트 고유번호');
$table->string('board_code', 30)->comment('게시판 코드');
$table->string('name', 100)->comment('게시판 이름');
$table->string('description', 255)->nullable()->comment('게시판 설명');
$table->string('editor_type', 20)->default('wysiwyg')->comment('에디터 유형');
$table->boolean('allow_files')->default(true)->comment('파일첨부 허용 여부');
$table->integer('max_file_count')->default(5)->comment('최대 첨부파일 수');
$table->integer('max_file_size')->default(20480)->comment('최대 첨부파일 크기(KB)');
$table->json('extra_settings')->nullable()->comment('추가 설정(JSON)');
$table->boolean('is_active')->default(true)->comment('활성화 여부');
$table->timestamps();
$table->unique(['tenant_id', 'board_code']);
$table->foreign('tenant_id')->references('id')->on('tenants');
});
}
public function down(): void {
Schema::dropIfExists('boards');
}
};