protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn <int>(
                name: "IsShowing",
                table: "AppUserEmployeeExtensions",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit");

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

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

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

            migrationBuilder.AddColumn <decimal>(
                name: "PaymentMinProfile",
                table: "AppUserEmployeeExtensions",
                nullable: false,
                defaultValue: 0m);

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

            migrationBuilder.AddColumn <string>(
                name: "TypePreferes",
                table: "AppUserEmployeeExtensions",
                nullable: true);
        }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_Recipe_Category_CategoryId", table: "Recipe");
     migrationBuilder.AddColumn<string>(
         name: "Content",
         table: "Recipe",
         nullable: false,
         defaultValue: "");
     migrationBuilder.AddColumn<string>(
         name: "CoockTime",
         table: "Recipe",
         nullable: true);
     migrationBuilder.AddColumn<DateTime>(
         name: "CreatedAt",
         table: "Recipe",
         nullable: false,
         defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
     migrationBuilder.AddColumn<bool>(
         name: "IsFavorite",
         table: "Recipe",
         nullable: false,
         defaultValue: false);
     migrationBuilder.AddColumn<DateTime>(
         name: "UpdatedAt",
         table: "Recipe",
         nullable: true);
     migrationBuilder.AddForeignKey(
         name: "FK_Recipe_Category_CategoryId",
         table: "Recipe",
         column: "CategoryId",
         principalTable: "Category",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
 public override void Up(MigrationBuilder migration)
 {
     migration.DropColumn(name: "Logo", table: "Teams");
     migration.AddColumn(
         name: "CheerleaderImage",
         table: "Teams",
         type: "nvarchar(max)",
         nullable: true);
     migration.AddColumn(
         name: "CoachImage",
         table: "Teams",
         type: "nvarchar(max)",
         nullable: true);
     migration.AddColumn(
         name: "DivisionId",
         table: "Teams",
         type: "int",
         nullable: true);
     migration.AddColumn(
         name: "HeaderImage",
         table: "Teams",
         type: "nvarchar(max)",
         nullable: true);
     migration.AddColumn(
         name: "LogoImage",
         table: "Teams",
         type: "nvarchar(max)",
         nullable: true);
     migration.AddForeignKey(
         name: "FK_Team_Division_DivisionId",
         table: "Teams",
         column: "DivisionId",
         referencedTable: "Divisions",
         referencedColumn: "DivisionId");
 }
 public override void Up(MigrationBuilder migration)
 {
     migration.DropForeignKey(name: "FK_Registration_Member_MemberId", table: "Registration");
     migration.DropColumn(name: "MemberId", table: "Registration");
     migration.DropTable("Member");
     migration.AddColumn(
         name: "UserId",
         table: "Registration",
         type: "nvarchar(450)",
         nullable: true);
     migration.RenameTable(
         name: "AspNetUsers",
         newName: "Users");
     migration.AddColumn(
         name: "Name",
         table: "Users",
         type: "nvarchar(100)",
         nullable: true);
     migration.AddForeignKey(
         name: "FK_Registration_ApplicationUser_UserId",
         table: "Registration",
         column: "UserId",
         referencedTable: "Users",
         referencedColumn: "Id");
 }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "IsOriginal",
                table: "Posts",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<string>(
                name: "SourceLink",
                table: "Posts",
                nullable: true);

            migrationBuilder.Sql(@"Alter view HierarchyPosts as
            WITH Cte (Id, Parentpostid, Depth, Rootid) AS
            (SELECT Id,
            Replytopostid,
            0 AS Thelevel,
            Id AS Rootid
             FROM Posts
             WHERE Replytopostid IS NULL
             AND Isdeleted = 0
             UNION ALL SELECT Pn.Id,
                      Pn.Replytopostid,
                      P1.Depth +1,
                      P1.Rootid
             FROM Posts Pn
             INNER JOIN Cte AS P1 ON P1.Id = Pn.Replytopostid
             WHERE Pn.Isdeleted = 0)
            SELECT Cte.Id AS Postid,
               ReplyToPostId,
               Depth,
               ForumId,
               LastChangedDate,
               PublishDate,
               Title,
               Body,
               IsModified,
               U.UserName,
               U.Id,
               UserId,
               RootId,
               IsDeleted,
               IsImportantReply,
               Views,
               IsOriginal,
               SourceLink,
            (SELECT Count(1)
             FROM Userreviews Ur
             WHERE Ur.Touserid = P.Userid
             AND Ur.Votetype = 1
             AND Ur.IsDeleted = 0) AS PositiveReviewsScore,
            (SELECT Count(1)
             FROM Userreviews Ur
             WHERE Ur.Touserid = P.Userid
             AND Ur.Votetype = 2
             AND Ur.IsDeleted = 0) AS NegativeReviewsScore
            FROM Cte
            INNER JOIN Posts P ON Cte.Id = P.Id
            INNER JOIN Users U ON U.Id = P.Userid");
        }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_Leaderboard_Game_GameID", table: "Leaderboard");
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
     migrationBuilder.AddColumn<string>(
         name: "PlayerName",
         table: "Leaderboard",
         nullable: true);
     migrationBuilder.AddColumn<int>(
         name: "PlayerPoints",
         table: "Leaderboard",
         nullable: false,
         defaultValue: 0);
     migrationBuilder.AddForeignKey(
         name: "FK_Leaderboard_Game_GameID",
         table: "Leaderboard",
         column: "GameID",
         principalTable: "Game",
         principalColumn: "GameID",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
         table: "AspNetUserClaims",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
         table: "AspNetUserLogins",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
         table: "AspNetUserRoles",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_ReleaseBatchItem_ReleaseBatch_ReleaseBatchId", schema: "kraken", table: "ReleaseBatchItem");
     migrationBuilder.AddColumn<DateTimeOffset>(
         name: "DeployDateTime",
         schema: "kraken",
         table: "ReleaseBatch",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "DeployEnvironmentId",
         schema: "kraken",
         table: "ReleaseBatch",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "DeployUserName",
         schema: "kraken",
         table: "ReleaseBatch",
         nullable: true);
     migrationBuilder.AddForeignKey(
         name: "FK_ReleaseBatchItem_ReleaseBatch_ReleaseBatchId",
         schema: "kraken",
         table: "ReleaseBatchItem",
         column: "ReleaseBatchId",
         principalSchema: "kraken",
         principalTable: "ReleaseBatch",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
 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);
 }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "LastUpdated",
                table: "Projects",
                nullable: false,
                defaultValueSql: "GetDate()");

            migrationBuilder.AddColumn<DateTime>(
                name: "LastUpdated",
                table: "Products",
                nullable: false,
                defaultValueSql: "GetDate()");

            migrationBuilder.AlterColumn<DateTime>(
                name: "LastUpdated",
                table: "WorkItems",
                nullable: false,
                defaultValueSql: "GetDate()");

            migrationBuilder.AlterColumn<DateTime>(
                name: "LastUpdated",
                table: "ProductCategories",
                nullable: false,
                defaultValueSql: "GetDate()");
        }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_Session_Speaker_SpeakerID", table: "Session");
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
     migrationBuilder.AddColumn<bool>(
         name: "Special",
         table: "Timeslot",
         nullable: true);
     migrationBuilder.AddColumn<bool>(
         name: "Special",
         table: "Session",
         nullable: true);
     migrationBuilder.AddForeignKey(
         name: "FK_Session_Speaker_SpeakerID",
         table: "Session",
         column: "SpeakerID",
         principalTable: "Speaker",
         principalColumn: "ID",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
         table: "AspNetUserClaims",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
         table: "AspNetUserLogins",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
         table: "AspNetUserRoles",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_WorldUser_UserId", table: "AspNetUserClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_WorldUser_UserId", table: "AspNetUserLogins");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_WorldUser_UserId", table: "AspNetUserRoles");
     migrationBuilder.AddColumn<string>(
         name: "Firstname",
         table: "AspNetUsers",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "Lastname",
         table: "AspNetUsers",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "PhoneNumber",
         table: "AspNetUsers",
         nullable: true);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserClaim<string>_WorldUser_UserId",
         table: "AspNetUserClaims",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserLogin<string>_WorldUser_UserId",
         table: "AspNetUserLogins",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_WorldUser_UserId",
         table: "AspNetUserRoles",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.RenameColumn(
         name: "PhoneNumber",
         table: "AspNetUsers",
         newName: "Phonenumber");
 }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
	        migrationBuilder.AddColumn<string>("FirstName", "AspNetUsers", nullable: false);
			migrationBuilder.AddColumn<string>("LastName", "AspNetUsers", nullable: false);
			migrationBuilder.AddColumn<string>("Location", "AspNetUsers", nullable: true);
			migrationBuilder.AddColumn<string>("Twitter", "AspNetUsers", nullable: true);
			migrationBuilder.AddColumn<int?>("AvatarID", "AspNetUsers", nullable: true);
		}
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "UserReviews",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<DateTime>(
                name: "UpdateDate",
                table: "UserReviews",
                nullable: false,
                defaultValueSql: "getutcdate()");

            migrationBuilder.Sql(@"Alter view HierarchyPosts as
            WITH Cte (Id, Parentpostid, Depth, Rootid) AS
            (SELECT Id,
            Replytopostid,
            0 AS Thelevel,
            Id AS Rootid
             FROM Posts
             WHERE Replytopostid IS NULL
             AND Isdeleted = 0
             UNION ALL SELECT Pn.Id,
                      Pn.Replytopostid,
                      P1.Depth +1,
                      P1.Rootid
             FROM Posts Pn
             INNER JOIN Cte AS P1 ON P1.Id = Pn.Replytopostid
             WHERE Pn.Isdeleted = 0)
            SELECT Cte.Id AS Postid,
               Replytopostid,
               Depth,
               Forumid,
               Lastchangeddate,
               Publishdate,
               Title,
               Body,
               Ismodified,
               U.Username,
               U.Id,
               Userid,
               Rootid,
               Isdeleted,
               Isimportantreply,
            (SELECT Count(1)
             FROM Userreviews Ur
             WHERE Ur.Touserid = P.Userid
             AND Ur.Votetype = 1
             AND Ur.IsDeleted = 0) AS PositiveReviewsScore,
            (SELECT Count(1)
             FROM Userreviews Ur
             WHERE Ur.Touserid = P.Userid
             AND Ur.Votetype = 2
             AND Ur.IsDeleted = 0) AS NegativeReviewsScore
            FROM Cte
            INNER JOIN Posts P ON Cte.Id = P.Id
            INNER JOIN Users U ON U.Id = P.Userid");
        }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
     migrationBuilder.AddColumn<int>(
         name: "Progress",
         table: "ProjectsModel",
         nullable: false,
         defaultValue: 0);
     migrationBuilder.AddColumn<string>(
         name: "Status",
         table: "ProjectsModel",
         nullable: true);
     migrationBuilder.AddColumn<DateTime>(
         name: "createdDate",
         table: "ProjectsModel",
         nullable: false,
         defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
         table: "AspNetUserClaims",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
         table: "AspNetUserLogins",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
         table: "AspNetUserRoles",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
     migrationBuilder.AddColumn<string>(
         name: "CompanyName",
         table: "Speaker",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "SponsorLevel",
         table: "Speaker",
         nullable: true);
     migrationBuilder.AlterColumn<int>(
         name: "ID",
         table: "Announcement",
         nullable: false)
         .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
         table: "AspNetUserClaims",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
         table: "AspNetUserLogins",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
         table: "AspNetUserRoles",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.AddColumn<string>(
         name: "DescriptionHtml",
         table: "Organization",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "Summary",
         table: "Organization",
         nullable: true);
 }
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "PreferredEmail",
                table: "TaskSignup",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PreferredPhoneNumber",
                table: "TaskSignup",
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "ShortEndTime",
                table: "TemperatureSettings",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "ShortTimeStart",
                table: "TemperatureSettings",
                nullable: true);
        }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.AddColumn<DateTimeOffset>(
         name: "CreatedAt",
         table: "FileUploads",
         nullable: false,
         defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
     migrationBuilder.AddColumn<DateTimeOffset>(
         name: "ProcessedAt",
         table: "AccountStatements",
         nullable: true);
 }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "dateTime",
                table: "CarReservation");

            migrationBuilder.DropColumn(
                name: "length",
                table: "CarReservation");

            migrationBuilder.DropColumn(
                name: "name",
                table: "CarReservation");

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

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

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

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

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

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

            migrationBuilder.AddColumn<string>(
                name: "TravelInsurance",
                table: "CarReservation",
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "WidgetData",
                table: "Cms_WidgetInstance");

            migrationBuilder.DropColumn(
                name: "WidgetZone",
                table: "Cms_WidgetInstance");

            migrationBuilder.CreateTable(
                name: "Cms_WidgetZone",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    Description = table.Column<string>(nullable: true),
                    Name = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Cms_WidgetZone", x => x.Id);
                });

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

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

            migrationBuilder.AddColumn<long>(
                name: "WidgetZoneId",
                table: "Cms_WidgetInstance",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.CreateIndex(
                name: "IX_Cms_WidgetInstance_WidgetZoneId",
                table: "Cms_WidgetInstance",
                column: "WidgetZoneId");

            migrationBuilder.AddForeignKey(
                name: "FK_Cms_WidgetInstance_Cms_WidgetZone_WidgetZoneId",
                table: "Cms_WidgetInstance",
                column: "WidgetZoneId",
                principalTable: "Cms_WidgetZone",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "Country",
                table: "cs_User",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "State",
                table: "cs_User",
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "BirthdayDate",
                table: "Players",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsActive",
                table: "Players",
                nullable: true);
        }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.AddColumn<string>(
         name: "NoteTitle",
         table: "Bookmark",
         nullable: true);
     migrationBuilder.AddColumn<DateTime>(
         name: "NoteUpdated",
         table: "Bookmark",
         nullable: false,
         defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
 }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "FirstName",
                table: "AspNetUsers",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "LastName",
                table: "AspNetUsers",
                nullable: true);
        }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
     migrationBuilder.DropColumn(name: "ChineseSentenceExample", table: "Vocabulary");
     migrationBuilder.AddColumn<string>(
         name: "Example",
         table: "Vocabulary",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "Pinyin",
         table: "Vocabulary",
         nullable: true);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
         table: "AspNetUserClaims",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
         table: "AspNetUserLogins",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
         table: "AspNetUserRoles",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Cascade);
 }
 protected override void Down(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
     migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
     migrationBuilder.DropColumn(name: "BarberId", table: "AspNetUsers");
     migrationBuilder.AddColumn<string>(
         name: "FirstName",
         table: "AspNetUsers",
         nullable: true);
     migrationBuilder.AddColumn<string>(
         name: "LastName",
         table: "AspNetUsers",
         nullable: true);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
         table: "AspNetRoleClaims",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Restrict);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
         table: "AspNetUserClaims",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Restrict);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
         table: "AspNetUserLogins",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Restrict);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
         table: "AspNetUserRoles",
         column: "RoleId",
         principalTable: "AspNetRoles",
         principalColumn: "Id",
         onDelete: ReferentialAction.Restrict);
     migrationBuilder.AddForeignKey(
         name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
         table: "AspNetUserRoles",
         column: "UserId",
         principalTable: "AspNetUsers",
         principalColumn: "Id",
         onDelete: ReferentialAction.Restrict);
 }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.AddColumn<DateTime>(
         name: "ExtractedDate",
         table: "Activity",
         isNullable: false,
         defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
     migrationBuilder.AddColumn<int>(
         name: "Rank",
         table: "Activity",
         isNullable: false,
         defaultValue: 0);
 }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "ResetPasswordDateTime",
                table: "User",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<string>(
                name: "ResetPasswordToken",
                table: "User",
                nullable: true);
        }
 public override void Up(MigrationBuilder migration)
 {
     migration.AddColumn(
         name: "Contenido",
         table: "Cursos",
         type: "nvarchar(max)",
         nullable: false);
     migration.AddColumn(
         name: "Requisitos",
         table: "Cursos",
         type: "nvarchar(max)",
         nullable: true);
 }
 protected override void Up(MigrationBuilder migrationBuilder)
 {
     migrationBuilder.AddColumn<bool>(
         name: "Deleted",
         table: "NewsArticle",
         nullable: false,
         defaultValue: false);
     migrationBuilder.AddColumn<bool>(
         name: "Deleted",
         table: "BlogEntry",
         nullable: false,
         defaultValue: false);
 }
