diff --git a/database/migrations/2026_03_18_100000_add_ai_token_limit_and_update_storage_limit.php b/database/migrations/2026_03_18_100000_add_ai_token_limit_and_update_storage_limit.php new file mode 100644 index 00000000..48b73f37 --- /dev/null +++ b/database/migrations/2026_03_18_100000_add_ai_token_limit_and_update_storage_limit.php @@ -0,0 +1,45 @@ +bigInteger('ai_token_limit') + ->default(1000000) + ->after('storage_grace_period_until') + ->comment('월별 AI 토큰 한도 (기본 100만)'); + }); + + // 기존 storage_limit 기본값 10GB인 테넌트를 100GB로 변경 + DB::table('tenants') + ->where('storage_limit', 10737418240) // 10GB + ->update(['storage_limit' => 107374182400]); // 100GB + + // 새로 생성되는 테넌트의 기본값도 100GB로 변경 + DB::statement('ALTER TABLE tenants ALTER COLUMN storage_limit SET DEFAULT 107374182400'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // storage_limit 기본값 복원 + DB::statement('ALTER TABLE tenants ALTER COLUMN storage_limit SET DEFAULT 10737418240'); + + Schema::table('tenants', function (Blueprint $table) { + $table->dropColumn('ai_token_limit'); + }); + } +};