using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Infrastructure.Persistence.Migrations
{
///
public partial class Init : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "BannerPosition",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Code = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "위치 구분"),
Subject = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "위치 명"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_BannerPosition", x => x.ID);
},
comment: "배너 위치");
migrationBuilder.CreateTable(
name: "Config",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
LastUpdatedAt = table.Column(type: "datetime2", nullable: false, comment: "마지막 수정일시"),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false, comment: "동시성 제어용"),
Basic_SiteName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "사이트 이름"),
Basic_RootID = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "최고 관리자 ID"),
Basic_FromEmail = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "송수신 이메일"),
Basic_FromName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "송수신자 이름"),
Basic_SmtpServer = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "SMTP Server"),
Basic_SmtpPort = table.Column(type: "int", nullable: true, comment: "SMTP Port"),
Basic_SmtpEnableSSL = table.Column(type: "bit", nullable: true, comment: "SMTP Enable SSL"),
Basic_SmtpUsername = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "SMTP Username"),
Basic_SmtpPassword = table.Column(type: "nvarchar(max)", nullable: true, comment: "SMTP Password (암호화 저장 권장)"),
Basic_AdminWhiteIPList = table.Column(type: "nvarchar(max)", nullable: true, comment: "관리자단 접근 가능 IP"),
Basic_FrontWhiteIPList = table.Column(type: "nvarchar(max)", nullable: true, comment: "사용자단 접근 가능 IP"),
Basic_BlockAlertTitle = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "차단 시 안내문 제목"),
Basic_BlockAlertContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "차단 시 안내문 내용"),
Basic_IsMaintenance = table.Column(type: "bit", nullable: false, comment: "점검 여부"),
Basic_MaintenanceContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "점검 내용"),
Meta_Keywords = table.Column(type: "nvarchar(max)", nullable: true, comment: "Meta Keywords"),
Meta_Description = table.Column(type: "nvarchar(max)", nullable: true, comment: "Meta Description"),
Meta_Author = table.Column(type: "nvarchar(max)", nullable: true, comment: "Meta Author"),
Meta_Viewport = table.Column(type: "nvarchar(max)", nullable: true, comment: "Meta Viewport"),
Meta_ApplicationName = table.Column(type: "nvarchar(max)", nullable: true, comment: "Meta Application Name"),
Meta_Generator = table.Column(type: "nvarchar(max)", nullable: true, comment: "Meta Generator"),
Meta_Robots = table.Column(type: "nvarchar(max)", nullable: true, comment: "Meta Robots"),
Meta_Adds = table.Column(type: "nvarchar(max)", nullable: true),
Company_Name = table.Column(type: "nvarchar(max)", nullable: true),
Company_RegNo = table.Column(type: "nvarchar(max)", nullable: true),
Company_Owner = table.Column(type: "nvarchar(max)", nullable: true),
Company_Tel = table.Column(type: "nvarchar(max)", nullable: true),
Company_Fax = table.Column(type: "nvarchar(max)", nullable: true),
Company_RetailSaleNo = table.Column(type: "nvarchar(max)", nullable: true),
Company_AddedSaleNo = table.Column(type: "nvarchar(max)", nullable: true),
Company_ZipCode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "사업장 주소(우편번호)"),
Company_Hosting = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "호스팅 서비스"),
Company_AdminName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "정보관리책임자"),
Company_AdminEmail = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "정보관리책임자 E-mail"),
Company_SiteUrl = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true, comment: "사이트 주소"),
Company_BankCode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "입금 계좌(은행 코드)"),
Company_BankOwner = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "예금주"),
Company_BankNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "계좌번호"),
Account_IsRegisterBlock = table.Column(type: "bit", nullable: false, comment: "회원가입 차단"),
Account_IsRegisterEmailAuth = table.Column(type: "bit", nullable: false, comment: "회원가입 시 이메일 인증"),
Account_PasswordMinLength = table.Column(type: "int", nullable: true, comment: "비밀번호 최소 길이"),
Account_PasswordUppercaseLength = table.Column(type: "int", nullable: true, comment: "비밀번호 최소 대문자 수"),
Account_PasswordNumbersLength = table.Column(type: "int", nullable: true, comment: "비밀번호 최소 숫자 수"),
Account_PasswordSpecialcharsLength = table.Column(type: "int", nullable: true, comment: "비밀번호 최소 특수문자 수"),
Account_DeniedEmailList = table.Column(type: "nvarchar(max)", nullable: true, comment: "금지 이메일"),
Account_DeniedNameList = table.Column(type: "nvarchar(max)", nullable: true, comment: "금지 별명"),
Account_ChangeEmailDay = table.Column(type: "int", nullable: true, comment: "이메일 갱신 주기(일)"),
Account_ChangeNameDay = table.Column(type: "int", nullable: true, comment: "별명 갱신 주기(일)"),
Account_ChangeSummaryDay = table.Column(type: "int", nullable: true, comment: "한마디 갱신 주기(일)"),
Account_ChangeIntroDay = table.Column(type: "int", nullable: true, comment: "자기소개 갱신 주기(일)"),
Account_ChangePasswordDay = table.Column(type: "int", nullable: true, comment: "비밀번호 갱신 주기(일)"),
Account_MaxLoginTryCount = table.Column(type: "int", nullable: true, comment: "로그인 시도 제한 횟수"),
Account_MaxLoginTryLimitSecond = table.Column(type: "int", nullable: true, comment: "로그인 시도 제한 시간(초)"),
EmailTemplate_RegisterEmailFormTitle = table.Column(type: "nvarchar(max)", nullable: true, comment: "회원가입 시 - 제목"),
EmailTemplate_RegisterEmailFormContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "회원가입 시 - 내용"),
EmailTemplate_RegistrationEmailFormTitle = table.Column(type: "nvarchar(max)", nullable: true, comment: "회원가입 완료 - 제목"),
EmailTemplate_RegistrationEmailFormContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "회원가입 완료 - 내용"),
EmailTemplate_ResetPasswordEmailFormTitle = table.Column(type: "nvarchar(max)", nullable: true, comment: "비밀번호 재설정 - 제목"),
EmailTemplate_ResetPasswordEmailFormContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "비밀번호 재설정 - 내용"),
EmailTemplate_ChangedPasswordEmailFormTitle = table.Column(type: "nvarchar(max)", nullable: true, comment: "비밀번호 변경 완료 - 제목"),
EmailTemplate_ChangedPasswordEmailFormContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "비밀번호 변경 완료 - 내용"),
EmailTemplate_WithdrawEmailFormTitle = table.Column(type: "nvarchar(max)", nullable: true, comment: "회원탈퇴 시 - 제목"),
EmailTemplate_WithdrawEmailFormContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "회원탈퇴 시 - 내용"),
EmailTemplate_EmailVerifyFormTitle = table.Column(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 시 - 제목"),
EmailTemplate_EmailVerifyFormContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 시 - 내용"),
EmailTemplate_ChangedEmailFormTitle = table.Column(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 완료 - 제목"),
EmailTemplate_ChangedEmailFormContent = table.Column(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 완료 - 내용"),
External_YouTubeApiKeyEnc = table.Column(type: "nvarchar(max)", nullable: true, comment: "YouTube API Key (암호화 저장 권장)"),
External_YouTubeApiName = table.Column(type: "nvarchar(max)", nullable: true, comment: "YouTube API Name"),
External_GoogleClientId = table.Column(type: "nvarchar(max)", nullable: true, comment: "Google Client ID"),
External_GoogleClientSecretEnc = table.Column(type: "nvarchar(max)", nullable: true, comment: "Google Client Secret (암호화 저장 권장)"),
External_GoogleAppId = table.Column(type: "nvarchar(max)", nullable: true, comment: "Google APP ID")
},
constraints: table =>
{
table.PrimaryKey("PK_Config", x => x.ID);
},
comment: "운영 정보 설정 값");
migrationBuilder.CreateTable(
name: "Document",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Code = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "주소"),
Subject = table.Column(type: "nvarchar(120)", maxLength: 120, nullable: false, comment: "제목"),
Content = table.Column(type: "nvarchar(max)", maxLength: 5000, nullable: true, comment: "내용"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
Views = table.Column(type: "int", nullable: false, comment: "조회 수"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_Document", x => x.ID);
},
comment: "문서");
migrationBuilder.CreateTable(
name: "EmailVerifyNumber",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Type = table.Column(type: "int", nullable: false, comment: "인증 유형 (이메일 인증 / 비밀번호 재설정)"),
Email = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "이메일"),
Code = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false, comment: "Code"),
IsVerified = table.Column(type: "bit", nullable: false, comment: "인증 여부"),
Expiration = table.Column(type: "datetime2", nullable: false, comment: "만료 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_EmailVerifyNumber", x => x.ID);
},
comment: "이메일 인증 번호들");
migrationBuilder.CreateTable(
name: "EmailVerifyToken",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Type = table.Column(type: "int", nullable: false, comment: "인증 유형 (이메일 인증 / 비밀번호 재설정)"),
Email = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "이메일"),
Token = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false, comment: "Token"),
IsVerified = table.Column(type: "bit", nullable: false, comment: "인증 여부"),
Expiration = table.Column(type: "datetime2", nullable: false, comment: "만료 일시"),
Additional = table.Column(type: "nvarchar(max)", nullable: true, comment: "추가 정보(JSON)"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_EmailVerifyToken", x => x.ID);
},
comment: "이메일 인증 토큰들");
migrationBuilder.CreateTable(
name: "FaqCategory",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Code = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "주소"),
Subject = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "분류 명"),
Order = table.Column(type: "smallint", nullable: false, comment: "순서"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_FaqCategory", x => x.ID);
},
comment: "FAQ 분류");
migrationBuilder.CreateTable(
name: "MemberGrade",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
KorName = table.Column(type: "nvarchar(240)", maxLength: 240, nullable: false, comment: "한글 명"),
EngName = table.Column(type: "nvarchar(120)", maxLength: 120, nullable: false, comment: "영문 명"),
Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "설명"),
Order = table.Column(type: "smallint", nullable: false, comment: "순서"),
Image = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "이미지"),
RequiredExp = table.Column(type: "int", nullable: false, comment: "누적 경험치"),
RequiredAttendance = table.Column(type: "bigint", nullable: false, comment: "누적 출석 수"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_MemberGrade", x => x.ID);
},
comment: "회원 등급");
migrationBuilder.CreateTable(
name: "Popup",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
Subject = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "제목"),
Content = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: true, comment: "내용"),
Link = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "주소"),
StartAt = table.Column(type: "datetime2", nullable: true, comment: "사용 기간 - 시작"),
EndAt = table.Column(type: "datetime2", nullable: true, comment: "사용 기간 - 종료"),
Order = table.Column(type: "smallint", nullable: false, comment: "순서"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_Popup", x => x.ID);
},
comment: "팝업");
migrationBuilder.CreateTable(
name: "BannerItem",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
PositionID = table.Column(type: "int", nullable: false, comment: "배너 위치 ID"),
Subject = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "배너 명"),
DesktopImage = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true, comment: "이미지(Desktop)"),
MobileImage = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true, comment: "이미지(Mobile)"),
Link = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "주소"),
Order = table.Column(type: "smallint", nullable: false, comment: "순서"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
StartAt = table.Column(type: "datetime2", nullable: true, comment: "사용 기간 - 시작"),
EndAt = table.Column(type: "datetime2", nullable: true, comment: "사용 기간 - 종료"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_BannerItem", x => x.ID);
table.ForeignKey(
name: "FK_BannerItem_BannerPosition_PositionID",
column: x => x.PositionID,
principalTable: "BannerPosition",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "배너 아이템");
migrationBuilder.CreateTable(
name: "FaqItem",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
CategoryID = table.Column(type: "int", nullable: false, comment: "분류 ID"),
Question = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "질문"),
Answer = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: true, comment: "답변"),
Order = table.Column(type: "smallint", nullable: false, comment: "순서"),
IsActive = table.Column(type: "bit", nullable: false, comment: "사용 여부"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_FaqItem", x => x.ID);
table.ForeignKey(
name: "FK_FaqItem_FaqCategory_CategoryID",
column: x => x.CategoryID,
principalTable: "FaqCategory",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "FAQ 목록");
migrationBuilder.CreateTable(
name: "Member",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
MemberGradeID = table.Column(type: "int", nullable: true, comment: "회원등급 PK"),
SID = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "SID"),
Email = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "이메일"),
Name = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "별명"),
FullName = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "본명"),
FirstName = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "본명(성)"),
LastName = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "본명(이름)"),
Password = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "비밀번호"),
Intro = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "자기소개"),
Summary = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "한마디"),
Phone = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "연락처"),
Birthday = table.Column(type: "date", nullable: true, comment: "생년월일"),
Gender = table.Column(type: "int", nullable: true, comment: "성별"),
Thunmbnail = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "썸네일"),
Icon = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "아이콘"),
IsEmailVerified = table.Column(type: "bit", nullable: false, comment: "이메일 인증 여부"),
IsAuthCertified = table.Column(type: "bit", nullable: false, comment: "본인 인증 여부"),
IsDenied = table.Column(type: "bit", nullable: false, comment: "차단 여부"),
IsAdmin = table.Column(type: "bit", nullable: false, comment: "운영진 여부"),
IsWithdraw = table.Column(type: "bit", nullable: false, comment: "탈퇴 여부"),
IsCreator = table.Column(type: "bit", nullable: false, comment: "크리에이터 여부"),
DeviceInfo = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: true, comment: "로그인 단말기 정보"),
SignupIP = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "회원가입 시 IP"),
LastLoginIp = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "마지막 로그인 IP"),
IpAddress = table.Column(type: "nvarchar(45)", maxLength: 45, nullable: true, comment: "IP Address"),
UserAgent = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-agent"),
LastLoginAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 로그인 일시"),
LastEmailChangedAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 이메일 변경 일시"),
LastNameChangedAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 별명 변경 일시"),
LastSummaryChangedAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 한마디 변경 일시"),
LastIntroChangedAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 자기소개 변경 일시"),
EmailVerifiedAt = table.Column(type: "datetime2", nullable: true, comment: "이메일 인증 일시"),
AuthCertifiedAt = table.Column(type: "datetime2", nullable: true, comment: "본인인증 일시"),
PasswordUpdatedAt = table.Column(type: "datetime2", nullable: false, comment: "비밀번호 변경 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "가입 일시"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
DeletedAt = table.Column(type: "datetime2", nullable: true, comment: "탈퇴 일시"),
DeniedAt = table.Column(type: "datetime2", nullable: true, comment: "차단 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_Member", x => x.ID);
table.ForeignKey(
name: "FK_Member_MemberGrade_MemberGradeID",
column: x => x.MemberGradeID,
principalTable: "MemberGrade",
principalColumn: "ID",
onDelete: ReferentialAction.SetNull);
},
comment: "회원 정보");
migrationBuilder.CreateTable(
name: "Channel",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
SID = table.Column(type: "nvarchar(24)", maxLength: 24, nullable: false, comment: "채널 ID"),
Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "채널 이름"),
Handle = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: true, comment: "핸들"),
YouTubeUrl = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "YouTube 채널 URL"),
PlatformFeeRate = table.Column(type: "decimal(5,2)", precision: 5, scale: 2, nullable: false, comment: "수수료(%)"),
IsVerified = table.Column(type: "bit", nullable: false, comment: "인증 여부"),
IsActive = table.Column(type: "bit", nullable: false, comment: "활성 여부"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_Channel", x => x.ID);
table.ForeignKey(
name: "FK_Channel_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "채널 정보");
migrationBuilder.CreateTable(
name: "MemberApprove",
columns: table => new
{
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
IsReceiveSMS = table.Column(type: "bit", nullable: false, comment: "SMS 수신 여부"),
ReceiveSMSConsentAt = table.Column(type: "datetime2", nullable: true, comment: "SMS 수신 동의 일시"),
IsReceiveEmail = table.Column(type: "bit", nullable: false, comment: "E-MAIL 수신 여부"),
ReceiveEmailConsentAt = table.Column(type: "datetime2", nullable: true, comment: "E-MAIL 수신 동의 일시"),
IsReceiveNote = table.Column(type: "bit", nullable: false, comment: "쪽지 수신 여부"),
ReceiveNoteConsentAt = table.Column(type: "datetime2", nullable: true, comment: "쪽지 수신 동의 일시"),
IsDisclosureInvest = table.Column(type: "bit", nullable: false, comment: "투자 현황 공개 여부"),
DisclosureInvestConsentAt = table.Column(type: "datetime2", nullable: true, comment: "투자 현황 공개 동의 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_MemberApprove", x => x.MemberID);
table.ForeignKey(
name: "FK_MemberApprove_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "회원 동의 및 수신 여부");
migrationBuilder.CreateTable(
name: "MemberEmailChangeLog",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
BeforeEmail = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: true, comment: "이전 이메일"),
AfterEmail = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "바뀐 이메일"),
Referer = table.Column(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
IpAddress = table.Column(type: "nvarchar(45)", maxLength: 45, nullable: true, comment: "IP Address"),
UserAgent = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_MemberEmailChangeLog", x => x.ID);
table.ForeignKey(
name: "FK_MemberEmailChangeLog_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "사용자 이메일 변경 내역");
migrationBuilder.CreateTable(
name: "MemberIntroChangeLog",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
BeforeIntro = table.Column(type: "nvarchar(3000)", maxLength: 3000, nullable: true, comment: "이전 자기소개"),
AfterIntro = table.Column(type: "nvarchar(3000)", maxLength: 3000, nullable: true, comment: "바꾼 자기소개"),
Referer = table.Column(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
IpAddress = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "IP Address"),
UserAgent = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_MemberIntroChangeLog", x => x.ID);
table.ForeignKey(
name: "FK_MemberIntroChangeLog_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "자기소개 변경 내역");
migrationBuilder.CreateTable(
name: "MemberLoginLog",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
MemberID = table.Column(type: "int", nullable: true, comment: "회원 ID"),
Success = table.Column(type: "bit", nullable: false, comment: "로그인 성공 여부 (0: 실패, 1: 성공)"),
Account = table.Column(type: "nvarchar(120)", maxLength: 120, nullable: false, comment: "로그인 시도한 계정"),
Reason = table.Column(type: "nvarchar(225)", maxLength: 225, nullable: true, comment: "실패 이유"),
Referer = table.Column(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
Url = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "요청 주소"),
IpAddress = table.Column(type: "nvarchar(45)", maxLength: 45, nullable: true, comment: "IP Address"),
UserAgent = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_MemberLoginLog", x => x.ID);
table.ForeignKey(
name: "FK_MemberLoginLog_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.SetNull);
},
comment: "로그인 기록");
migrationBuilder.CreateTable(
name: "MemberNameChangeLog",
columns: table => new
{
ID = table.Column(type: "int", nullable: false, comment: "PK")
.Annotation("SqlServer:Identity", "1, 1"),
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
BeforeName = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "이전 별명"),
AfterName = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "바꾼 별명"),
Referer = table.Column(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
IpAddress = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "IP Address"),
UserAgent = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "등록 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_MemberNameChangeLog", x => x.ID);
table.ForeignKey(
name: "FK_MemberNameChangeLog_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "별명 변경 내역");
migrationBuilder.CreateTable(
name: "MemberStats",
columns: table => new
{
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false, comment: "동시성"),
Exp = table.Column(type: "bigint", nullable: false, comment: "경험치"),
PostCount = table.Column(type: "bigint", nullable: false, comment: "작성 게시글"),
CommentCount = table.Column(type: "bigint", nullable: false, comment: "작성 댓글"),
LikeReceivedCount = table.Column(type: "bigint", nullable: false, comment: "받은 좋아요 수"),
LikeGivenCount = table.Column(type: "bigint", nullable: false, comment: "누른 좋아요 수"),
ReportedCount = table.Column(type: "bigint", nullable: false, comment: "신고 당한 횟수"),
BookmarkGivenCount = table.Column(type: "bigint", nullable: false, comment: "즐겨찾기 글 수"),
WarningCount = table.Column