Exemple #32
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder?.AddColumn <DateTime>(
                name: "CreatedDate",
                table: "TR_LOG",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder?.AddColumn <int>(
                name: "Id",
                table: "TR_LOG",
                nullable: false,
                defaultValue: 0)
            .Annotation("SqlServer:Identity", "1, 1");
        }
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SamuraiBattle");

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

            migrationBuilder.CreateIndex(
                name: "IX_Samurais_BattleId",
                table: "Samurais",
                column: "BattleId");

            migrationBuilder.AddForeignKey(
                name: "FK_Samurais_Battles_BattleId",
                table: "Samurais",
                column: "BattleId",
                principalTable: "Battles",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <int>(
                name: "UnitId",
                table: "Communitys",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "AcquisitionUnit",
                columns: table => new
            {
                Id = table.Column <int>(nullable: false)
                     .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                Result       = table.Column <int>(nullable: false),
                Info         = table.Column <string>(nullable: true),
                CreateTime   = table.Column <long>(nullable: false),
                ModifiedTime = table.Column <long>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_AcquisitionUnit", x => x.Id);
            });

            migrationBuilder.CreateIndex(
                name: "IX_Communitys_UnitId",
                table: "Communitys",
                column: "UnitId");

            migrationBuilder.AddForeignKey(
                name: "FK_Communitys_AcquisitionUnit_UnitId",
                table: "Communitys",
                column: "UnitId",
                principalTable: "AcquisitionUnit",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "InstructorName",
                table: "Courses");

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

            migrationBuilder.CreateIndex(
                name: "IX_Courses_InstructorId",
                table: "Courses",
                column: "InstructorId");

            migrationBuilder.AddForeignKey(
                name: "FK_Courses_FacultyMembers_InstructorId",
                table: "Courses",
                column: "InstructorId",
                principalTable: "FacultyMembers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
Exemple #36
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Affiliate");

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

            migrationBuilder.CreateIndex(
                name: "IX_Company_RegionId",
                table: "Company",
                column: "RegionId");

            migrationBuilder.AddForeignKey(
                name: "FK_Company_Regions_RegionId",
                table: "Company",
                column: "RegionId",
                principalTable: "Regions",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
Exemple #37
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn <string>(
                name: "Name",
                table: "AspNetUserTokens",
                nullable: false,
                oldClrType: typeof(string),
                oldMaxLength: 128);

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

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

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

            migrationBuilder.AlterColumn <string>(
                name: "LoginProvider",
                table: "AspNetUserLogins",
                nullable: false,
                oldClrType: typeof(string),
                oldMaxLength: 128);
        }
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WatchedMovies");

            migrationBuilder.AddColumn<int>(
                name: "UserId",
                table: "Movies",
                type: "integer",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Movies_UserId",
                table: "Movies",
                column: "UserId");

            migrationBuilder.AddForeignKey(
                name: "FK_Movies_Users_UserId",
                table: "Movies",
                column: "UserId",
                principalTable: "Users",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
Exemple #39
0
    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.AddColumn <int>(
            name: "NewsType",
            table: "ThirdNews",
            type: "integer",
            nullable: false,
            defaultValue: 0);

        migrationBuilder.CreateIndex(
            name: "IX_ThirdNews_IdentityId",
            table: "ThirdNews",
            column: "IdentityId");

        migrationBuilder.CreateIndex(
            name: "IX_ThirdNews_NewsType",
            table: "ThirdNews",
            column: "NewsType");

        migrationBuilder.CreateIndex(
            name: "IX_ThirdNews_Type",
            table: "ThirdNews",
            column: "Type");
    }
Exemple #40
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <string>(
                name: "ContentType",
                table: "student",
                nullable: true);

            migrationBuilder.AddColumn <byte[]>(
                name: "Data",
                table: "student",
                nullable: true);

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

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

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

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

            migrationBuilder.AddColumn <int>(
                name: "Width",
                table: "student",
                nullable: true);
        }
Exemple #41
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <string>(
                name: "AtocCode",
                table: "Stops",
                nullable: true);

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

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

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

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

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

            migrationBuilder.AddColumn <string>(
                name: "ServiceType",
                table: "Stops",
                nullable: true);
        }
