protected override void Down(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_Translation_Content_ContentId", table: "Translation");
     migrationBuilder.DropPrimaryKey(name: "PK_Content", table: "Content");
     migrationBuilder.DropColumn(name: "Id", table: "Content");
     migrationBuilder.AddColumn<Guid>(
         name: "ContentContentGuid",
         table: "Translation",
         nullable: true);
     migrationBuilder.AddColumn<Guid>(
         name: "ContentGuid",
         table: "Content",
         nullable: false,
         defaultValueSql: "newsequentialid()");
     migrationBuilder.AddPrimaryKey(
         name: "PK_Content",
         table: "Content",
         column: "ContentGuid");
     migrationBuilder.AddForeignKey(
         name: "FK_Translation_Content_ContentContentGuid",
         table: "Translation",
         column: "ContentContentGuid",
         principalTable: "Content",
         principalColumn: "ContentGuid",
         onDelete: ReferentialAction.Restrict);
 }
コード例 #2
0
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropPrimaryKey(name: "PK_LpaUserClaim", table: "UserClaims");
     migrationBuilder.AddPrimaryKey(
         name: "PK_LpaUserClaim",
         table: "UserClaims",
         columns: new[] { "UserId", "ClaimId" })
         .Annotation("SqlServer:Clustered", true);
 }
コード例 #3
0
ファイル: 20151111204851_m3.cs プロジェクト: DmitryPP/ASPNET5
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_MasterToRole_Role_RoleId", table: "MasterToRole");
     migrationBuilder.DropPrimaryKey(name: "PK_MasterToRole", table: "MasterToRole");
     migrationBuilder.DropColumn(name: "RoleId", table: "MasterToRole");
     migrationBuilder.DropTable("Role");
     migrationBuilder.AlterColumn<string>(
         name: "IdentityRoleId",
         table: "MasterToRole",
         nullable: false);
     migrationBuilder.AddPrimaryKey(
         name: "PK_MasterToRole",
         table: "MasterToRole",
         columns: new[] { "IdentityRoleId", "MasterID" });
 }
