generator client { provider = "prisma-client-js" output = "./generated/gateway" engineType = "binary" } datasource db { provider = "postgresql" } enum OAuthType { NONE KAKAO } enum GatewayProfileStatus { RESERVED PREOPEN RUNNING PAUSED COMPLETED STOPPED DISABLED } enum GatewayBuildStatus { IDLE QUEUED RUNNING FAILED SUCCEEDED } enum GatewayOperationType { RESET START STOP } enum GatewayOperationStatus { QUEUED RUNNING SUCCEEDED FAILED CANCELLED } enum GatewaySourceMode { BRANCH COMMIT } model AppUser { id String @id @default(uuid()) loginId String @unique @map("login_id") displayName String @unique @map("display_name") passwordHash String @map("password_hash") passwordSalt String @map("password_salt") roles Json @default(dbgenerated("'[]'::jsonb")) sanctions Json @default(dbgenerated("'{}'::jsonb")) oauthType OAuthType @default(NONE) @map("oauth_type") oauthId String? @unique @map("oauth_id") email String? @unique oauthInfo Json @default(dbgenerated("'{}'::jsonb")) @map("oauth_info") picture String @default("default.jpg") imageServer Int @default(0) @map("image_server") iconUpdatedAt DateTime? @map("icon_updated_at") thirdPartyUse Boolean @default(true) @map("third_party_use") termsAcceptedAt DateTime? @map("terms_accepted_at") privacyAcceptedAt DateTime? @map("privacy_accepted_at") kakaoVerifiedAt DateTime? @map("kakao_verified_at") kakaoGraceStartedAt DateTime @default(now()) @map("kakao_grace_started_at") deleteAfter DateTime? @map("delete_after") createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") lastLoginAt DateTime? @map("last_login_at") legacyData Json @default(dbgenerated("'{}'::jsonb")) @map("legacy_data") @@map("app_user") } model LegacyMemberLog { id BigInt @id memberNo Int @map("member_no") userId String @map("user_id") date DateTime actionType String @map("action_type") action Json? @@index([userId, date]) @@index([memberNo, date]) @@map("legacy_member_log") } model LegacyBannedMember { id Int @id @map("no") hashedEmail String @unique @map("hashed_email") info String? @@map("legacy_banned_member") } model LegacyRootKeyValue { id Int @id @default(autoincrement()) sourceTable String @map("source_table") namespace String key String value Json migratedAt DateTime @default(now()) @map("migrated_at") @@unique([sourceTable, namespace, key]) @@map("legacy_root_key_value") } model GatewayProfile { profileName String @id @map("profile_name") profile String scenario String apiPort Int @map("api_port") status GatewayProfileStatus buildStatus GatewayBuildStatus @default(IDLE) @map("build_status") buildCommitSha String? @map("build_commit_sha") buildWorkspace String? @map("build_workspace") buildLastUsedAt DateTime? @map("build_last_used_at") preopenAt DateTime? @map("preopen_at") openAt DateTime? @map("open_at") scheduledStartAt DateTime? @map("scheduled_start_at") buildRequestedAt DateTime? @map("build_requested_at") buildStartedAt DateTime? @map("build_started_at") buildCompletedAt DateTime? @map("build_completed_at") buildError String? @map("build_error") lastError String? @map("last_error") meta Json @default(dbgenerated("'{}'::jsonb")) createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") operations GatewayOperation[] @@unique([profile, scenario]) @@map("gateway_profile") } model GatewayOperation { id String @id @default(uuid()) profileName String @map("profile_name") profile GatewayProfile @relation(fields: [profileName], references: [profileName], onDelete: Cascade) type GatewayOperationType status GatewayOperationStatus @default(QUEUED) sourceMode GatewaySourceMode? @map("source_mode") sourceRef String? @map("source_ref") resolvedCommitSha String? @map("resolved_commit_sha") payload Json @default(dbgenerated("'{}'::jsonb")) reason String? requestedBy String @map("requested_by") scheduledAt DateTime? @map("scheduled_at") startedAt DateTime? @map("started_at") completedAt DateTime? @map("completed_at") error String? createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") @@index([status, scheduledAt, createdAt]) @@index([profileName, createdAt]) @@map("gateway_operation") } model SystemSetting { id Int @id @default(1) @map("no") registrationEnabled Boolean @default(false) @map("registration_enabled") loginEnabled Boolean @default(false) @map("login_enabled") notice String @default("") @map("notice") createdAt DateTime? @map("created_at") updatedAt DateTime? @map("updated_at") @@map("system") }