| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddStockWatch : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "StockWatch",
- columns: table => new
- {
- ID = table.Column<long>(type: "bigint", nullable: false, comment: "PK")
- .Annotation("SqlServer:Identity", "1, 1"),
- MemberID = table.Column<int>(type: "int", nullable: false, comment: "관심 등록 회원 ID"),
- StockCode = table.Column<string>(type: "nchar(6)", fixedLength: true, maxLength: 6, nullable: false, comment: "단축코드 (char 6, Stock.Code denorm)"),
- CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_StockWatch", x => x.ID);
- },
- comment: "회원 관심종목");
- migrationBuilder.CreateIndex(
- name: "IX_StockWatch_MemberID_CreatedAt",
- table: "StockWatch",
- columns: new[] { "MemberID", "CreatedAt" },
- descending: new[] { false, true });
- migrationBuilder.CreateIndex(
- name: "IX_StockWatch_MemberID_StockCode",
- table: "StockWatch",
- columns: new[] { "MemberID", "StockCode" },
- unique: true);
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "StockWatch");
- }
- }
- }
|