Exemple #42
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "DateCreated",
                table: "AspNetUsers",
                nullable: true);

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

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

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

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

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

            migrationBuilder.AddColumn<string>(
                name: "Discriminator",
                table: "AspNetUsers",
                nullable: false,
                defaultValue: "");
        }
Exemple #43
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <string>(
                name: "Dependencies",
                table: "Plan",
                nullable: true);

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

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

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

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

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

            migrationBuilder.AddColumn <string>(
                name: "ServerAccess",
                table: "Plan",
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Text",
                table: "Blogs");

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

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

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

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

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

            migrationBuilder.AddColumn <string>(
                name: "Text2",
                table: "Blogs",
                nullable: false,
                defaultValue: "");
        }
Exemple #45
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <long>(
                name: "Age",
                table: "Students",
                type: "bigint",
                maxLength: 3,
                nullable: true);

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

            migrationBuilder.AddColumn <string>(
                name: "LastName",
                table: "Students",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true);

            migrationBuilder.AddColumn <string>(
                name: "Name",
                table: "Students",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "RegisteredDate",
                table: "Students",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "StudyDate",
                table: "Students",
                type: "datetime2",
                nullable: true);
        }
Exemple #46
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CourseSections");

            migrationBuilder.DropTable(
                name: "Cars");

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

            migrationBuilder.AddColumn<string>(
                name: "TimeActual",
                table: "Checkpoints",
                maxLength: 250,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "TimeError",
                table: "Checkpoints",
                maxLength: 250,
                nullable: true);

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

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

            migrationBuilder.AddColumn<string>(
                name: "TimeTrue",
                table: "Checkpoints",
                maxLength: 250,
                nullable: true);
        }
