Exemplo n.º 1
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Symbols_Name_ListingExchangeCode",
                table: "Symbols");

            migrationBuilder.BeforeSymbolsListingExchangeCodeChange();

            migrationBuilder.AlterColumn <string>(
                name: "ListingExchangeCode",
                table: "Symbols",
                maxLength: 10,
                nullable: true,
                oldClrType: typeof(string),
                oldMaxLength: 10);

            migrationBuilder.SetSymbolsListingExchangeCodeNullCollationToCaseSensitive();
            migrationBuilder.AfterSymbolsListingExchangeCodeChange();

            migrationBuilder.CreateIndex(
                name: "IX_Symbols_Name_ListingExchangeCode",
                table: "Symbols",
                columns: new[] { "Name", "ListingExchangeCode" },
                unique: true,
                filter: "[ListingExchangeCode] IS NOT NULL");
        }