コード例 #4
0
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropPrimaryKey(name: "PK_IdentityRole", table: "AspNetRoles");
     migrationBuilder.AddPrimaryKey(
         name: "PK_ApplicationRole",
         table: "AspNetRoles",
         column: "Id");
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_ApplicationRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id");
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_ApplicationRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id");
 }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_Translation_Content_ContentContentGuid", table: "Translation");
     migrationBuilder.DropPrimaryKey(name: "PK_Content", table: "Content");
     migrationBuilder.DropColumn(name: "ContentContentGuid", table: "Translation");
     migrationBuilder.DropColumn(name: "ContentGuid", table: "Content");
     migrationBuilder.AddColumn<int>(
         name: "Id",
         table: "Content",
         nullable: false)
         .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
     migrationBuilder.AddPrimaryKey(
         name: "PK_Content",
         table: "Content",
         column: "Id");
     migrationBuilder.AddForeignKey(
         name: "FK_Translation_Content_ContentId",
         table: "Translation",
         column: "ContentId",
         principalTable: "Content",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
コード例 #6
0
ファイル: 20151111204851_m3.cs プロジェクト: DmitryPP/ASPNET5
 protected override void Down(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropPrimaryKey(name: "PK_MasterToRole", table: "MasterToRole");
     migrationBuilder.CreateTable(
         name: "Role",
         columns: table => new
         {
             Id = table.Column<string>(nullable: false),
             ConcurrencyStamp = table.Column<string>(nullable: true),
             Name = table.Column<string>(nullable: true),
             NormalizedName = table.Column<string>(nullable: true)
         },
         constraints: table =>
         {
             table.PrimaryKey("PK_Role", x => x.Id);
         });
     migrationBuilder.AlterColumn<string>(
         name: "IdentityRoleId",
         table: "MasterToRole",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "RoleId",
         table: "MasterToRole",
         nullable: false,
         defaultValue: "");
     migrationBuilder.AddPrimaryKey(
         name: "PK_MasterToRole",
         table: "MasterToRole",
         columns: new[] { "RoleId", "MasterID" });
     migrationBuilder.AddForeignKey(
         name: "FK_MasterToRole_Role_RoleId",
         table: "MasterToRole",
         column: "RoleId",
         principalTable: "Role",
         principalColumn: "Id");
 }
コード例 #7
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_FspMandatates",
                table: "FspMandatates");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Dividends",
                table: "Dividends");

            migrationBuilder.DeleteData(
                table: "users",
                keyColumn: "Id",
                keyValue: new Guid("713762b3-b687-470b-ba8b-98f8558debb6"));

            migrationBuilder.DropColumn(
                name: "Adviser",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "AtLimited",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "AttFull",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "DateFUll",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "DateLimited",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FAggressive",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FConservative",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FLG",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FLI",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FMG",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FMI",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FModerate",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FModeratelyAggressive",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FModeratelyConservative",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FSG",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "FSI",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "Instruction_advisor",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "Instruction_fsp",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "Instruction_personal",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LAggressive",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LConservative",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LLG",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LLI",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LMG",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LMI",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LModerate",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LModeratelyAggressive",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LModeratelyConservative",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LSG",
                table: "FspMandatates");

            migrationBuilder.DropColumn(
                name: "LSI",
                table: "FspMandatates");

            migrationBuilder.RenameTable(
                name: "FspMandatates",
                newName: "fsp_mandate");

            migrationBuilder.RenameTable(
                name: "Dividends",
                newName: "dividend_tax");

            migrationBuilder.AddColumn <string>(
                name: "Advisor",
                table: "fsp_mandate",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "Created",
                table: "fsp_mandate",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <string>(
                name: "InstructionAdvisor",
                table: "fsp_mandate",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "InstructionFsp",
                table: "fsp_mandate",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "InstructionPersonal",
                table: "fsp_mandate",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "Modified",
                table: "fsp_mandate",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <string>(
                name: "Objective",
                table: "fsp_mandate",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "Created",
                table: "dividend_tax",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <DateTime>(
                name: "Modified",
                table: "dividend_tax",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddPrimaryKey(
                name: "PK_fsp_mandate",
                table: "fsp_mandate",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_dividend_tax",
                table: "dividend_tax",
                column: "Id");

            migrationBuilder.InsertData(
                table: "users",
                columns: new[] { "Id", "Created", "Email", "FirstName", "IdNumber", "LastName", "MobileNumber", "MobileVerified", "Modified", "Password", "Role" },
                values: new object[] { new Guid("b4004ea2-ba11-41e2-b1a2-2ea3a695e9e7"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "*****@*****.**", "rootUser", "9000000000000", "root", "0810000000", true, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "9668.XdybiqhW2gF88BQbLlvVhg==.J4wypE1hkqehbkOOxJUSPUNvPhHF82gP4cdLfOvqVJ0=", "Admin" });
        }
コード例 #8
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_GamesRates_Games_GameId",
                table: "GamesRates");

            migrationBuilder.DropPrimaryKey(
                name: "PK_GamesRates",
                table: "GamesRates");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Games",
                table: "Games");

            migrationBuilder.DropColumn(
                name: "Id",
                table: "GamesRates");

            migrationBuilder.DropColumn(
                name: "Id",
                table: "Games");

            migrationBuilder.AlterColumn <string>(
                name: "GameId",
                table: "GamesRates",
                type: "nvarchar(450)",
                nullable: true,
                oldClrType: typeof(int),
                oldNullable: true);

            migrationBuilder.AddColumn <string>(
                name: "GameRateId",
                table: "GamesRates",
                type: "nvarchar(450)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn <string>(
                name: "GameId",
                table: "Games",
                type: "nvarchar(450)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddPrimaryKey(
                name: "PK_GamesRates",
                table: "GamesRates",
                column: "GameRateId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Games",
                table: "Games",
                column: "GameId");

            migrationBuilder.AddForeignKey(
                name: "FK_GamesRates_Games_GameId",
                table: "GamesRates",
                column: "GameId",
                principalTable: "Games",
                principalColumn: "GameId",
                onDelete: ReferentialAction.Restrict);
        }
コード例 #9
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_TimeZoneIDs",
                table: "TimeZoneIDs");

            migrationBuilder.RenameTable(
                name: "TimeZoneIDs",
                newName: "TimeZoneIds");

            migrationBuilder.AddPrimaryKey(
                name: "PK_TimeZoneIds",
                table: "TimeZoneIds",
                column: "Id");

            migrationBuilder.InsertData(
                table: "TimeZoneIds",
                columns: new[] { "Id", "CreatedBy", "CreatedOn", "DeleteOn", "DeletedBy", "IsDeleted", "LinuxTimeZone", "UpdatedBy", "UpdatedOn", "WindowsTimeZone" },
                values: new object[, ]
            {
                { new Guid("2b35692d-7f9f-4d21-890c-76cbd1acb684"), "", null, null, "", false, "Etc/GMT+12", null, null, "Dateline Standard Time" },
                { new Guid("2fa0b1e0-a90f-45f6-9b89-1ab9e00c92d7"), "", null, null, "", false, "Asia/Novosibirsk", null, null, "N. Central Asia Standard Time" },
                { new Guid("80532b51-2ee3-40b9-98c4-57742a8ef684"), "", null, null, "", false, "Asia/Krasnoyarsk", null, null, "North Asia Standard Time" },
                { new Guid("d612b3d6-90e2-4149-8d4d-4d6ce443bc97"), "", null, null, "", false, "Asia/Hovd", null, null, "W. Mongolia Standard Time" },
                { new Guid("f709a4fb-0df5-4121-9bd5-7d0470aff41f"), "", null, null, "", false, "Asia/Barnaul", null, null, "Altai Standard Time" },
                { new Guid("b0445a01-7433-40e7-9684-4eb72f476680"), "", null, null, "", false, "Asia/Bangkok", null, null, "SE Asia Standard Time" },
                { new Guid("fadde5c8-2f36-456a-a186-b0a04108ed4f"), "", null, null, "", false, "Asia/Yangon", null, null, "Myanmar Standard Time" },
                { new Guid("2ef1534c-36de-4c25-97bf-e67c2592f1ec"), "", null, null, "", false, "Asia/Omsk", null, null, "Omsk Standard Time" },
                { new Guid("c9ebd4ed-6c6c-4eba-9281-3b672520cc41"), "", null, null, "", false, "Asia/Dhaka", null, null, "Bangladesh Standard Time" },
                { new Guid("e31588e4-9274-4b52-ae2b-581ab5691b9b"), "", null, null, "", false, "Asia/Almaty", null, null, "Central Asia Standard Time" },
                { new Guid("d0ff9b09-2f72-445a-b1a4-ac8dbeb16914"), "", null, null, "", false, "Asia/Kathmandu", null, null, "Nepal Standard Time" },
                { new Guid("1ccc947b-13c8-4cd6-9aee-9944a70c2d6f"), "", null, null, "", false, "Asia/Colombo", null, null, "Sri Lanka Standard Time" },
                { new Guid("756f7bdb-60ea-4cee-9499-72e9b9ef13fb"), "", null, null, "", false, "Asia/Kolkata", null, null, "India Standard Time" },
                { new Guid("18a5100c-c6d6-4ba8-a395-04a2f1728a57"), "", null, null, "", false, "Asia/Karachi", null, null, "Pakistan Standard Time" },
                { new Guid("860ad695-c8f1-49fe-8a81-2de31b12884a"), "", null, null, "", false, "Asia/Yekaterinburg", null, null, "Ekaterinburg Standard Time" },
                { new Guid("10ef3133-b2ef-4fe9-a03c-992a96a76e9c"), "", null, null, "", false, "Asia/Tomsk", null, null, "Tomsk Standard Time" },
                { new Guid("e2536cc0-7be8-4246-af07-16f6cf10d3ad"), "", null, null, "", false, "Asia/Tashkent", null, null, "West Asia Standard Time" },
                { new Guid("c94209d0-5923-46fb-8df4-52e4cce462c6"), "", null, null, "", false, "Asia/Yerevan", null, null, "Caucasus Standard Time" },
                { new Guid("b4e9d554-9f81-4be6-88c0-6614198737c2"), "", null, null, "", false, "Asia/Tbilisi", null, null, "Georgian Standard Time" },
                { new Guid("9de7c21d-dcaa-4a27-80c7-886c019ce484"), "", null, null, "", false, "Europe/Saratov", null, null, "Saratov Standard Time" },
                { new Guid("dc87b8ac-26e2-4b65-b514-c07664a16fb2"), "", null, null, "", false, "Indian/Mauritius", null, null, "Mauritius Standard Time" },
                { new Guid("4b081bcd-9f69-4824-b3b4-3bbac9a93fd1"), "", null, null, "", false, "Europe/Samara", null, null, "Russia Time Zone 3" },
                { new Guid("8703fe1c-31b0-4d08-bfd2-15c2c20c36ac"), "", null, null, "", false, "Asia/Baku", null, null, "Azerbaijan Standard Time" },
                { new Guid("37a3ba97-de16-4f2c-99fc-580b911884f1"), "", null, null, "", false, "Europe/Astrakhan", null, null, "Astrakhan Standard Time" },
                { new Guid("595a9de1-fdf1-4473-bdc2-504bfe293e7b"), "", null, null, "", false, "Asia/Dubai", null, null, "Arabian Standard Time" },
                { new Guid("83566e45-b8b4-4a8c-9e17-6c42311cc4bf"), "", null, null, "", false, "Asia/Tehran", null, null, "Iran Standard Time" },
                { new Guid("5a67d9ae-1912-4fd6-9bfa-0f21a6fb60bf"), "", null, null, "", false, "Africa/Nairobi", null, null, "E. Africa Standard Time" },
                { new Guid("fe9ec1b0-6667-4b4b-90fe-d2b6ae8cbf29"), "", null, null, "", false, "Europe/Moscow", null, null, "Russian Standard Time" },
                { new Guid("6824a9c3-554c-454f-aa10-3637556c7693"), "", null, null, "", false, "Europe/Minsk", null, null, "Belarus Standard Time" },
                { new Guid("0f9a1bed-59ee-4e32-8f9e-640990d937af"), "", null, null, "", false, "Asia/Riyadh", null, null, "Arab Standard Time" },
                { new Guid("2f824e67-1085-4cbf-af61-d7c9f1700780"), "", null, null, "", false, "Europe/Istanbul", null, null, "Turkey Standard Time" },
                { new Guid("4fadd29b-bd9d-4357-963a-d9a6c57e647c"), "", null, null, "", false, "Asia/Kabul", null, null, "Afghanistan Standard Time" },
                { new Guid("430b49e8-9bf6-43ad-a2dd-2a12cade7289"), "", null, null, "", false, "Asia/Shanghai", null, null, "China Standard Time" },
                { new Guid("bc85d639-d9be-4fef-aa23-300a8e0e31a8"), "", null, null, "", false, "Asia/Irkutsk", null, null, "North Asia East Standard Time" },
                { new Guid("8f6b8895-d235-4759-afc6-4af6447f21d8"), "", null, null, "", false, "Asia/Singapore", null, null, "Singapore Standard Time" },
                { new Guid("0a8d338b-afef-4857-a768-bf1112ea09f3"), "", null, null, "", false, "Pacific/Tongatapu", null, null, "Tonga Standard Time" },
                { new Guid("915ea2d2-ed24-44d9-87c8-4561ada2bfc2"), "", null, null, "", false, "Etc/GMT-13", null, null, "UTC+13" },
                { new Guid("b93c23af-4576-4c75-a38b-0a66ad7487e3"), "", null, null, "", false, "Pacific/Chatham", null, null, "Chatham Islands Standard Time" },
                { new Guid("7429a91c-e629-43f1-86de-bec14ba0e9f8"), "", null, null, "", false, "Asia/Kamchatka", null, null, "Kamchatka Standard Time" },
                { new Guid("8db6ce68-d142-4ae1-8ca6-ec1cfff1f9cd"), "", null, null, "", false, "Pacific/Fiji", null, null, "Fiji Standard Time" },
                { new Guid("df7551fe-0bf4-4e09-b7de-17eb4d0f2cc9"), "", null, null, "", false, "Etc/GMT-12", null, null, "UTC+12" },
                { new Guid("5ddad745-2f07-4f0c-a423-9018c7428675"), "", null, null, "", false, "Pacific/Auckland", null, null, "New Zealand Standard Time" }
            });

            migrationBuilder.InsertData(
                table: "TimeZoneIds",
                columns: new[] { "Id", "CreatedBy", "CreatedOn", "DeleteOn", "DeletedBy", "IsDeleted", "LinuxTimeZone", "UpdatedBy", "UpdatedOn", "WindowsTimeZone" },
                values: new object[, ]
            {
                { new Guid("76490d08-74bc-424a-b17d-79172e2e05c6"), "", null, null, "", false, "Asia/Kamchatka", null, null, "Russia Time Zone 11" },
                { new Guid("eb158c7c-9435-48a6-9265-fa18d2573866"), "", null, null, "", false, "Pacific/Guadalcanal", null, null, "Central Pacific Standard Time" },
                { new Guid("e3bc0f52-9b0b-4068-b3cf-3c55a3e1ba7f"), "", null, null, "", false, "Asia/Sakhalin", null, null, "Sakhalin Standard Time" },
                { new Guid("77c2370d-967a-4a90-93b7-6276f9ef0d9e"), "", null, null, "", false, "Pacific/Norfolk", null, null, "Norfolk Standard Time" },
                { new Guid("45151e3d-6ab2-402f-87b1-29fcc8fd4c01"), "", null, null, "", false, "Asia/Magadan", null, null, "Magadan Standard Time" },
                { new Guid("d5110a8a-b1d9-4802-99bf-f30921c3233a"), "", null, null, "", false, "Asia/Srednekolymsk", null, null, "Russia Time Zone 10" },
                { new Guid("01cda1bb-af59-46c1-aed8-909291f05d17"), "", null, null, "", false, "Pacific/Bougainville", null, null, "Bougainville Standard Time" },
                { new Guid("b10b704c-e106-440b-854e-10eb43ca42ff"), "", null, null, "", false, "Australia/Lord_Howe", null, null, "Lord Howe Standard Time" },
                { new Guid("2ce7b70e-682c-4918-b7f2-43d513a754e9"), "", null, null, "", false, "Asia/Vladivostok", null, null, "Vladivostok Standard Time" },
                { new Guid("7d799c40-db4e-4a41-8b2e-6dde44b6796b"), "", null, null, "", false, "Australia/Hobart", null, null, "Tasmania Standard Time" },
                { new Guid("e1bddf3f-e60d-4c9e-add8-77bbf933e64f"), "", null, null, "", false, "Australia/Perth", null, null, "W. Australia Standard Time" },
                { new Guid("cc9ad20c-d754-454f-8623-871eef6cdac6"), "", null, null, "", false, "Asia/Taipei", null, null, "Taipei Standard Time" },
                { new Guid("db26063b-a3ed-4220-bb1b-ddabe33a96bd"), "", null, null, "", false, "Asia/Ulaanbaatar", null, null, "Ulaanbaatar Standard Time" },
                { new Guid("8e680df0-62d5-474d-abaf-e77c38805ef5"), "", null, null, "", false, "Asia/Pyongyang", null, null, "North Korea Standard Time" },
                { new Guid("62c1ec8d-fb5d-42f4-996b-b596b7067672"), "", null, null, "", false, "Australia/Eucla", null, null, "Aus Central W. Standard Time" },
                { new Guid("e241b1ce-94ff-488f-a4d4-ceaf7427e6bd"), "", null, null, "", false, "Asia/Chita", null, null, "Transbaikal Standard Time" },
                { new Guid("8579cdbc-63b1-4767-87a8-6dfc7c4458cc"), "", null, null, "", false, "Asia/Baghdad", null, null, "Arabic Standard Time" },
                { new Guid("cc96a162-8ecb-4a7c-8849-0703a94e66a5"), "", null, null, "", false, "Asia/Tokyo", null, null, "Tokyo Standard Time" },
                { new Guid("2f6b18ce-71e0-47b7-a231-929e1747f828"), "", null, null, "", false, "Asia/Yakutsk", null, null, "Yakutsk Standard Time" },
                { new Guid("b3cd7fa6-8c85-4632-83d8-db27215285c9"), "", null, null, "", false, "Australia/Adelaide", null, null, "Cen. Australia Standard Time" },
                { new Guid("fb3d8734-3f4b-4b78-8dfb-f7d2a2f6fedd"), "", null, null, "", false, "Australia/Darwin", null, null, "AUS Central Standard Time" },
                { new Guid("e7aeba45-148f-4f62-a4e6-b219484edd22"), "", null, null, "", false, "Australia/Brisbane", null, null, "E. Australia Standard Time" },
                { new Guid("817c73a2-de57-4317-8065-1ea1b1e488a3"), "", null, null, "", false, "Australia/Sydney", null, null, "AUS Eastern Standard Time" },
                { new Guid("bbe24d96-bbae-4a44-8797-463393778913"), "", null, null, "", false, "Pacific/Port_Moresby", null, null, "West Pacific Standard Time" },
                { new Guid("335b42b7-b500-44bd-9b0d-f63edf43f95e"), "", null, null, "", false, "Asia/Seoul", null, null, "Korea Standard Time" },
                { new Guid("771a3ccd-82fc-4076-928e-f656319b8dfc"), "", null, null, "", false, "Pacific/Apia", null, null, "Samoa Standard Time" },
                { new Guid("f8266866-d51f-467b-aa48-65b4d65d4035"), "", null, null, "", false, "Africa/Windhoek", null, null, "Namibia Standard Time" },
                { new Guid("ab0629db-64ae-4f40-b762-a94490a2ba7b"), "", null, null, "", false, "Africa/Khartoum", null, null, "Sudan Standard Time" },
                { new Guid("523dc3bf-d466-4dc9-8026-4f903698687d"), "", null, null, "", false, "America/Santiago", null, null, "Pacific SA Standard Time" },
                { new Guid("5c249f6d-54b9-4668-9aff-6dd901cea611"), "", null, null, "", false, "America/La_Paz", null, null, "SA Western Standard Time" },
                { new Guid("ea409e06-e791-42a1-b9ee-ed139f0949d8"), "", null, null, "", false, "America/Cuiaba", null, null, "Central Brazilian Standard Time" },
                { new Guid("510d78f1-767b-4b1f-a7c8-bd0c6929ece1"), "", null, null, "", false, "America/Caracas", null, null, "Venezuela Standard Time" },
                { new Guid("22c0747e-130b-4dcd-aa59-8ebc1647c1bc"), "", null, null, "", false, "America/Halifax", null, null, "Atlantic Standard Time" },
                { new Guid("a55a539d-5019-4481-93c4-76382ae9f11a"), "", null, null, "", false, "America/Asuncion", null, null, "Paraguay Standard Time" },
                { new Guid("b51086ff-d5d9-49a0-81ad-bfd9df653147"), "", null, null, "", false, "America/Grand_Turk", null, null, "Turks And Caicos Standard Time" },
                { new Guid("8a80206b-ff9d-4032-aa22-191b45d1062a"), "", null, null, "", false, "America/Indiana/Indianapolis", null, null, "US Eastern Standard Time" },
                { new Guid("057b7481-411e-4844-8c61-356bf72421f4"), "", null, null, "", false, "America/Havana", null, null, "Cuba Standard Time" },
                { new Guid("72192e08-441c-4894-a9eb-abd288e0ee5a"), "", null, null, "", false, "America/Port-au-Prince", null, null, "Haiti Standard Time" },
                { new Guid("595c42d5-b121-4928-90f1-3b84ecc46dc8"), "", null, null, "", false, "America/New_York", null, null, "Eastern Standard Time" },
                { new Guid("aca817d9-d6bd-4f47-b9ab-c2330155d6f5"), "", null, null, "", false, "America/Cancun", null, null, "Eastern Standard Time (Mexico)" },
                { new Guid("7082877a-dfb1-4dea-8dfb-753a6bb1498a"), "", null, null, "", false, "America/Bogota", null, null, "SA Pacific Standard Time" },
                { new Guid("6facd92b-35e7-4330-b5f6-66cc10fb906f"), "", null, null, "", false, "America/Regina", null, null, "Canada Central Standard Time" }
            });

            migrationBuilder.InsertData(
                table: "TimeZoneIds",
                columns: new[] { "Id", "CreatedBy", "CreatedOn", "DeleteOn", "DeletedBy", "IsDeleted", "LinuxTimeZone", "UpdatedBy", "UpdatedOn", "WindowsTimeZone" },
                values: new object[, ]
            {
                { new Guid("ec4d615c-ac2f-43ae-bf20-5342abcb7e9d"), "", null, null, "", false, "America/St_Johns", null, null, "Newfoundland Standard Time" },
                { new Guid("b067b3aa-cf05-4f6a-8afc-1d0468ea9d47"), "", null, null, "", false, "America/Mexico_City", null, null, "Central Standard Time (Mexico)" },
                { new Guid("52ed8785-b9bc-4f8e-a0a8-87d062a923ee"), "", null, null, "", false, "America/Chicago", null, null, "Central Standard Time" },
                { new Guid("3b8c4662-c0db-4f78-97d5-14bb57e4ba4d"), "", null, null, "", false, "America/Guatemala", null, null, "Central America Standard Time" },
                { new Guid("6707ce53-1823-4a3e-ab44-c7b69f666b55"), "", null, null, "", false, "America/Denver", null, null, "Mountain Standard Time" },
                { new Guid("2a48c9c9-53bb-41d2-8d5d-97a0d65e05b9"), "", null, null, "", false, "America/Chihuahua", null, null, "Mountain Standard Time (Mexico)" },
                { new Guid("3cc6aff3-0ee0-4a1b-bdb9-52327f91499b"), "", null, null, "", false, "America/Phoenix", null, null, "US Mountain Standard Time" },
                { new Guid("007b8faf-d2ff-48dd-89fc-326f8ce378a6"), "", null, null, "", false, "America/Los_Angeles", null, null, "Pacific Standard Time" },
                { new Guid("87346558-d1fc-4abe-8a88-cca1155059ea"), "", null, null, "", false, "Etc/GMT+8", null, null, "UTC-08" },
                { new Guid("ea815bcf-045d-499a-859a-88415dde3762"), "", null, null, "", false, "America/Tijuana", null, null, "Pacific Standard Time (Mexico)" },
                { new Guid("da977f50-6106-4571-9c09-aed5f6d6681a"), "", null, null, "", false, "Etc/GMT+9", null, null, "UTC-09" },
                { new Guid("14f88b2b-050e-41d8-954b-f238c833c2e1"), "", null, null, "", false, "America/Anchorage", null, null, "Alaskan Standard Time" },
                { new Guid("a6f0e54a-15b5-403a-98a5-5215b49f5eb3"), "", null, null, "", false, "Pacific/Marquesas", null, null, "Marquesas Standard Time" },
                { new Guid("8ee1dbc3-3e8f-43e6-8c3a-5c29ab0a16d4"), "", null, null, "", false, "Pacific/Honolulu", null, null, "Hawaiian Standard Time" },
                { new Guid("bc04578d-cf07-4b47-8c63-dff36e627d7a"), "", null, null, "", false, "America/Adak", null, null, "Aleutian Standard Time" },
                { new Guid("1f1b49ba-42fe-4ebc-8a04-a0f284bab4fa"), "", null, null, "", false, "Etc/GMT+11", null, null, "UTC-11" },
                { new Guid("b50bcda1-4f29-42a9-bc94-ec22094821d3"), "", null, null, "", false, "Pacific/Easter", null, null, "Easter Island Standard Time" },
                { new Guid("07d91ce7-6172-4bb9-839d-0e065b15537d"), "", null, null, "", false, "America/Araguaina", null, null, "Tocantins Standard Time" },
                { new Guid("8ce50175-08d5-4ed4-8179-4799a769bc16"), "", null, null, "", false, "America/Sao_Paulo", null, null, "E. South America Standard Time" },
                { new Guid("ac15fc92-8675-4066-83bd-6d1c4b4f653e"), "", null, null, "", false, "America/Cayenne", null, null, "SA Eastern Standard Time" },
                { new Guid("03a5871b-5e64-48c4-8ff5-54fd25fa91ed"), "", null, null, "", false, "Europe/Kaliningrad", null, null, "Kaliningrad Standard Time" },
                { new Guid("7ba53547-8cf1-4ddd-b619-9cad56e3b7ca"), "", null, null, "", false, "Asia/Jerusalem", null, null, "Israel Standard Time" },
                { new Guid("5c0d4a10-b68f-4317-b9a4-458549eaea56"), "", null, null, "", false, "Europe/Kiev", null, null, "FLE Standard Time" },
                { new Guid("045dd95b-7b47-4125-a85b-a38174edb2cd"), "", null, null, "", false, "Africa/Johannesburg", null, null, "South Africa Standard Time" },
                { new Guid("1a99b116-247d-43d2-90eb-850c5f766583"), "", null, null, "", false, "Asia/Hebron", null, null, "West Bank Standard Time" },
                { new Guid("4bbce910-2fff-4c1d-80a0-9dfefa6b2b17"), "", null, null, "", false, "Asia/Damascus", null, null, "Syria Standard Time" },
                { new Guid("9b00ecd4-6c61-448d-8ca1-b8f25e1c7a67"), "", null, null, "", false, "Europe/Chisinau", null, null, "E. Europe Standard Time" },
                { new Guid("21622977-4a88-4871-9c6d-e74d27418213"), "", null, null, "", false, "Africa/Cairo", null, null, "Egypt Standard Time" },
                { new Guid("bbf8464b-3375-4806-8eb8-bc9d2dc55587"), "", null, null, "", false, "Asia/Beirut", null, null, "Middle East Standard Time" },
                { new Guid("f8d3b72b-e9a8-419c-9661-8b93910e49f2"), "", null, null, "", false, "Europe/Bucharest", null, null, "GTB Standard Time" },
                { new Guid("56a5ab66-5342-401c-b50d-5a91f42278db"), "", null, null, "", false, "Asia/Amman", null, null, "Jordan Standard Time" },
                { new Guid("bca456e1-6369-44cc-b14b-5b224f887c55"), "", null, null, "", false, "Africa/Lagos", null, null, "W. Central Africa Standard Time" },
                { new Guid("88208c66-9143-4b05-a3ba-5d4eeb88e470"), "", null, null, "", false, "Europe/Warsaw", null, null, "Central European Standard Time" },
                { new Guid("26670d75-806a-4448-bcc7-d59f68bb934d"), "", null, null, "", false, "Africa/Sao_Tome", null, null, "Sao Tome Standard Time" },
                { new Guid("087d8bb4-b3b1-4d4c-9320-85529bef6851"), "", null, null, "", false, "Europe/Paris", null, null, "Romance Standard Time" },
                { new Guid("725d1053-cf48-4b6c-824d-47c9621bb3c3"), "", null, null, "", false, "Europe/Budapest", null, null, "Central Europe Standard Time" },
                { new Guid("aec5f57e-3f2c-4f20-9c7b-1b0d4a7ee578"), "", null, null, "", false, "Europe/Berlin", null, null, "W. Europe Standard Time" },
                { new Guid("d88794b9-b7c9-44c2-9d15-a5090ccf203b"), "", null, null, "", false, "America/Argentina/Buenos_Aires", null, null, "Argentina Standard Time" },
                { new Guid("b38139b2-1732-4f60-a0ee-02b7f260c6be"), "", null, null, "", false, "America/Godthab", null, null, "Greenland Standard Time" },
                { new Guid("1137b09c-f374-4d12-83b0-738dd3df13db"), "", null, null, "", false, "America/Montevideo", null, null, "Montevideo Standard Time" },
                { new Guid("6295312e-24c1-45f6-9d47-450cf1499b77"), "", null, null, "", false, "America/Punta_Arenas", null, null, "Magallanes Standard Time" },
                { new Guid("a48e6175-2a6b-4e0d-8dfe-c42fe3ab8a9a"), "", null, null, "", false, "America/Miquelon", null, null, "Saint Pierre Standard Time" }
            });

            migrationBuilder.InsertData(
                table: "TimeZoneIds",
                columns: new[] { "Id", "CreatedBy", "CreatedOn", "DeleteOn", "DeletedBy", "IsDeleted", "LinuxTimeZone", "UpdatedBy", "UpdatedOn", "WindowsTimeZone" },
                values: new object[, ]
            {
                { new Guid("60c50feb-5910-4f52-9708-7c04b481be9a"), "", null, null, "", false, "America/Bahia", null, null, "Bahia Standard Time" },
                { new Guid("6c325b2e-d5df-4bee-a949-fe04196b2f72"), "", null, null, "", false, "Africa/Tripoli", null, null, "Libya Standard Time" },
                { new Guid("794f7afb-10e4-4c44-a31c-f3aaa5abd3c1"), "", null, null, "", false, "Etc/GMT+2", null, null, "UTC-02" },
                { new Guid("96591d59-0c46-4c05-9c19-50c0be8400e9"), "", null, null, "", false, "Atlantic/Azores", null, null, "Azores Standard Time" },
                { new Guid("b8c8fafe-4ffc-43be-a927-74122917e6c7"), "", null, null, "", false, "Atlantic/Cape_Verde", null, null, "Cape Verde Standard Time" },
                { new Guid("5c2df02b-a1b2-4ac2-bdea-f325de70d890"), "", null, null, "", false, "Etc/UTC", null, null, "UTC" },
                { new Guid("cfad21a5-94a9-4739-baf6-465e1491b152"), "", null, null, "", false, "Africa/Casablanca", null, null, "Morocco Standard Time" },
                { new Guid("ddc8f45a-cc5d-443f-b098-0582a95f347a"), "", null, null, "", false, "Europe/London", null, null, "GMT Standard Time" },
                { new Guid("1111ae41-cce8-4897-a605-851bfa68a70c"), "", null, null, "", false, "Atlantic/Reykjavik", null, null, "Greenwich Standard Time" },
                { new Guid("ed1ea194-4689-4ee4-b4a6-b546334a3489"), "", null, null, "", false, "Etc/GMT+2", null, null, "Mid-Atlantic Standard Time" },
                { new Guid("e793b6b9-8db8-45d6-92e2-a3d496f9dd9b"), "", null, null, "", false, "Pacific/Kiritimati", null, null, "Line Islands Standard Time" }
            });
        }