Exemple #47
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <string>(
                name: "AuthorName",
                table: "tbl_MultipleImagePost",
                type: "nvarchar(max)",
                nullable: true);

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

            migrationBuilder.AddColumn <bool>(
                name: "IsActive",
                table: "tbl_MultipleImagePost",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn <DateTime>(
                name: "PublishDate",
                table: "tbl_MultipleImagePost",
                type: "datetime",
                nullable: true);

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

            migrationBuilder.AddColumn <string>(
                name: "Tag",
                table: "tbl_MultipleImagePost",
                type: "nvarchar(max)",
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "City",
                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<int>(
                name: "PoatalCode",
                table: "AspNetUsers",
                type: "int",
                nullable: true);

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

            migrationBuilder.AddColumn<string>(
                name: "StreetAddress",
                table: "AspNetUsers",
                type: "nvarchar(max)",
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <DateTime>(
                name: "Birth",
                table: "AspNetUsers",
                type: "datetime2",
                nullable: true);

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

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

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

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

            migrationBuilder.AddColumn <string>(
                name: "State",
                table: "AspNetUsers",
                type: "nvarchar(max)",
                nullable: true);
        }
Exemple #50
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <DateTime>(
                name: "CreatedDate",
                table: "Votes",
                nullable: false,
                defaultValueSql: "GETUTCDATE()");

            migrationBuilder.AddColumn <DateTime>(
                name: "CreatedDate",
                table: "Users",
                nullable: false,
                defaultValueSql: "GETUTCDATE()");

            migrationBuilder.AddColumn <DateTime>(
                name: "CreatedDate",
                table: "Spams",
                nullable: false,
                defaultValueSql: "GETUTCDATE()"
                );

            migrationBuilder.AddColumn <DateTime>(
                name: "CreatedDate",
                table: "Feedbacks",
                nullable: false,
                defaultValueSql: "GETUTCDATE()");

            migrationBuilder.AddColumn <DateTime>(
                name: "CreatedDate",
                table: "Comments",
                nullable: false,
                defaultValueSql: "GETUTCDATE()");

            migrationBuilder.AddColumn <DateTime>(
                name: "CreatedDate",
                table: "Channels",
                nullable: false,
                defaultValueSql: "GETUTCDATE()");
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <int>(
                name: "Index",
                table: "Strata",
                nullable: false,
                defaultValue: 0);

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

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

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

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

            migrationBuilder.AddColumn <int>(
                name: "Index",
                table: "Activity",
                nullable: false,
                defaultValue: 0);
        }
Exemple #52
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <string>(
                name: "AddressLine1",
                table: "AspNetUsers",
                maxLength: 60,
                nullable: true);

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

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

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

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

            migrationBuilder.AddColumn <string>(
                name: "LastName",
                table: "AspNetUsers",
                maxLength: 50,
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "EmergencyContact",
                table: "Applicant");

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

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

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

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

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

            migrationBuilder.AddColumn <string>(
                name: "Phone3",
                table: "Applicant",
                nullable: true);
        }
Exemple #54
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Reservation");

            migrationBuilder.AddColumn <DateTime>(
                name: "MaternityRoomReservationEnd",
                table: "Person",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "MaternityRoomReservationStart",
                table: "Person",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn <int>(
                name: "MaternityRoomRoomId",
                table: "Person",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "RestingRoomReservationEnd",
                table: "Person",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "RestingRoomReservationStart",
                table: "Person",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn <int>(
                name: "RestingRoomRoomId",
                table: "Person",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn <DateTime>(
                name: "BirthRoomReservationEnd",
                table: "Birth",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <DateTime>(
                name: "BirthRoomReservationStart",
                table: "Birth",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn <int>(
                name: "BirthRoomRoomId",
                table: "Birth",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn <int>(
                name: "BirthRoomRoomId1",
                table: "Birth",
                type: "int",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Person_MaternityRoomRoomId",
                table: "Person",
                column: "MaternityRoomRoomId");

            migrationBuilder.CreateIndex(
                name: "IX_Person_RestingRoomRoomId",
                table: "Person",
                column: "RestingRoomRoomId");

            migrationBuilder.CreateIndex(
                name: "IX_Birth_BirthRoomRoomId",
                table: "Birth",
                column: "BirthRoomRoomId");

            migrationBuilder.CreateIndex(
                name: "IX_Birth_BirthRoomRoomId1",
                table: "Birth",
                column: "BirthRoomRoomId1");

            migrationBuilder.AddForeignKey(
                name: "FK_Birth_Room_BirthRoomRoomId",
                table: "Birth",
                column: "BirthRoomRoomId",
                principalTable: "Room",
                principalColumn: "RoomId",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Birth_Room_BirthRoomRoomId1",
                table: "Birth",
                column: "BirthRoomRoomId1",
                principalTable: "Room",
                principalColumn: "RoomId",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Person_Room_MaternityRoomRoomId",
                table: "Person",
                column: "MaternityRoomRoomId",
                principalTable: "Room",
                principalColumn: "RoomId",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_Person_Room_RestingRoomRoomId",
                table: "Person",
                column: "RestingRoomRoomId",
                principalTable: "Room",
                principalColumn: "RoomId",
                onDelete: ReferentialAction.Restrict);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "factura_origen",
                table: "documento",
                newName: "factura_origen_serie");

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

            migrationBuilder.AlterColumn <decimal>(
                name: "monto_acumulado",
                table: "ordenes_compra",
                type: "decimal(10, 2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "money");

            migrationBuilder.AlterColumn <decimal>(
                name: "monto_total",
                table: "documento",
                type: "decimal(10, 2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "money");

            migrationBuilder.AlterColumn <decimal>(
                name: "monto_subtotal_inafecto",
                table: "documento",
                type: "decimal(10, 2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "money");

            migrationBuilder.AlterColumn <decimal>(
                name: "monto_subtotal_afecto",
                table: "documento",
                type: "decimal(10, 2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "money");

            migrationBuilder.AlterColumn <decimal>(
                name: "monto_isc",
                table: "documento",
                type: "decimal(10, 2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "money");

            migrationBuilder.AlterColumn <decimal>(
                name: "monto_igv",
                table: "documento",
                type: "decimal(10, 2)",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "money");

            migrationBuilder.AddColumn <string>(
                name: "factura_origen_correlativo",
                table: "documento",
                type: "varchar(30)",
                nullable: true);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "DateAdded",
                table: "Products",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

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

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

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

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

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

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

            migrationBuilder.CreateTable(
                name: "Image",
                columns: table => new
                {
                    ImageId = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ImageName = table.Column<string>(nullable: true),
                    ProductId = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Image", x => x.ImageId);
                    table.ForeignKey(
                        name: "FK_Image_Products_ProductId",
                        column: x => x.ProductId,
                        principalTable: "Products",
                        principalColumn: "ProductId",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "Orders",
                columns: table => new
                {
                    OrderId = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Orders", x => x.OrderId);
                });

            migrationBuilder.CreateTable(
                name: "ProductAttribute",
                columns: table => new
                {
                    ProductAttributeId = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Attribute = table.Column<string>(nullable: true),
                    Value = table.Column<string>(nullable: true),
                    ProductId = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProductAttribute", x => x.ProductAttributeId);
                    table.ForeignKey(
                        name: "FK_ProductAttribute_Products_ProductId",
                        column: x => x.ProductId,
                        principalTable: "Products",
                        principalColumn: "ProductId",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_Image_ProductId",
                table: "Image",
                column: "ProductId");

            migrationBuilder.CreateIndex(
                name: "IX_ProductAttribute_ProductId",
                table: "ProductAttribute",
                column: "ProductId");
        }
Exemple #57
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn <int>(
                name: "TreinadorId",
                table: "Times",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateTable(
                name: "Campeonato",
                columns: table => new
            {
                CampeonatoId = table.Column <int>(nullable: false)
                               .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                Preciacao      = table.Column <decimal>(nullable: false),
                Nome           = table.Column <string>(nullable: true),
                TipoCampeonato = table.Column <int>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Campeonato", x => x.CampeonatoId);
            });

            migrationBuilder.CreateTable(
                name: "Jogador",
                columns: table => new
            {
                JogadorId = table.Column <int>(nullable: false)
                            .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                Nome           = table.Column <string>(nullable: true),
                DataNascimento = table.Column <int>(nullable: false),
                Altura         = table.Column <float>(nullable: false),
                TimeId         = table.Column <int>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Jogador", x => x.JogadorId);
                table.ForeignKey(
                    name: "FK_Jogador_Times_TimeId",
                    column: x => x.TimeId,
                    principalTable: "Times",
                    principalColumn: "TimeId",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateTable(
                name: "Treinador",
                columns: table => new
            {
                TreinadorId = table.Column <int>(nullable: false)
                              .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                Nome    = table.Column <string>(nullable: true),
                Salario = table.Column <decimal>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Treinador", x => x.TreinadorId);
            });

            migrationBuilder.CreateTable(
                name: "CampeonatoTime",
                columns: table => new
            {
                TimeId       = table.Column <int>(nullable: false),
                CampeonatoId = table.Column <int>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_CampeonatoTime", x => new { x.CampeonatoId, x.TimeId });
                table.ForeignKey(
                    name: "FK_CampeonatoTime_Times_CampeonatoId",
                    column: x => x.CampeonatoId,
                    principalTable: "Times",
                    principalColumn: "TimeId",
                    onDelete: ReferentialAction.Cascade);
                table.ForeignKey(
                    name: "FK_CampeonatoTime_Campeonato_TimeId",
                    column: x => x.TimeId,
                    principalTable: "Campeonato",
                    principalColumn: "CampeonatoId",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateIndex(
                name: "IX_Times_TreinadorId",
                table: "Times",
                column: "TreinadorId");

            migrationBuilder.CreateIndex(
                name: "IX_CampeonatoTime_TimeId",
                table: "CampeonatoTime",
                column: "TimeId");

            migrationBuilder.CreateIndex(
                name: "IX_Jogador_TimeId",
                table: "Jogador",
                column: "TimeId");

            migrationBuilder.AddForeignKey(
                name: "FK_Times_Treinador_TreinadorId",
                table: "Times",
                column: "TreinadorId",
                principalTable: "Treinador",
                principalColumn: "TreinadorId",
                onDelete: ReferentialAction.Cascade);
        }
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn <string>(
                name: "LastName",
                table: "Student",
                maxLength: 50,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true);

            migrationBuilder.AlterColumn <string>(
                name: "Title",
                table: "Course",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            //migrationBuilder.AddColumn<int>(
            //    name: "DepartmentID",
            //    table: "Course",
            //    nullable: false,
            //    defaultValue: 0);

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

            migrationBuilder.CreateTable(
                name: "CourseAssignment",
                columns: table => new
            {
                InstructorID = table.Column <int>(nullable: false),
                CourseID     = table.Column <int>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_CourseAssignment", x => new { x.CourseID, x.InstructorID });
                table.ForeignKey(
                    name: "FK_CourseAssignment_Course_CourseID",
                    column: x => x.CourseID,
                    principalTable: "Course",
                    principalColumn: "CourseID",
                    onDelete: ReferentialAction.Cascade);
                table.ForeignKey(
                    name: "FK_CourseAssignment_Instructor_InstructorID",
                    column: x => x.InstructorID,
                    principalTable: "Instructor",
                    principalColumn: "ID",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateTable(
                name: "Department",
                columns: table => new
            {
                DepartmentID = table.Column <int>(nullable: false)
                               .Annotation("SqlServer:Identity", "1, 1"),
                Name         = table.Column <string>(maxLength: 50, nullable: true),
                Budget       = table.Column <decimal>(type: "money", nullable: false),
                StartDate    = table.Column <DateTime>(nullable: false),
                InstructorID = table.Column <int>(nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Department", x => x.DepartmentID);
                table.ForeignKey(
                    name: "FK_Department_Instructor_InstructorID",
                    column: x => x.InstructorID,
                    principalTable: "Instructor",
                    principalColumn: "ID",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.Sql("INSERT INTO dbo.Department (Name, Budget, StartDate) VALUES ('Temp', 0.00, GETDATE())");
            // Default value for FK points to department created above, with
            // defaultValue changed to 1 in following AddColumn statement.

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

            migrationBuilder.CreateTable(
                name: "OfficeAssignment",
                columns: table => new
            {
                InstructorID = table.Column <int>(nullable: false),
                Location     = table.Column <string>(maxLength: 50, nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_OfficeAssignment", x => x.InstructorID);
                table.ForeignKey(
                    name: "FK_OfficeAssignment_Instructor_InstructorID",
                    column: x => x.InstructorID,
                    principalTable: "Instructor",
                    principalColumn: "ID",
                    onDelete: ReferentialAction.Cascade);
            });

            migrationBuilder.CreateIndex(
                name: "IX_Course_DepartmentID",
                table: "Course",
                column: "DepartmentID");

            migrationBuilder.CreateIndex(
                name: "IX_CourseAssignment_InstructorID",
                table: "CourseAssignment",
                column: "InstructorID");

            migrationBuilder.CreateIndex(
                name: "IX_Department_InstructorID",
                table: "Department",
                column: "InstructorID");

            migrationBuilder.AddForeignKey(
                name: "FK_Course_Department_DepartmentID",
                table: "Course",
                column: "DepartmentID",
                principalTable: "Department",
                principalColumn: "DepartmentID",
                onDelete: ReferentialAction.Cascade);
        }
Exemple #59
0
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DeleteData(
                table: "Usuarios",
                keyColumn: "Id",
                keyValue: new Guid("d9135e33-9763-493c-9c36-e9fa427e150e"));

            migrationBuilder.DropColumn(
                name: "StatusTarefa",
                table: "Tarefas");

            migrationBuilder.AlterColumn <DateTime>(
                name: "DataRemocao",
                table: "Tarefas",
                type: "datetime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldNullable: true);

            migrationBuilder.AlterColumn <DateTime>(
                name: "DataEdicao",
                table: "Tarefas",
                type: "datetime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldNullable: true);

            migrationBuilder.AlterColumn <DateTime>(
                name: "DataConclusao",
                table: "Tarefas",
                type: "datetime2",
                nullable: false,
                oldClrType: typeof(DateTime),
                oldNullable: true);

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

            migrationBuilder.CreateTable(
                name: "Status",
                columns: table => new
            {
                Id        = table.Column <Guid>(type: "uniqueidentifier", nullable: false),
                Descricao = table.Column <string>(type: "nvarchar(max)", nullable: true)
            },
                constraints: table =>
            {
                table.PrimaryKey("PK_Status", x => x.Id);
            });

            migrationBuilder.InsertData(
                table: "Usuarios",
                columns: new[] { "Id", "Login", "Nome", "Senha" },
                values: new object[] { new Guid("6b050e42-c54a-4a8f-bfef-c7ea09dbf308"), "Admin", "Administrador", "12345" });

            migrationBuilder.CreateIndex(
                name: "IX_Tarefas_StatusId",
                table: "Tarefas",
                column: "StatusId");

            migrationBuilder.AddForeignKey(
                name: "FK_Tarefas_Status_StatusId",
                table: "Tarefas",
                column: "StatusId",
                principalTable: "Status",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
Exemple #60
0
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "user_bounty_campaing_item");

            migrationBuilder.DropTable(
                name: "bounty_campaing_item_type");

            migrationBuilder.DropTable(
                name: "user_bounty_campaing");

            migrationBuilder.DropPrimaryKey(
                name: "pk_bounty_campaing",
                table: "bounty_campaing");

            migrationBuilder.EnsureSchema(
                name: "bounty");

            migrationBuilder.RenameTable(
                name: "bounty_campaing",
                newName: "campaing",
                newSchema: "bounty");

            migrationBuilder.AddColumn <string>(
                name: "created_by_user_id",
                schema: "bounty",
                table: "campaing",
                nullable: false,
                defaultValue: "");

            migrationBuilder.Sql("update bounty.campaing set created_by_user_id = (select id from identity.users limit 1)");

            migrationBuilder.AddColumn <DateTime>(
                name: "date_created",
                schema: "bounty",
                table: "campaing",
                nullable: false,
                defaultValueSql: "now()");

            migrationBuilder.AddPrimaryKey(
                name: "pk_campaing",
                schema: "bounty",
                table: "campaing",
                column: "id");

            migrationBuilder.CreateTable(
                name: "campaing_activity",
                schema: "bounty",
                columns: table => new
            {
                id = table.Column <string>(nullable: false),
                bounty_campaing_id = table.Column <string>(nullable: false),
                created_by_user_id = table.Column <string>(nullable: false),
                date_created       = table.Column <DateTime>(nullable: false, defaultValueSql: "now()"),
                is_deleted         = table.Column <bool>(nullable: false),
                name            = table.Column <string>(maxLength: 200, nullable: false),
                need_to_approve = table.Column <bool>(nullable: false),
                price           = table.Column <decimal>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("pk_campaing_activity", x => x.id);
                table.ForeignKey(
                    name: "fk_campaing_activity_campaing_bounty_campaing_id",
                    column: x => x.bounty_campaing_id,
                    principalSchema: "bounty",
                    principalTable: "campaing",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_campaing_activity_users_created_by_user_id",
                    column: x => x.created_by_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateTable(
                name: "favorite_user",
                schema: "bounty",
                columns: table => new
            {
                user_id            = table.Column <string>(nullable: false),
                favorite_user_id   = table.Column <string>(nullable: false),
                created_by_user_id = table.Column <string>(nullable: false),
                date_created       = table.Column <DateTime>(nullable: false, defaultValueSql: "now()")
            },
                constraints: table =>
            {
                table.PrimaryKey("pk_favorite_user", x => new { x.user_id, x.favorite_user_id });
                table.ForeignKey(
                    name: "fk_favorite_user_users_created_by_user_id",
                    column: x => x.created_by_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_favorite_user_users_favorite_user_id",
                    column: x => x.favorite_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_favorite_user_users_user_id",
                    column: x => x.user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateTable(
                name: "user_campaing",
                schema: "bounty",
                columns: table => new
            {
                user_id            = table.Column <string>(nullable: false),
                bounty_campaing_id = table.Column <string>(nullable: false),
                created_by_user_id = table.Column <string>(nullable: false),
                date_created       = table.Column <DateTime>(nullable: false, defaultValueSql: "now()"),
                is_deleted         = table.Column <bool>(nullable: false),
                total_coin_earned  = table.Column <decimal>(nullable: false, defaultValue: 0m),
                total_item_count   = table.Column <int>(nullable: false, defaultValue: 0)
            },
                constraints: table =>
            {
                table.PrimaryKey("pk_user_campaing", x => new { x.user_id, x.bounty_campaing_id });
                table.ForeignKey(
                    name: "fk_user_campaing_campaing_bounty_campaing_id",
                    column: x => x.bounty_campaing_id,
                    principalSchema: "bounty",
                    principalTable: "campaing",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_user_campaing_users_created_by_user_id",
                    column: x => x.created_by_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_user_campaing_users_user_id",
                    column: x => x.user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateTable(
                name: "campaing_task",
                schema: "bounty",
                columns: table => new
            {
                id = table.Column <string>(nullable: false),
                bounty_campaing_activity_id = table.Column <string>(nullable: false),
                bounty_campaing_id          = table.Column <string>(nullable: false),
                created_by_user_id          = table.Column <string>(nullable: false),
                date_created = table.Column <DateTime>(nullable: false, defaultValueSql: "now()"),
                description  = table.Column <string>(type: "text", nullable: false),
                is_deleted   = table.Column <bool>(nullable: false),
                is_private   = table.Column <bool>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("pk_campaing_task", x => x.id);
                table.ForeignKey(
                    name: "fk_campaing_task_campaing_activity_bounty_campaing_activity_id",
                    column: x => x.bounty_campaing_activity_id,
                    principalSchema: "bounty",
                    principalTable: "campaing_activity",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_campaing_task_campaing_bounty_campaing_id",
                    column: x => x.bounty_campaing_id,
                    principalSchema: "bounty",
                    principalTable: "campaing",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_campaing_task_users_created_by_user_id",
                    column: x => x.created_by_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateTable(
                name: "campaing_accepted_task",
                schema: "bounty",
                columns: table => new
            {
                accepted_by_user_id     = table.Column <string>(nullable: false),
                bounty_campaing_task_id = table.Column <string>(nullable: false),
                blob_oid           = table.Column <int>(nullable: true),
                comment            = table.Column <string>(maxLength: 256, nullable: true),
                created_by_user_id = table.Column <string>(nullable: false),
                date_created       = table.Column <DateTime>(nullable: false, defaultValueSql: "now()"),
                status             = table.Column <int>(nullable: false),
                url = table.Column <string>(maxLength: 256, nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("pk_campaing_accepted_task", x => new { x.accepted_by_user_id, x.bounty_campaing_task_id });
                table.ForeignKey(
                    name: "fk_campaing_accepted_task_users_accepted_by_user_id",
                    column: x => x.accepted_by_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_campaing_accepted_task_campaing_task_bounty_campaing_task_id",
                    column: x => x.bounty_campaing_task_id,
                    principalSchema: "bounty",
                    principalTable: "campaing_task",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_campaing_accepted_task_users_created_by_user_id",
                    column: x => x.created_by_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateTable(
                name: "campaing_task_assignment",
                schema: "bounty",
                columns: table => new
            {
                assigned_to_user_id     = table.Column <string>(nullable: false),
                bounty_campaing_task_id = table.Column <string>(nullable: false),
                created_by_user_id      = table.Column <string>(nullable: false),
                date_created            = table.Column <DateTime>(nullable: false, defaultValueSql: "now()"),
                is_deleted = table.Column <bool>(nullable: false)
            },
                constraints: table =>
            {
                table.PrimaryKey("pk_campaing_task_assignment", x => new { x.assigned_to_user_id, x.bounty_campaing_task_id });
                table.ForeignKey(
                    name: "fk_campaing_task_assignment_users_assigned_to_user_id",
                    column: x => x.assigned_to_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_campaing_task_assignment_campaing_task_bounty_campaing_task_id",
                    column: x => x.bounty_campaing_task_id,
                    principalSchema: "bounty",
                    principalTable: "campaing_task",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
                table.ForeignKey(
                    name: "fk_campaing_task_assignment_users_created_by_user_id",
                    column: x => x.created_by_user_id,
                    principalSchema: "identity",
                    principalTable: "users",
                    principalColumn: "id",
                    onDelete: ReferentialAction.Restrict);
            });

            migrationBuilder.CreateIndex(
                name: "ix_campaing_created_by_user_id",
                schema: "bounty",
                table: "campaing",
                column: "created_by_user_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_accepted_task_bounty_campaing_task_id",
                schema: "bounty",
                table: "campaing_accepted_task",
                column: "bounty_campaing_task_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_accepted_task_created_by_user_id",
                schema: "bounty",
                table: "campaing_accepted_task",
                column: "created_by_user_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_activity_bounty_campaing_id",
                schema: "bounty",
                table: "campaing_activity",
                column: "bounty_campaing_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_activity_created_by_user_id",
                schema: "bounty",
                table: "campaing_activity",
                column: "created_by_user_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_task_bounty_campaing_activity_id",
                schema: "bounty",
                table: "campaing_task",
                column: "bounty_campaing_activity_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_task_bounty_campaing_id",
                schema: "bounty",
                table: "campaing_task",
                column: "bounty_campaing_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_task_created_by_user_id",
                schema: "bounty",
                table: "campaing_task",
                column: "created_by_user_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_task_assignment_bounty_campaing_task_id",
                schema: "bounty",
                table: "campaing_task_assignment",
                column: "bounty_campaing_task_id");

            migrationBuilder.CreateIndex(
                name: "ix_campaing_task_assignment_created_by_user_id",
                schema: "bounty",
                table: "campaing_task_assignment",
                column: "created_by_user_id");

            migrationBuilder.CreateIndex(
                name: "ix_favorite_user_created_by_user_id",
                schema: "bounty",
                table: "favorite_user",
                column: "created_by_user_id");

            migrationBuilder.CreateIndex(
                name: "ix_favorite_user_favorite_user_id",
                schema: "bounty",
                table: "favorite_user",
                column: "favorite_user_id");

            migrationBuilder.CreateIndex(
                name: "ix_user_campaing_bounty_campaing_id",
                schema: "bounty",
                table: "user_campaing",
                column: "bounty_campaing_id");

            migrationBuilder.CreateIndex(
                name: "ix_user_campaing_created_by_user_id",
                schema: "bounty",
                table: "user_campaing",
                column: "created_by_user_id");

            migrationBuilder.AddForeignKey(
                name: "fk_campaing_users_created_by_user_id",
                schema: "bounty",
                table: "campaing",
                column: "created_by_user_id",
                principalSchema: "identity",
                principalTable: "users",
                principalColumn: "id",
                onDelete: ReferentialAction.Restrict);
        }