コード例 #10
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Roles_Usuarios_IDUsuarioRole",
                table: "Roles");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Roles",
                table: "Roles");

            migrationBuilder.RenameTable(
                name: "Roles",
                newName: "RolesUser");

            migrationBuilder.RenameIndex(
                name: "IX_Roles_IDUsuarioRole",
                table: "RolesUser",
                newName: "IX_RolesUser_IDUsuarioRole");

            migrationBuilder.AddPrimaryKey(
                name: "PK_RolesUser",
                table: "RolesUser",
                column: "ID");

            migrationBuilder.CreateTable(
                name: "AspNetRoles",
                columns: table => new
            {
                Id               = table.Column <string>(type: "nvarchar(450)", nullable: false),
                Name             = table.Column <string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                NormalizedName   = table.Column <string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                ConcurrencyStamp = table.Column <string>(type: "nvarchar(max)", nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetRoles", x => x.Id);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUsers",
                columns: table => new
            {
                Id                   = table.Column <string>(type: "nvarchar(450)", nullable: false),
                UserName             = table.Column <string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                NormalizedUserName   = table.Column <string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                Email                = table.Column <string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                NormalizedEmail      = table.Column <string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
                EmailConfirmed       = table.Column <bool>(type: "bit", nullable: false),
                PasswordHash         = table.Column <string>(type: "nvarchar(max)", nullable: true),
                SecurityStamp        = table.Column <string>(type: "nvarchar(max)", nullable: true),
                ConcurrencyStamp     = table.Column <string>(type: "nvarchar(max)", nullable: true),
                PhoneNumber          = table.Column <string>(type: "nvarchar(max)", nullable: true),
                PhoneNumberConfirmed = table.Column <bool>(type: "bit", nullable: false),
                TwoFactorEnabled     = table.Column <bool>(type: "bit", nullable: false),
                LockoutEnd           = table.Column <DateTimeOffset>(type: "datetimeoffset", nullable: true),
                LockoutEnabled       = table.Column <bool>(type: "bit", nullable: false),
                AccessFailedCount    = table.Column <int>(type: "int", nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUsers", x => x.Id);
            });

            migrationBuilder.CreateTable(
                name: "AspNetRoleClaims",
                columns: table => new
            {
                Id = table.Column <int>(type: "int", nullable: false)
                     .Annotation("SqlServer:Identity", "1, 1"),
                RoleId     = table.Column <string>(type: "nvarchar(450)", nullable: false),
                ClaimType  = table.Column <string>(type: "nvarchar(max)", nullable: true),
                ClaimValue = table.Column <string>(type: "nvarchar(max)", nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
                table.ForeignKey(
                    name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
                    column: x => x.RoleId,
                    principalTable: "AspNetRoles",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserClaims",
                columns: table => new
            {
                Id = table.Column <int>(type: "int", nullable: false)
                     .Annotation("SqlServer:Identity", "1, 1"),
                UserId     = table.Column <string>(type: "nvarchar(450)", nullable: false),
                ClaimType  = table.Column <string>(type: "nvarchar(max)", nullable: true),
                ClaimValue = table.Column <string>(type: "nvarchar(max)", nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
                table.ForeignKey(
                    name: "FK_AspNetUserClaims_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserLogins",
                columns: table => new
            {
                LoginProvider       = table.Column <string>(type: "nvarchar(450)", nullable: false),
                ProviderKey         = table.Column <string>(type: "nvarchar(450)", nullable: false),
                ProviderDisplayName = table.Column <string>(type: "nvarchar(max)", nullable: true),
                UserId = table.Column <string>(type: "nvarchar(450)", nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
                table.ForeignKey(
                    name: "FK_AspNetUserLogins_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserRoles",
                columns: table => new
            {
                UserId = table.Column <string>(type: "nvarchar(450)", nullable: false),
                RoleId = table.Column <string>(type: "nvarchar(450)", nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
                table.ForeignKey(
                    name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
                    column: x => x.RoleId,
                    principalTable: "AspNetRoles",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
                table.ForeignKey(
                    name: "FK_AspNetUserRoles_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserTokens",
                columns: table => new
            {
                UserId        = table.Column <string>(type: "nvarchar(450)", nullable: false),
                LoginProvider = table.Column <string>(type: "nvarchar(450)", nullable: false),
                Name          = table.Column <string>(type: "nvarchar(450)", nullable: false),
                Value         = table.Column <string>(type: "nvarchar(max)", nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
                table.ForeignKey(
                    name: "FK_AspNetUserTokens_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateIndex(
                name: "IX_AspNetRoleClaims_RoleId",
                table: "AspNetRoleClaims",
                column: "RoleId");

            migrationBuilder.CreateIndex(
                name: "RoleNameIndex",
                table: "AspNetRoles",
                column: "NormalizedName",
                unique: true,
                filter: "[NormalizedName] IS NOT NULL");

            migrationBuilder.CreateIndex(
                name: "IX_AspNetUserClaims_UserId",
                table: "AspNetUserClaims",
                column: "UserId");

            migrationBuilder.CreateIndex(
                name: "IX_AspNetUserLogins_UserId",
                table: "AspNetUserLogins",
                column: "UserId");

            migrationBuilder.CreateIndex(
                name: "IX_AspNetUserRoles_RoleId",
                table: "AspNetUserRoles",
                column: "RoleId");

            migrationBuilder.CreateIndex(
                name: "EmailIndex",
                table: "AspNetUsers",
                column: "NormalizedEmail");

            migrationBuilder.CreateIndex(
                name: "UserNameIndex",
                table: "AspNetUsers",
                column: "NormalizedUserName",
                unique: true,
                filter: "[NormalizedUserName] IS NOT NULL");

            migrationBuilder.AddForeignKey(
                name: "FK_RolesUser_Usuarios_IDUsuarioRole",
                table: "RolesUser",
                column: "IDUsuarioRole",
                principalTable: "Usuarios",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #11
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_RecipeIngredient_Ingredient_IngredientId_IngredientName",
                table: "RecipeIngredient");

            migrationBuilder.DropIndex(
                name: "IX_RecipeIngredient_IngredientId_IngredientName",
                table: "RecipeIngredient");

            migrationBuilder.DropIndex(
                name: "IX_Ingredient_IngredientId",
                table: "Ingredient");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Ingredient",
                table: "Ingredient");

            migrationBuilder.DropUniqueConstraint(
                name: "AK_Ingredient_IngredientID",
                table: "Ingredient");

            migrationBuilder.AddColumn <string>(
                name: "IngredientID2",
                table: "Ingredient",
                nullable: true);

            migrationBuilder.Sql("update Ingredient set IngredientID2 = IngredientID");

            migrationBuilder.DropColumn(
                name: "IngredientID",
                table: "Ingredient");

            migrationBuilder.RenameColumn(
                name: "IngredientID2",
                table: "Ingredient",
                newName: "IngredientID");

            migrationBuilder.AlterColumn <int>(
                name: "IngredientID",
                table: "Ingredient",
                nullable: false,
                oldClrType: typeof(int))
            .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            /*migrationBuilder.AlterColumn<int>(
             *  name: "IngredientID",
             *  table: "Ingredient",
             *  nullable: false,
             *  oldClrType: typeof(int))
             *  .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);*/

            migrationBuilder.AddPrimaryKey(
                name: "PK_Ingredient",
                table: "Ingredient",
                columns: new[] { "IngredientID", "Name" });

            migrationBuilder.CreateIndex(
                name: "IX_RecipeIngredient_IngredientID_IngredientName",
                table: "RecipeIngredient",
                columns: new[] { "IngredientID", "IngredientName" });

            migrationBuilder.CreateIndex(
                name: "IX_Ingredient_IngredientID",
                table: "Ingredient",
                column: "IngredientID");

            migrationBuilder.AddForeignKey(
                name: "FK_RecipeIngredient_Ingredient_IngredientID_IngredientName",
                table: "RecipeIngredient",
                columns: new[] { "IngredientID", "IngredientName" },
                principalTable: "Ingredient",
                principalColumns: new[] { "IngredientID", "Name" },
                onDelete: ReferentialAction.Restrict);
        }
コード例 #12
0
ファイル: 20190618083958_m2m2.cs プロジェクト: Zepsen/parser
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_PersonHave_Haves_HaveId",
                table: "PersonHave");

            migrationBuilder.DropForeignKey(
                name: "FK_PersonHave_Persons_PersonId",
                table: "PersonHave");

            migrationBuilder.DropForeignKey(
                name: "FK_PersonInterest_Interests_InterestId",
                table: "PersonInterest");

            migrationBuilder.DropForeignKey(
                name: "FK_PersonInterest_Persons_PersonId",
                table: "PersonInterest");

            migrationBuilder.DropForeignKey(
                name: "FK_PersonLanguage_Languages_LanguageId",
                table: "PersonLanguage");

            migrationBuilder.DropForeignKey(
                name: "FK_PersonLanguage_Persons_PersonId",
                table: "PersonLanguage");

            migrationBuilder.DropForeignKey(
                name: "FK_PersonWant_Persons_PersonId",
                table: "PersonWant");

            migrationBuilder.DropForeignKey(
                name: "FK_PersonWant_Wants_WantId",
                table: "PersonWant");

            migrationBuilder.DropPrimaryKey(
                name: "PK_PersonWant",
                table: "PersonWant");

            migrationBuilder.DropPrimaryKey(
                name: "PK_PersonLanguage",
                table: "PersonLanguage");

            migrationBuilder.DropPrimaryKey(
                name: "PK_PersonInterest",
                table: "PersonInterest");

            migrationBuilder.DropPrimaryKey(
                name: "PK_PersonHave",
                table: "PersonHave");

            migrationBuilder.RenameTable(
                name: "PersonWant",
                newName: "PersonWants");

            migrationBuilder.RenameTable(
                name: "PersonLanguage",
                newName: "PersonLanguages");

            migrationBuilder.RenameTable(
                name: "PersonInterest",
                newName: "PersonInterests");

            migrationBuilder.RenameTable(
                name: "PersonHave",
                newName: "PersonHaves");

            migrationBuilder.RenameIndex(
                name: "IX_PersonWant_WantId",
                table: "PersonWants",
                newName: "IX_PersonWants_WantId");

            migrationBuilder.RenameIndex(
                name: "IX_PersonLanguage_LanguageId",
                table: "PersonLanguages",
                newName: "IX_PersonLanguages_LanguageId");

            migrationBuilder.RenameIndex(
                name: "IX_PersonInterest_InterestId",
                table: "PersonInterests",
                newName: "IX_PersonInterests_InterestId");

            migrationBuilder.RenameIndex(
                name: "IX_PersonHave_HaveId",
                table: "PersonHaves",
                newName: "IX_PersonHaves_HaveId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_PersonWants",
                table: "PersonWants",
                columns: new[] { "PersonId", "WantId" });

            migrationBuilder.AddPrimaryKey(
                name: "PK_PersonLanguages",
                table: "PersonLanguages",
                columns: new[] { "PersonId", "LanguageId" });

            migrationBuilder.AddPrimaryKey(
                name: "PK_PersonInterests",
                table: "PersonInterests",
                columns: new[] { "PersonId", "InterestId" });

            migrationBuilder.AddPrimaryKey(
                name: "PK_PersonHaves",
                table: "PersonHaves",
                columns: new[] { "PersonId", "HaveId" });

            migrationBuilder.AddForeignKey(
                name: "FK_PersonHaves_Haves_HaveId",
                table: "PersonHaves",
                column: "HaveId",
                principalTable: "Haves",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PersonHaves_Persons_PersonId",
                table: "PersonHaves",
                column: "PersonId",
                principalTable: "Persons",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PersonInterests_Interests_InterestId",
                table: "PersonInterests",
                column: "InterestId",
                principalTable: "Interests",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PersonInterests_Persons_PersonId",
                table: "PersonInterests",
                column: "PersonId",
                principalTable: "Persons",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PersonLanguages_Languages_LanguageId",
                table: "PersonLanguages",
                column: "LanguageId",
                principalTable: "Languages",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PersonLanguages_Persons_PersonId",
                table: "PersonLanguages",
                column: "PersonId",
                principalTable: "Persons",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PersonWants_Persons_PersonId",
                table: "PersonWants",
                column: "PersonId",
                principalTable: "Persons",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_PersonWants_Wants_WantId",
                table: "PersonWants",
                column: "WantId",
                principalTable: "Wants",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #13
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Alumnos_Niveles_IdNivel",
                table: "Alumnos");

            migrationBuilder.DropForeignKey(
                name: "FK_Clases_Topics_IdTopic",
                table: "Clases");

            migrationBuilder.DropForeignKey(
                name: "FK_TopicsSemanasTopics_SemanasTopics_IdSemanaTopics",
                table: "TopicsSemanasTopics");

            migrationBuilder.DropForeignKey(
                name: "FK_TopicsSemanasTopics_Topics_IdTopic",
                table: "TopicsSemanasTopics");

            migrationBuilder.DropTable(
                name: "Niveles");

            migrationBuilder.DropIndex(
                name: "IX_Alumnos_IdNivel",
                table: "Alumnos");

            migrationBuilder.DropPrimaryKey(
                name: "PK_TopicsSemanasTopics",
                table: "TopicsSemanasTopics");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Topics",
                table: "Topics");

            migrationBuilder.DropPrimaryKey(
                name: "PK_SemanasTopics",
                table: "SemanasTopics");

            migrationBuilder.DropColumn(
                name: "IdNivel",
                table: "Alumnos");

            migrationBuilder.RenameTable(
                name: "TopicsSemanasTopics",
                newName: "TopicSemanaTopics");

            migrationBuilder.RenameTable(
                name: "Topics",
                newName: "Topic");

            migrationBuilder.RenameTable(
                name: "SemanasTopics",
                newName: "SemanaTopics");

            migrationBuilder.RenameIndex(
                name: "IX_TopicsSemanasTopics_IdTopic",
                table: "TopicSemanaTopics",
                newName: "IX_TopicSemanaTopics_IdTopic");

            migrationBuilder.RenameIndex(
                name: "IX_TopicsSemanasTopics_IdSemanaTopics",
                table: "TopicSemanaTopics",
                newName: "IX_TopicSemanaTopics_IdSemanaTopics");

            migrationBuilder.AddPrimaryKey(
                name: "PK_TopicSemanaTopics",
                table: "TopicSemanaTopics",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Topic",
                table: "Topic",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_SemanaTopics",
                table: "SemanaTopics",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Clases_Topic_IdTopic",
                table: "Clases",
                column: "IdTopic",
                principalTable: "Topic",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_TopicSemanaTopics_SemanaTopics_IdSemanaTopics",
                table: "TopicSemanaTopics",
                column: "IdSemanaTopics",
                principalTable: "SemanaTopics",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_TopicSemanaTopics_Topic_IdTopic",
                table: "TopicSemanaTopics",
                column: "IdTopic",
                principalTable: "Topic",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #14
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Prices_ShopProducts_ProductInShopId",
                table: "Prices");

            migrationBuilder.DropForeignKey(
                name: "FK_ShopProducts_Products_ProductId",
                table: "ShopProducts");

            migrationBuilder.DropForeignKey(
                name: "FK_ShopProducts_Shops_ShopId",
                table: "ShopProducts");

            migrationBuilder.DropPrimaryKey(
                name: "PK_ShopProducts",
                table: "ShopProducts");

            migrationBuilder.RenameTable(
                name: "ShopProducts",
                newName: "ProductsInShops");

            migrationBuilder.RenameIndex(
                name: "IX_ShopProducts_ShopId",
                table: "ProductsInShops",
                newName: "IX_ProductsInShops_ShopId");

            migrationBuilder.RenameIndex(
                name: "IX_ShopProducts_ProductId_ShopId",
                table: "ProductsInShops",
                newName: "IX_ProductsInShops_ProductId_ShopId");

            migrationBuilder.AddColumn <int>(
                name: "Hash",
                table: "Products",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddPrimaryKey(
                name: "PK_ProductsInShops",
                table: "ProductsInShops",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Prices_ProductsInShops_ProductInShopId",
                table: "Prices",
                column: "ProductInShopId",
                principalTable: "ProductsInShops",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_ProductsInShops_Products_ProductId",
                table: "ProductsInShops",
                column: "ProductId",
                principalTable: "Products",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_ProductsInShops_Shops_ShopId",
                table: "ProductsInShops",
                column: "ShopId",
                principalTable: "Shops",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #15
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_ProjectsUsers",
                table: "ProjectsUsers");

            migrationBuilder.DropIndex(
                name: "IX_ProjectsUsers_UserId",
                table: "ProjectsUsers");

            migrationBuilder.DropColumn(
                name: "ExpireDate",
                table: "Sprints");

            migrationBuilder.AddColumn <string>(
                name: "Description",
                table: "Sprints",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn <DateTime>(
                name: "EndDate",
                table: "Sprints",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Name",
                table: "Sprints",
                nullable: false,
                defaultValue: "");

            //migrationBuilder.AddColumn<string>(
            //    name: "UserId",
            //    table: "Projects",
            //    nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Info",
                table: "AspNetUsers",
                maxLength: 1000,
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_ProjectsUsers",
                table: "ProjectsUsers",
                columns: new[] { "UserId", "ProjectId" });

            migrationBuilder.CreateIndex(
                name: "IX_ProjectsUsers_ProjectId",
                table: "ProjectsUsers",
                column: "ProjectId");

            //migrationBuilder.CreateIndex(
            //    name: "IX_Projects_UserId",
            //    table: "Projects",
            //    column: "UserId");

            //migrationBuilder.AddForeignKey(
            //    name: "FK_Projects_AspNetUsers_UserId",
            //    table: "Projects",
            //    column: "UserId",
            //    principalTable: "AspNetUsers",
            //    principalColumn: "Id",
            //    onDelete: ReferentialAction.Restrict);
        }
コード例 #16
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_Users",
                table: "Users");

            migrationBuilder.RenameTable(
                name: "Users",
                newName: "AspNetUsers");

            migrationBuilder.AddColumn <int>(
                name: "AccessFailedCount",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn <string>(
                name: "ConcurrencyStamp",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Email",
                table: "AspNetUsers",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddColumn <bool>(
                name: "EmailConfirmed",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn <bool>(
                name: "LockoutEnabled",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn <DateTimeOffset>(
                name: "LockoutEnd",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "NormalizedEmail",
                table: "AspNetUsers",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "NormalizedUserName",
                table: "AspNetUsers",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "PasswordHash",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "PhoneNumber",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <bool>(
                name: "PhoneNumberConfirmed",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn <string>(
                name: "SecurityStamp",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <bool>(
                name: "TwoFactorEnabled",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn <string>(
                name: "UserName",
                table: "AspNetUsers",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_AspNetUsers",
                table: "AspNetUsers",
                column: "Id");

            migrationBuilder.CreateTable(
                name: "AspNetRoles",
                columns: table => new
            {
                Id               = table.Column <Guid>(nullable: false),
                Name             = table.Column <string>(maxLength: 256, nullable: true),
                NormalizedName   = table.Column <string>(maxLength: 256, nullable: true),
                ConcurrencyStamp = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetRoles", x => x.Id);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserClaims",
                columns: table => new
            {
                Id = table.Column <int>(nullable: false)
                     .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                UserId     = table.Column <Guid>(nullable: false),
                ClaimType  = table.Column <string>(nullable: true),
                ClaimValue = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
                table.ForeignKey(
                    name: "FK_AspNetUserClaims_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserLogins",
                columns: table => new
            {
                LoginProvider       = table.Column <string>(nullable: false),
                ProviderKey         = table.Column <string>(nullable: false),
                ProviderDisplayName = table.Column <string>(nullable: true),
                UserId = table.Column <Guid>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
                table.ForeignKey(
                    name: "FK_AspNetUserLogins_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserTokens",
                columns: table => new
            {
                UserId        = table.Column <Guid>(nullable: false),
                LoginProvider = table.Column <string>(nullable: false),
                Name          = table.Column <string>(nullable: false),
                Value         = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
                table.ForeignKey(
                    name: "FK_AspNetUserTokens_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetRoleClaims",
                columns: table => new
            {
                Id = table.Column <int>(nullable: false)
                     .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                RoleId     = table.Column <Guid>(nullable: false),
                ClaimType  = table.Column <string>(nullable: true),
                ClaimValue = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
                table.ForeignKey(
                    name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
                    column: x => x.RoleId,
                    principalTable: "AspNetRoles",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "AspNetUserRoles",
                columns: table => new
            {
                UserId = table.Column <Guid>(nullable: false),
                RoleId = table.Column <Guid>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
                table.ForeignKey(
                    name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
                    column: x => x.RoleId,
                    principalTable: "AspNetRoles",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
                table.ForeignKey(
                    name: "FK_AspNetUserRoles_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateIndex(
                name: "EmailIndex",
                table: "AspNetUsers",
                column: "NormalizedEmail");

            migrationBuilder.CreateIndex(
                name: "UserNameIndex",
                table: "AspNetUsers",
                column: "NormalizedUserName",
                unique: true,
                filter: "[NormalizedUserName] IS NOT NULL");

            migrationBuilder.CreateIndex(
                name: "IX_AspNetRoleClaims_RoleId",
                table: "AspNetRoleClaims",
                column: "RoleId");

            migrationBuilder.CreateIndex(
                name: "RoleNameIndex",
                table: "AspNetRoles",
                column: "NormalizedName",
                unique: true,
                filter: "[NormalizedName] IS NOT NULL");

            migrationBuilder.CreateIndex(
                name: "IX_AspNetUserClaims_UserId",
                table: "AspNetUserClaims",
                column: "UserId");

            migrationBuilder.CreateIndex(
                name: "IX_AspNetUserLogins_UserId",
                table: "AspNetUserLogins",
                column: "UserId");

            migrationBuilder.CreateIndex(
                name: "IX_AspNetUserRoles_RoleId",
                table: "AspNetUserRoles",
                column: "RoleId");
        }
コード例 #17
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AspNetRoleClaims");

            migrationBuilder.DropTable(
                name: "AspNetUserClaims");

            migrationBuilder.DropTable(
                name: "AspNetUserLogins");

            migrationBuilder.DropTable(
                name: "AspNetUserRoles");

            migrationBuilder.DropTable(
                name: "AspNetUserTokens");

            migrationBuilder.DropTable(
                name: "AspNetRoles");

            migrationBuilder.DropPrimaryKey(
                name: "PK_AspNetUsers",
                table: "AspNetUsers");

            migrationBuilder.DropIndex(
                name: "EmailIndex",
                table: "AspNetUsers");

            migrationBuilder.DropIndex(
                name: "UserNameIndex",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "AccessFailedCount",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "ConcurrencyStamp",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "Email",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "EmailConfirmed",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "LockoutEnabled",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "LockoutEnd",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "NormalizedEmail",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "NormalizedUserName",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "PasswordHash",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "PhoneNumber",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "PhoneNumberConfirmed",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "SecurityStamp",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "TwoFactorEnabled",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "UserName",
                table: "AspNetUsers");

            migrationBuilder.RenameTable(
                name: "AspNetUsers",
                newName: "Users");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Users",
                table: "Users",
                column: "Id");
        }
コード例 #18
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_Albunes",
                table: "Albunes");

            migrationBuilder.DropColumn(
                name: "Artista",
                table: "Albunes");

            migrationBuilder.RenameTable(
                name: "Albunes",
                newName: "AlbunesEnStock");

            migrationBuilder.RenameColumn(
                name: "Nombre",
                table: "AlbunesEnStock",
                newName: "NombreAlbum");

            migrationBuilder.RenameColumn(
                name: "Id",
                table: "AlbunesEnStock",
                newName: "AlbunesEnStockId");

            migrationBuilder.AddColumn <int>(
                name: "ArtistaId",
                table: "AlbunesEnStock",
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_AlbunesEnStock",
                table: "AlbunesEnStock",
                column: "AlbunesEnStockId");

            migrationBuilder.CreateTable(
                name: "Artista",
                columns: table => new
            {
                Id = table.Column <int>(nullable: false)
                     .Annotation("SqlServer:Identity", "1, 1"),
                AnioNacimiento = table.Column <int>(nullable: false),
                Nacionalidad   = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Artista", x => x.Id);
            });

            migrationBuilder.CreateIndex(
                name: "IX_AlbunesEnStock_ArtistaId",
                table: "AlbunesEnStock",
                column: "ArtistaId");

            migrationBuilder.AddForeignKey(
                name: "FK_AlbunesEnStock_Artista_ArtistaId",
                table: "AlbunesEnStock",
                column: "ArtistaId",
                principalTable: "Artista",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
コード例 #19
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_UserJobs_Rewards_JobId",
                table: "UserJobs");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Rewards",
                table: "Rewards");

            migrationBuilder.RenameTable(
                name: "Rewards",
                newName: "Jobs");

            migrationBuilder.AddColumn <DateTime>(
                name: "BirthDate",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <string>(
                name: "FirstName",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LastName",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <Guid>(
                name: "ManagerId",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddColumn <string>(
                name: "Position",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "SecondName",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "Deadline",
                table: "Jobs",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <string>(
                name: "Description",
                table: "Jobs",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "EndTime",
                table: "Jobs",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <Guid>(
                name: "JobStatusId",
                table: "Jobs",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddColumn <string>(
                name: "Name",
                table: "Jobs",
                nullable: true);

            migrationBuilder.AddColumn <int>(
                name: "Progress",
                table: "Jobs",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn <DateTime>(
                name: "StartedTime",
                table: "Jobs",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddPrimaryKey(
                name: "PK_Jobs",
                table: "Jobs",
                column: "Id");

            migrationBuilder.CreateTable(
                name: "JobStatus",
                columns: table => new
            {
                Id    = table.Column <Guid>(nullable: false),
                Name  = table.Column <string>(nullable: true),
                Color = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_JobStatus", x => x.Id);
            });

            migrationBuilder.CreateIndex(
                name: "IX_AspNetUsers_ManagerId",
                table: "AspNetUsers",
                column: "ManagerId");

            migrationBuilder.CreateIndex(
                name: "IX_Jobs_JobStatusId",
                table: "Jobs",
                column: "JobStatusId");

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUsers_AspNetUsers_ManagerId",
                table: "AspNetUsers",
                column: "ManagerId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Jobs_JobStatus_JobStatusId",
                table: "Jobs",
                column: "JobStatusId",
                principalTable: "JobStatus",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_UserJobs_Jobs_JobId",
                table: "UserJobs",
                column: "JobId",
                principalTable: "Jobs",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #20
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUsers_AspNetUsers_ManagerId",
                table: "AspNetUsers");

            migrationBuilder.DropForeignKey(
                name: "FK_Jobs_JobStatus_JobStatusId",
                table: "Jobs");

            migrationBuilder.DropForeignKey(
                name: "FK_UserJobs_Jobs_JobId",
                table: "UserJobs");

            migrationBuilder.DropTable(
                name: "JobStatus");

            migrationBuilder.DropIndex(
                name: "IX_AspNetUsers_ManagerId",
                table: "AspNetUsers");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Jobs",
                table: "Jobs");

            migrationBuilder.DropIndex(
                name: "IX_Jobs_JobStatusId",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "BirthDate",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "FirstName",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "LastName",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "ManagerId",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "Position",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "SecondName",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "Deadline",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "Description",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "EndTime",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "JobStatusId",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "Name",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "Progress",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "StartedTime",
                table: "Jobs");

            migrationBuilder.RenameTable(
                name: "Jobs",
                newName: "Rewards");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Rewards",
                table: "Rewards",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_UserJobs_Rewards_JobId",
                table: "UserJobs",
                column: "JobId",
                principalTable: "Rewards",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #21
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Produto_Categoria_CategoriaId",
                table: "Produto");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Produto",
                table: "Produto");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Categoria",
                table: "Categoria");

            migrationBuilder.RenameTable(
                name: "Produto",
                newName: "Produtos");

            migrationBuilder.RenameTable(
                name: "Categoria",
                newName: "Categorias");

            migrationBuilder.RenameIndex(
                name: "IX_Produto_CategoriaId",
                table: "Produtos",
                newName: "IX_Produtos_CategoriaId");

            migrationBuilder.AlterColumn <string>(
                name: "Nome",
                table: "Produtos",
                nullable: true,
                oldClrType: typeof(string),
                oldMaxLength: 50,
                oldNullable: true);

            migrationBuilder.AlterColumn <string>(
                name: "Nome",
                table: "Categorias",
                nullable: true,
                oldClrType: typeof(string),
                oldMaxLength: 50,
                oldNullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_Produtos",
                table: "Produtos",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Categorias",
                table: "Categorias",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Produtos_Categorias_CategoriaId",
                table: "Produtos",
                column: "CategoriaId",
                principalTable: "Categorias",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #22
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_CourseAssignment_Person_InstructorID",
                table: "CourseAssignment");

            migrationBuilder.DropForeignKey(
                name: "FK_Departments_Person_InstructorID",
                table: "Departments");

            migrationBuilder.DropForeignKey(
                name: "FK_Enrollment_Person_StudentID",
                table: "Enrollment");

            migrationBuilder.DropForeignKey(
                name: "FK_OfficeAssignment_Person_InstructorID",
                table: "OfficeAssignment");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Person",
                table: "Person");

            migrationBuilder.DropColumn(
                name: "HireDate",
                table: "Person");

            migrationBuilder.DropColumn(
                name: "Discriminator",
                table: "Person");

            migrationBuilder.RenameTable(
                name: "Person",
                newName: "Student");

            migrationBuilder.AlterColumn <DateTime>(
                name: "EnrollmentDate",
                table: "Student",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldType: "datetime2",
                oldNullable: true);

            migrationBuilder.AlterColumn <string>(
                name: "LastName",
                table: "Student",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50);

            migrationBuilder.AddPrimaryKey(
                name: "PK_Student",
                table: "Student",
                column: "ID");

            migrationBuilder.CreateTable(
                name: "Instructor",
                columns: table => new
            {
                ID = table.Column <int>(nullable: false)
                     .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                FirstName = table.Column <string>(maxLength: 50, nullable: false),
                HireDate  = table.Column <DateTime>(nullable: true),
                LastName  = table.Column <string>(maxLength: 50, nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Instructor", x => x.ID);
            });

            migrationBuilder.AddForeignKey(
                name: "FK_CourseAssignment_Instructor_InstructorID",
                table: "CourseAssignment",
                column: "InstructorID",
                principalTable: "Instructor",
                principalColumn: "ID",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Departments_Instructor_InstructorID",
                table: "Departments",
                column: "InstructorID",
                principalTable: "Instructor",
                principalColumn: "ID",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Enrollment_Student_StudentID",
                table: "Enrollment",
                column: "StudentID",
                principalTable: "Student",
                principalColumn: "ID",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_OfficeAssignment_Instructor_InstructorID",
                table: "OfficeAssignment",
                column: "InstructorID",
                principalTable: "Instructor",
                principalColumn: "ID",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #23
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Prices_ProductsInShops_ProductInShopId",
                table: "Prices");

            migrationBuilder.DropForeignKey(
                name: "FK_ProductsInShops_Products_ProductId",
                table: "ProductsInShops");

            migrationBuilder.DropForeignKey(
                name: "FK_ProductsInShops_Shops_ShopId",
                table: "ProductsInShops");

            migrationBuilder.DropPrimaryKey(
                name: "PK_ProductsInShops",
                table: "ProductsInShops");

            migrationBuilder.DropColumn(
                name: "Hash",
                table: "Products");

            migrationBuilder.RenameTable(
                name: "ProductsInShops",
                newName: "ShopProducts");

            migrationBuilder.RenameIndex(
                name: "IX_ProductsInShops_ShopId",
                table: "ShopProducts",
                newName: "IX_ShopProducts_ShopId");

            migrationBuilder.RenameIndex(
                name: "IX_ProductsInShops_ProductId_ShopId",
                table: "ShopProducts",
                newName: "IX_ShopProducts_ProductId_ShopId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_ShopProducts",
                table: "ShopProducts",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Prices_ShopProducts_ProductInShopId",
                table: "Prices",
                column: "ProductInShopId",
                principalTable: "ShopProducts",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_ShopProducts_Products_ProductId",
                table: "ShopProducts",
                column: "ProductId",
                principalTable: "Products",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_ShopProducts_Shops_ShopId",
                table: "ShopProducts",
                column: "ShopId",
                principalTable: "Shops",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #24
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Clases_Topic_IdTopic",
                table: "Clases");

            migrationBuilder.DropForeignKey(
                name: "FK_TopicSemanaTopics_SemanaTopics_IdSemanaTopics",
                table: "TopicSemanaTopics");

            migrationBuilder.DropForeignKey(
                name: "FK_TopicSemanaTopics_Topic_IdTopic",
                table: "TopicSemanaTopics");

            migrationBuilder.DropPrimaryKey(
                name: "PK_TopicSemanaTopics",
                table: "TopicSemanaTopics");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Topic",
                table: "Topic");

            migrationBuilder.DropPrimaryKey(
                name: "PK_SemanaTopics",
                table: "SemanaTopics");

            migrationBuilder.RenameTable(
                name: "TopicSemanaTopics",
                newName: "TopicsSemanasTopics");

            migrationBuilder.RenameTable(
                name: "Topic",
                newName: "Topics");

            migrationBuilder.RenameTable(
                name: "SemanaTopics",
                newName: "SemanasTopics");

            migrationBuilder.RenameIndex(
                name: "IX_TopicSemanaTopics_IdTopic",
                table: "TopicsSemanasTopics",
                newName: "IX_TopicsSemanasTopics_IdTopic");

            migrationBuilder.RenameIndex(
                name: "IX_TopicSemanaTopics_IdSemanaTopics",
                table: "TopicsSemanasTopics",
                newName: "IX_TopicsSemanasTopics_IdSemanaTopics");

            migrationBuilder.AddColumn <Guid>(
                name: "IdNivel",
                table: "Alumnos",
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_TopicsSemanasTopics",
                table: "TopicsSemanasTopics",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Topics",
                table: "Topics",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_SemanasTopics",
                table: "SemanasTopics",
                column: "Id");

            migrationBuilder.CreateTable(
                name: "Niveles",
                columns: table => new
            {
                Id          = table.Column <Guid>(nullable: false),
                Nombre      = table.Column <string>(nullable: false),
                Descripcion = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Niveles", x => x.Id);
            });

            migrationBuilder.CreateIndex(
                name: "IX_Alumnos_IdNivel",
                table: "Alumnos",
                column: "IdNivel");

            migrationBuilder.AddForeignKey(
                name: "FK_Alumnos_Niveles_IdNivel",
                table: "Alumnos",
                column: "IdNivel",
                principalTable: "Niveles",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Clases_Topics_IdTopic",
                table: "Clases",
                column: "IdTopic",
                principalTable: "Topics",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_TopicsSemanasTopics_SemanasTopics_IdSemanaTopics",
                table: "TopicsSemanasTopics",
                column: "IdSemanaTopics",
                principalTable: "SemanasTopics",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_TopicsSemanasTopics_Topics_IdTopic",
                table: "TopicsSemanasTopics",
                column: "IdTopic",
                principalTable: "Topics",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #25
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Res_Masters_Mem_Masters_DLogin",
                table: "Res_Masters");

            migrationBuilder.DropForeignKey(
                name: "FK_Res_Masters_Mem_Masters_MemberId",
                table: "Res_Masters");

            migrationBuilder.DropForeignKey(
                name: "FK_Res_Views_Res_Masters_ResourceId",
                table: "Res_Views");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Res_Masters",
                table: "Res_Masters");

            migrationBuilder.DropColumn(
                name: "MaritalStatus",
                table: "Mem_Masters");

            migrationBuilder.RenameTable(
                name: "Res_Masters",
                newName: "Resources");

            migrationBuilder.RenameIndex(
                name: "IX_Res_Masters_MemberId",
                table: "Resources",
                newName: "IX_Resources_MemberId");

            migrationBuilder.RenameIndex(
                name: "IX_Res_Masters_DLogin",
                table: "Resources",
                newName: "IX_Resources_DLogin");

            migrationBuilder.AlterColumn <string>(
                name: "PresentAddress",
                table: "Mem_Masters",
                nullable: false,
                oldClrType: typeof(string),
                oldMaxLength: 150,
                oldNullable: true);

            migrationBuilder.AlterColumn <string>(
                name: "AdNo",
                table: "Mem_Masters",
                nullable: false,
                oldClrType: typeof(string),
                oldMaxLength: 128);

            migrationBuilder.AddColumn <byte>(
                name: "Type",
                table: "Mem_Masters",
                nullable: false,
                defaultValue: (byte)0);

            migrationBuilder.AddPrimaryKey(
                name: "PK_Resources",
                table: "Resources",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Res_Views_Resources_ResourceId",
                table: "Res_Views",
                column: "ResourceId",
                principalTable: "Resources",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Resources_Mem_Masters_DLogin",
                table: "Resources",
                column: "DLogin",
                principalTable: "Mem_Masters",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Resources_Mem_Masters_MemberId",
                table: "Resources",
                column: "MemberId",
                principalTable: "Mem_Masters",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
コード例 #26
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_GroupVisit_Group_GroupId",
                table: "GroupVisit");

            migrationBuilder.DropForeignKey(
                name: "FK_GroupVisit_Subject_SubjectId",
                table: "GroupVisit");

            migrationBuilder.DropForeignKey(
                name: "FK_GroupVisit_Theme_ThemeId",
                table: "GroupVisit");

            migrationBuilder.DropForeignKey(
                name: "FK_StudentVisit_GroupVisit_GroupVisitId",
                table: "StudentVisit");

            migrationBuilder.DropPrimaryKey(
                name: "PK_GroupVisit",
                table: "GroupVisit");

            migrationBuilder.RenameTable(
                name: "GroupVisit",
                newName: "Visit");

            migrationBuilder.RenameIndex(
                name: "IX_GroupVisit_ThemeId",
                table: "Visit",
                newName: "IX_Visit_ThemeId");

            migrationBuilder.RenameIndex(
                name: "IX_GroupVisit_SubjectId",
                table: "Visit",
                newName: "IX_Visit_SubjectId");

            migrationBuilder.RenameIndex(
                name: "IX_GroupVisit_GroupId",
                table: "Visit",
                newName: "IX_Visit_GroupId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Visit",
                table: "Visit",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_StudentVisit_Visit_GroupVisitId",
                table: "StudentVisit",
                column: "GroupVisitId",
                principalTable: "Visit",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Visit_Group_GroupId",
                table: "Visit",
                column: "GroupId",
                principalTable: "Group",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Visit_Subject_SubjectId",
                table: "Visit",
                column: "SubjectId",
                principalTable: "Subject",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Visit_Theme_ThemeId",
                table: "Visit",
                column: "ThemeId",
                principalTable: "Theme",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #27
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserClaims_AspUsers_UserId",
                table: "AspNetUserClaims");

            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserLogins_AspUsers_UserId",
                table: "AspNetUserLogins");

            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserRoles_AspUsers_UserId",
                table: "AspNetUserRoles");

            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserTokens_AspUsers_UserId",
                table: "AspNetUserTokens");

            migrationBuilder.DropTable(
                name: "Results");

            migrationBuilder.DropTable(
                name: "StudentTerm");

            migrationBuilder.DropPrimaryKey(
                name: "PK_AspUsers",
                table: "AspUsers");

            migrationBuilder.RenameTable(
                name: "AspUsers",
                newName: "AspNetUsers");

            migrationBuilder.AddColumn <int>(
                name: "TermId",
                table: "Students",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddPrimaryKey(
                name: "PK_AspNetUsers",
                table: "AspNetUsers",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Students_TermId",
                table: "Students",
                column: "TermId");

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserClaims_AspNetUsers_UserId",
                table: "AspNetUserClaims",
                column: "UserId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserLogins_AspNetUsers_UserId",
                table: "AspNetUserLogins",
                column: "UserId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserRoles_AspNetUsers_UserId",
                table: "AspNetUserRoles",
                column: "UserId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserTokens_AspNetUsers_UserId",
                table: "AspNetUserTokens",
                column: "UserId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_Students_Terms_TermId",
                table: "Students",
                column: "TermId",
                principalTable: "Terms",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #28
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "RatingTags");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Tags",
                table: "Tags");

            migrationBuilder.RenameTable(
                name: "Tags",
                newName: "Tag");

            migrationBuilder.AddColumn <Guid>(
                name: "StudentId",
                table: "Ratings",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddPrimaryKey(
                name: "PK_Tag",
                table: "Tag",
                column: "Id");

            migrationBuilder.CreateTable(
                name: "TeacherTag",
                columns: table => new
            {
                Id        = table.Column <Guid>(type: "uniqueidentifier", nullable: false),
                Count     = table.Column <int>(type: "int", nullable: false),
                RatingId  = table.Column <Guid>(type: "uniqueidentifier", nullable: true),
                TagId     = table.Column <Guid>(type: "uniqueidentifier", nullable: true),
                TeacherId = table.Column <Guid>(type: "uniqueidentifier", nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_TeacherTag", x => x.Id);
                table.ForeignKey(
                    name: "FK_TeacherTag_Ratings_RatingId",
                    column: x => x.RatingId,
                    principalTable: "Ratings",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "FK_TeacherTag_Tag_TagId",
                    column: x => x.TagId,
                    principalTable: "Tag",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateIndex(
                name: "IX_TeacherTag_RatingId",
                table: "TeacherTag",
                column: "RatingId");

            migrationBuilder.CreateIndex(
                name: "IX_TeacherTag_TagId",
                table: "TeacherTag",
                column: "TagId");
        }
コード例 #29
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_EcPost_EcBlog_BlogId",
                table: "EcPost");

            migrationBuilder.DropTable(
                name: "EcUserInfo");

            migrationBuilder.DropTable(
                name: "EcRole");

            migrationBuilder.DropPrimaryKey(
                name: "PK_EcPost",
                table: "EcPost");

            migrationBuilder.DropPrimaryKey(
                name: "PK_EcBlog",
                table: "EcBlog");

            migrationBuilder.DropColumn(
                name: "Id",
                table: "EcPost");

            migrationBuilder.DropColumn(
                name: "ConcurrencyStamp",
                table: "EcPost");

            migrationBuilder.DropColumn(
                name: "ExtraProperties",
                table: "EcPost");

            migrationBuilder.DropColumn(
                name: "Id",
                table: "EcBlog");

            migrationBuilder.DropColumn(
                name: "ConcurrencyStamp",
                table: "EcBlog");

            migrationBuilder.DropColumn(
                name: "ExtraProperties",
                table: "EcBlog");

            migrationBuilder.AddColumn <Guid>(
                name: "PostId",
                table: "EcPost",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddColumn <Guid>(
                name: "BlogId",
                table: "EcBlog",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddPrimaryKey(
                name: "PK_EcPost",
                table: "EcPost",
                column: "PostId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_EcBlog",
                table: "EcBlog",
                column: "BlogId");

            migrationBuilder.AddForeignKey(
                name: "FK_EcPost_EcBlog_BlogId",
                table: "EcPost",
                column: "BlogId",
                principalTable: "EcBlog",
                principalColumn: "BlogId",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #30
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_TimeZoneIds",
                table: "TimeZoneIds");

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("007b8faf-d2ff-48dd-89fc-326f8ce378a6"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("01cda1bb-af59-46c1-aed8-909291f05d17"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("03a5871b-5e64-48c4-8ff5-54fd25fa91ed"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("045dd95b-7b47-4125-a85b-a38174edb2cd"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("057b7481-411e-4844-8c61-356bf72421f4"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("07d91ce7-6172-4bb9-839d-0e065b15537d"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("087d8bb4-b3b1-4d4c-9320-85529bef6851"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("0a8d338b-afef-4857-a768-bf1112ea09f3"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("0f9a1bed-59ee-4e32-8f9e-640990d937af"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("10ef3133-b2ef-4fe9-a03c-992a96a76e9c"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("1111ae41-cce8-4897-a605-851bfa68a70c"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("1137b09c-f374-4d12-83b0-738dd3df13db"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("14f88b2b-050e-41d8-954b-f238c833c2e1"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("18a5100c-c6d6-4ba8-a395-04a2f1728a57"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("1a99b116-247d-43d2-90eb-850c5f766583"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("1ccc947b-13c8-4cd6-9aee-9944a70c2d6f"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("1f1b49ba-42fe-4ebc-8a04-a0f284bab4fa"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("21622977-4a88-4871-9c6d-e74d27418213"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("22c0747e-130b-4dcd-aa59-8ebc1647c1bc"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("26670d75-806a-4448-bcc7-d59f68bb934d"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("2a48c9c9-53bb-41d2-8d5d-97a0d65e05b9"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("2b35692d-7f9f-4d21-890c-76cbd1acb684"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("2ce7b70e-682c-4918-b7f2-43d513a754e9"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("2ef1534c-36de-4c25-97bf-e67c2592f1ec"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("2f6b18ce-71e0-47b7-a231-929e1747f828"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("2f824e67-1085-4cbf-af61-d7c9f1700780"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("2fa0b1e0-a90f-45f6-9b89-1ab9e00c92d7"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("335b42b7-b500-44bd-9b0d-f63edf43f95e"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("37a3ba97-de16-4f2c-99fc-580b911884f1"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("3b8c4662-c0db-4f78-97d5-14bb57e4ba4d"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("3cc6aff3-0ee0-4a1b-bdb9-52327f91499b"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("430b49e8-9bf6-43ad-a2dd-2a12cade7289"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("45151e3d-6ab2-402f-87b1-29fcc8fd4c01"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("4b081bcd-9f69-4824-b3b4-3bbac9a93fd1"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("4bbce910-2fff-4c1d-80a0-9dfefa6b2b17"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("4fadd29b-bd9d-4357-963a-d9a6c57e647c"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("510d78f1-767b-4b1f-a7c8-bd0c6929ece1"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("523dc3bf-d466-4dc9-8026-4f903698687d"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("52ed8785-b9bc-4f8e-a0a8-87d062a923ee"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("56a5ab66-5342-401c-b50d-5a91f42278db"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("595a9de1-fdf1-4473-bdc2-504bfe293e7b"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("595c42d5-b121-4928-90f1-3b84ecc46dc8"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("5a67d9ae-1912-4fd6-9bfa-0f21a6fb60bf"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("5c0d4a10-b68f-4317-b9a4-458549eaea56"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("5c249f6d-54b9-4668-9aff-6dd901cea611"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("5c2df02b-a1b2-4ac2-bdea-f325de70d890"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("5ddad745-2f07-4f0c-a423-9018c7428675"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("60c50feb-5910-4f52-9708-7c04b481be9a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("6295312e-24c1-45f6-9d47-450cf1499b77"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("62c1ec8d-fb5d-42f4-996b-b596b7067672"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("6707ce53-1823-4a3e-ab44-c7b69f666b55"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("6824a9c3-554c-454f-aa10-3637556c7693"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("6c325b2e-d5df-4bee-a949-fe04196b2f72"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("6facd92b-35e7-4330-b5f6-66cc10fb906f"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("7082877a-dfb1-4dea-8dfb-753a6bb1498a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("72192e08-441c-4894-a9eb-abd288e0ee5a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("725d1053-cf48-4b6c-824d-47c9621bb3c3"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("7429a91c-e629-43f1-86de-bec14ba0e9f8"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("756f7bdb-60ea-4cee-9499-72e9b9ef13fb"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("76490d08-74bc-424a-b17d-79172e2e05c6"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("771a3ccd-82fc-4076-928e-f656319b8dfc"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("77c2370d-967a-4a90-93b7-6276f9ef0d9e"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("794f7afb-10e4-4c44-a31c-f3aaa5abd3c1"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("7ba53547-8cf1-4ddd-b619-9cad56e3b7ca"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("7d799c40-db4e-4a41-8b2e-6dde44b6796b"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("80532b51-2ee3-40b9-98c4-57742a8ef684"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("817c73a2-de57-4317-8065-1ea1b1e488a3"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("83566e45-b8b4-4a8c-9e17-6c42311cc4bf"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8579cdbc-63b1-4767-87a8-6dfc7c4458cc"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("860ad695-c8f1-49fe-8a81-2de31b12884a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8703fe1c-31b0-4d08-bfd2-15c2c20c36ac"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("87346558-d1fc-4abe-8a88-cca1155059ea"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("88208c66-9143-4b05-a3ba-5d4eeb88e470"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8a80206b-ff9d-4032-aa22-191b45d1062a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8ce50175-08d5-4ed4-8179-4799a769bc16"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8db6ce68-d142-4ae1-8ca6-ec1cfff1f9cd"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8e680df0-62d5-474d-abaf-e77c38805ef5"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8ee1dbc3-3e8f-43e6-8c3a-5c29ab0a16d4"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("8f6b8895-d235-4759-afc6-4af6447f21d8"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("915ea2d2-ed24-44d9-87c8-4561ada2bfc2"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("96591d59-0c46-4c05-9c19-50c0be8400e9"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("9b00ecd4-6c61-448d-8ca1-b8f25e1c7a67"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("9de7c21d-dcaa-4a27-80c7-886c019ce484"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("a48e6175-2a6b-4e0d-8dfe-c42fe3ab8a9a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("a55a539d-5019-4481-93c4-76382ae9f11a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("a6f0e54a-15b5-403a-98a5-5215b49f5eb3"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("ab0629db-64ae-4f40-b762-a94490a2ba7b"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("ac15fc92-8675-4066-83bd-6d1c4b4f653e"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("aca817d9-d6bd-4f47-b9ab-c2330155d6f5"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("aec5f57e-3f2c-4f20-9c7b-1b0d4a7ee578"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b0445a01-7433-40e7-9684-4eb72f476680"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b067b3aa-cf05-4f6a-8afc-1d0468ea9d47"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b10b704c-e106-440b-854e-10eb43ca42ff"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b38139b2-1732-4f60-a0ee-02b7f260c6be"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b3cd7fa6-8c85-4632-83d8-db27215285c9"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b4e9d554-9f81-4be6-88c0-6614198737c2"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b50bcda1-4f29-42a9-bc94-ec22094821d3"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b51086ff-d5d9-49a0-81ad-bfd9df653147"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b8c8fafe-4ffc-43be-a927-74122917e6c7"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("b93c23af-4576-4c75-a38b-0a66ad7487e3"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("bbe24d96-bbae-4a44-8797-463393778913"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("bbf8464b-3375-4806-8eb8-bc9d2dc55587"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("bc04578d-cf07-4b47-8c63-dff36e627d7a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("bc85d639-d9be-4fef-aa23-300a8e0e31a8"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("bca456e1-6369-44cc-b14b-5b224f887c55"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("c94209d0-5923-46fb-8df4-52e4cce462c6"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("c9ebd4ed-6c6c-4eba-9281-3b672520cc41"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("cc96a162-8ecb-4a7c-8849-0703a94e66a5"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("cc9ad20c-d754-454f-8623-871eef6cdac6"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("cfad21a5-94a9-4739-baf6-465e1491b152"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("d0ff9b09-2f72-445a-b1a4-ac8dbeb16914"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("d5110a8a-b1d9-4802-99bf-f30921c3233a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("d612b3d6-90e2-4149-8d4d-4d6ce443bc97"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("d88794b9-b7c9-44c2-9d15-a5090ccf203b"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("da977f50-6106-4571-9c09-aed5f6d6681a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("db26063b-a3ed-4220-bb1b-ddabe33a96bd"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("dc87b8ac-26e2-4b65-b514-c07664a16fb2"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("ddc8f45a-cc5d-443f-b098-0582a95f347a"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("df7551fe-0bf4-4e09-b7de-17eb4d0f2cc9"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("e1bddf3f-e60d-4c9e-add8-77bbf933e64f"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("e241b1ce-94ff-488f-a4d4-ceaf7427e6bd"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("e2536cc0-7be8-4246-af07-16f6cf10d3ad"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("e31588e4-9274-4b52-ae2b-581ab5691b9b"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("e3bc0f52-9b0b-4068-b3cf-3c55a3e1ba7f"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("e793b6b9-8db8-45d6-92e2-a3d496f9dd9b"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("e7aeba45-148f-4f62-a4e6-b219484edd22"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("ea409e06-e791-42a1-b9ee-ed139f0949d8"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("ea815bcf-045d-499a-859a-88415dde3762"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("eb158c7c-9435-48a6-9265-fa18d2573866"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("ec4d615c-ac2f-43ae-bf20-5342abcb7e9d"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("ed1ea194-4689-4ee4-b4a6-b546334a3489"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("f709a4fb-0df5-4121-9bd5-7d0470aff41f"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("f8266866-d51f-467b-aa48-65b4d65d4035"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("f8d3b72b-e9a8-419c-9661-8b93910e49f2"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("fadde5c8-2f36-456a-a186-b0a04108ed4f"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("fb3d8734-3f4b-4b78-8dfb-f7d2a2f6fedd"));

            migrationBuilder.DeleteData(
                table: "TimeZoneIds",
                keyColumn: "Id",
                keyValue: new Guid("fe9ec1b0-6667-4b4b-90fe-d2b6ae8cbf29"));

            migrationBuilder.RenameTable(
                name: "TimeZoneIds",
                newName: "TimeZoneIDs");

            migrationBuilder.AddPrimaryKey(
                name: "PK_TimeZoneIDs",
                table: "TimeZoneIDs",
                column: "Id");
        }
コード例 #31
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Clientes_Tarjetas_TarjetaId",
                table: "Clientes");

            migrationBuilder.DropForeignKey(
                name: "FK_Pagos_Tarjetas_TarjetaId",
                table: "Pagos");

            migrationBuilder.DropForeignKey(
                name: "FK_PagosHistoriall_Tarjetas_TarjetaId",
                table: "PagosHistoriall");

            migrationBuilder.DropForeignKey(
                name: "FK_Retenciones_Tarjetas_TarjetaId",
                table: "Retenciones");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Tarjetas",
                table: "Tarjetas");

            migrationBuilder.RenameTable(
                name: "Tarjetas",
                newName: "Tarjeta");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Tarjeta",
                table: "Tarjeta",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_Clientes_Tarjeta_TarjetaId",
                table: "Clientes",
                column: "TarjetaId",
                principalTable: "Tarjeta",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Pagos_Tarjeta_TarjetaId",
                table: "Pagos",
                column: "TarjetaId",
                principalTable: "Tarjeta",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_PagosHistoriall_Tarjeta_TarjetaId",
                table: "PagosHistoriall",
                column: "TarjetaId",
                principalTable: "Tarjeta",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Retenciones_Tarjeta_TarjetaId",
                table: "Retenciones",
                column: "TarjetaId",
                principalTable: "Tarjeta",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
コード例 #32
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_fsp_mandate",
                table: "fsp_mandate");

            migrationBuilder.DropPrimaryKey(
                name: "PK_dividend_tax",
                table: "dividend_tax");

            migrationBuilder.DeleteData(
                table: "users",
                keyColumn: "Id",
                keyValue: new Guid("b4004ea2-ba11-41e2-b1a2-2ea3a695e9e7"));

            migrationBuilder.DropColumn(
                name: "Advisor",
                table: "fsp_mandate");

            migrationBuilder.DropColumn(
                name: "Created",
                table: "fsp_mandate");

            migrationBuilder.DropColumn(
                name: "InstructionAdvisor",
                table: "fsp_mandate");

            migrationBuilder.DropColumn(
                name: "InstructionFsp",
                table: "fsp_mandate");

            migrationBuilder.DropColumn(
                name: "InstructionPersonal",
                table: "fsp_mandate");

            migrationBuilder.DropColumn(
                name: "Modified",
                table: "fsp_mandate");

            migrationBuilder.DropColumn(
                name: "Objective",
                table: "fsp_mandate");

            migrationBuilder.DropColumn(
                name: "Created",
                table: "dividend_tax");

            migrationBuilder.DropColumn(
                name: "Modified",
                table: "dividend_tax");

            migrationBuilder.RenameTable(
                name: "fsp_mandate",
                newName: "FspMandatates");

            migrationBuilder.RenameTable(
                name: "dividend_tax",
                newName: "Dividends");

            migrationBuilder.AddColumn <string>(
                name: "Adviser",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "AtLimited",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "AttFull",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "DateFUll",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "DateLimited",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FAggressive",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FConservative",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FLG",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FLI",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FMG",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FMI",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FModerate",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FModeratelyAggressive",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FModeratelyConservative",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FSG",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "FSI",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Instruction_advisor",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Instruction_fsp",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Instruction_personal",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LAggressive",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LConservative",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LLG",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LLI",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LMG",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LMI",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LModerate",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LModeratelyAggressive",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LModeratelyConservative",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LSG",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "LSI",
                table: "FspMandatates",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_FspMandatates",
                table: "FspMandatates",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Dividends",
                table: "Dividends",
                column: "Id");

            migrationBuilder.InsertData(
                table: "users",
                columns: new[] { "Id", "Created", "Email", "FirstName", "IdNumber", "LastName", "MobileNumber", "MobileVerified", "Modified", "Password", "Role" },
                values: new object[] { new Guid("713762b3-b687-470b-ba8b-98f8558debb6"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "*****@*****.**", "rootUser", "9000000000000", "root", "0810000000", true, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "9645.+uCcmyxLqzixtFoKU+NH2Q==.YU75XgAjCJl39RNGRg84uYIPH3eIoLVk8Byvl573+dM=", "Admin" });
        }
コード例 #33
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_GamesRates_Games_GameId",
                table: "GamesRates");

            migrationBuilder.DropPrimaryKey(
                name: "PK_GamesRates",
                table: "GamesRates");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Games",
                table: "Games");

            migrationBuilder.DropColumn(
                name: "GameRateId",
                table: "GamesRates");

            migrationBuilder.DropColumn(
                name: "GameId",
                table: "Games");

            migrationBuilder.AlterColumn <int>(
                name: "GameId",
                table: "GamesRates",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(450)",
                oldNullable: true);

            migrationBuilder.AddColumn <int>(
                name: "Id",
                table: "GamesRates",
                nullable: false,
                defaultValue: 0)
            .Annotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AddColumn <int>(
                name: "Id",
                table: "Games",
                nullable: false,
                defaultValue: 0)
            .Annotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AddPrimaryKey(
                name: "PK_GamesRates",
                table: "GamesRates",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Games",
                table: "Games",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_GamesRates_Games_GameId",
                table: "GamesRates",
                column: "GameId",
                principalTable: "Games",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
コード例 #34
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserClaims_AspNetUsers_UserId",
                table: "AspNetUserClaims");

            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserLogins_AspNetUsers_UserId",
                table: "AspNetUserLogins");

            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserRoles_AspNetUsers_UserId",
                table: "AspNetUserRoles");

            migrationBuilder.DropForeignKey(
                name: "FK_AspNetUserTokens_AspNetUsers_UserId",
                table: "AspNetUserTokens");

            migrationBuilder.DropForeignKey(
                name: "FK_Students_Terms_TermId",
                table: "Students");

            migrationBuilder.DropIndex(
                name: "IX_Students_TermId",
                table: "Students");

            migrationBuilder.DropPrimaryKey(
                name: "PK_AspNetUsers",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "TermId",
                table: "Students");

            migrationBuilder.RenameTable(
                name: "AspNetUsers",
                newName: "AspUsers");

            migrationBuilder.AddPrimaryKey(
                name: "PK_AspUsers",
                table: "AspUsers",
                column: "Id");

            migrationBuilder.CreateTable(
                name: "Results",
                columns: table => new
            {
                Id = table.Column <int>(nullable: false)
                     .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                Name       = table.Column <string>(nullable: true),
                CA1        = table.Column <string>(nullable: true),
                CA2        = table.Column <string>(nullable: true),
                Exam       = table.Column <string>(nullable: true),
                TotalScore = table.Column <string>(nullable: true),
                Grade      = table.Column <string>(nullable: true),
                Remark     = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Results", x => x.Id);
            });

            migrationBuilder.CreateTable(
                name: "StudentTerm",
                columns: table => new
            {
                StudentId = table.Column <int>(nullable: false),
                TermId    = table.Column <int>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_StudentTerm", x => new { x.StudentId, x.TermId });
                table.ForeignKey(
                    name: "FK_StudentTerm_Students_StudentId",
                    column: x => x.StudentId,
                    principalTable: "Students",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
                table.ForeignKey(
                    name: "FK_StudentTerm_Terms_TermId",
                    column: x => x.TermId,
                    principalTable: "Terms",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateIndex(
                name: "IX_StudentTerm_TermId",
                table: "StudentTerm",
                column: "TermId");

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserClaims_AspUsers_UserId",
                table: "AspNetUserClaims",
                column: "UserId",
                principalTable: "AspUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserLogins_AspUsers_UserId",
                table: "AspNetUserLogins",
                column: "UserId",
                principalTable: "AspUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserRoles_AspUsers_UserId",
                table: "AspNetUserRoles",
                column: "UserId",
                principalTable: "AspUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_AspNetUserTokens_AspUsers_UserId",
                table: "AspNetUserTokens",
                column: "UserId",
                principalTable: "AspUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #35
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_EcPost_EcBlog_BlogId",
                table: "EcPost");

            migrationBuilder.DropPrimaryKey(
                name: "PK_EcPost",
                table: "EcPost");

            migrationBuilder.DropPrimaryKey(
                name: "PK_EcBlog",
                table: "EcBlog");

            migrationBuilder.DropColumn(
                name: "PostId",
                table: "EcPost");

            migrationBuilder.DropColumn(
                name: "BlogId",
                table: "EcBlog");

            migrationBuilder.AddColumn <Guid>(
                name: "Id",
                table: "EcPost",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddColumn <string>(
                name: "ConcurrencyStamp",
                table: "EcPost",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "ExtraProperties",
                table: "EcPost",
                nullable: true);

            migrationBuilder.AddColumn <Guid>(
                name: "Id",
                table: "EcBlog",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddColumn <string>(
                name: "ConcurrencyStamp",
                table: "EcBlog",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "ExtraProperties",
                table: "EcBlog",
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_EcPost",
                table: "EcPost",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_EcBlog",
                table: "EcBlog",
                column: "Id");

            migrationBuilder.CreateTable(
                name: "EcRole",
                columns: table => new
            {
                Id = table.Column <Guid>(nullable: false),
                ExtraProperties  = table.Column <string>(nullable: true),
                ConcurrencyStamp = table.Column <string>(nullable: true),
                Name             = table.Column <string>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_EcRole", x => x.Id);
            });

            migrationBuilder.CreateTable(
                name: "EcUserInfo",
                columns: table => new
            {
                Id = table.Column <Guid>(nullable: false),
                ExtraProperties  = table.Column <string>(nullable: true),
                ConcurrencyStamp = table.Column <string>(nullable: true),
                Name             = table.Column <string>(nullable: true),
                Email            = table.Column <string>(nullable: true),
                RoleId           = table.Column <Guid>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_EcUserInfo", x => x.Id);
                table.ForeignKey(
                    name: "FK_EcUserInfo_EcRole_RoleId",
                    column: x => x.RoleId,
                    principalTable: "EcRole",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateIndex(
                name: "IX_EcUserInfo_RoleId",
                table: "EcUserInfo",
                column: "RoleId");

            migrationBuilder.AddForeignKey(
                name: "FK_EcPost_EcBlog_BlogId",
                table: "EcPost",
                column: "BlogId",
                principalTable: "EcBlog",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
コード例 #36
0
        public void AddPrimaryKey_adds_operation()
        {
            var builder = new MigrationBuilder();

            builder.AddPrimaryKey("dbo.MyTable", "MyPK", new[] { "Foo", "Bar" }, isClustered: true);

            Assert.Equal(1, builder.Operations.Count);
            Assert.IsType<AddPrimaryKeyOperation>(builder.Operations[0]);

            var operation = (AddPrimaryKeyOperation)builder.Operations[0];

            Assert.Equal("dbo.MyTable", operation.TableName);
            Assert.Equal("MyPK", operation.PrimaryKeyName);
            Assert.Equal(new[] { "Foo", "Bar" }, operation.ColumnNames);
            Assert.True(operation.IsClustered);
        }
コード例 #37
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Diagnosis_User_UserId",
                table: "Diagnosis");

            migrationBuilder.DropTable(
                name: "DiagnoseDisease");

            migrationBuilder.DropTable(
                name: "DiseaseCure");

            migrationBuilder.DropTable(
                name: "DiseasePrecaution");

            migrationBuilder.DropTable(
                name: "DiseaseSymptoms");

            migrationBuilder.DropTable(
                name: "User");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Precaution",
                table: "Precaution");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Disease",
                table: "Disease");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Diagnosis",
                table: "Diagnosis");

            migrationBuilder.DropPrimaryKey(
                name: "PK_Cure",
                table: "Cure");

            migrationBuilder.RenameTable(
                name: "Precaution",
                newName: "Precautions");

            migrationBuilder.RenameTable(
                name: "Disease",
                newName: "Diseases");

            migrationBuilder.RenameTable(
                name: "Diagnosis",
                newName: "Diagnoses");

            migrationBuilder.RenameTable(
                name: "Cure",
                newName: "Cures");

            migrationBuilder.RenameColumn(
                name: "DiseaseId",
                table: "Diseases",
                newName: "Id");

            migrationBuilder.RenameIndex(
                name: "IX_Diagnosis_UserId",
                table: "Diagnoses",
                newName: "IX_Diagnoses_UserId");

            migrationBuilder.AddColumn <string>(
                name: "Description",
                table: "Symptoms",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Address",
                table: "AspNetUsers",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Contact",
                table: "AspNetUsers",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Country",
                table: "AspNetUsers",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Discriminator",
                table: "AspNetUsers",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn <string>(
                name: "Name",
                table: "AspNetUsers",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Description",
                table: "Precautions",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AlterColumn <string>(
                name: "UserId",
                table: "Diagnoses",
                type: "nvarchar(450)",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Description",
                table: "Cures",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddPrimaryKey(
                name: "PK_Precautions",
                table: "Precautions",
                column: "PrecautionId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Diseases",
                table: "Diseases",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Diagnoses",
                table: "Diagnoses",
                column: "DiagnosisId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Cures",
                table: "Cures",
                column: "CureId");

            migrationBuilder.CreateTable(
                name: "DiagnosedDiseases",
                columns: table => new
            {
                Id = table.Column <int>(type: "int", nullable: false)
                     .Annotation("SqlServer:Identity", "1, 1"),
                UserId      = table.Column <string>(type: "nvarchar(450)", nullable: true),
                DiseaseId   = table.Column <int>(type: "int", nullable: true),
                DiagnosisId = table.Column <int>(type: "int", nullable: true),
                Severity    = table.Column <string>(type: "nvarchar(max)", nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_DiagnosedDiseases", x => x.Id);
                table.ForeignKey(
                    name: "FK_DiagnosedDiseases_AspNetUsers_UserId",
                    column: x => x.UserId,
                    principalTable: "AspNetUsers",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "FK_DiagnosedDiseases_Diagnoses_DiagnosisId",
                    column: x => x.DiagnosisId,
                    principalTable: "Diagnoses",
                    principalColumn: "DiagnosisId",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "FK_DiagnosedDiseases_Diseases_DiseaseId",
                    column: x => x.DiseaseId,
                    principalTable: "Diseases",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateIndex(
                name: "IX_DiagnosedDiseases_DiagnosisId",
                table: "DiagnosedDiseases",
                column: "DiagnosisId");

            migrationBuilder.CreateIndex(
                name: "IX_DiagnosedDiseases_DiseaseId",
                table: "DiagnosedDiseases",
                column: "DiseaseId");

            migrationBuilder.CreateIndex(
                name: "IX_DiagnosedDiseases_UserId",
                table: "DiagnosedDiseases",
                column: "UserId");

            migrationBuilder.AddForeignKey(
                name: "FK_Diagnoses_AspNetUsers_UserId",
                table: "Diagnoses",
                column: "UserId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }