using Microsoft.EntityFrameworkCore.Migrations; namespace UnivateProperties_API.Migrations { public partial class templateMod : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "SenderId", table: "Templates", nullable: true); migrationBuilder.AddColumn( name: "TemplateId", table: "Individuals", nullable: true); migrationBuilder.AddColumn( name: "TemplateId", table: "Agents", nullable: true); migrationBuilder.AddColumn( name: "Default", table: "Accounts", nullable: false, defaultValue: false); migrationBuilder.CreateIndex( name: "IX_Templates_SenderId", table: "Templates", column: "SenderId"); migrationBuilder.CreateIndex( name: "IX_Individuals_TemplateId", table: "Individuals", column: "TemplateId"); migrationBuilder.CreateIndex( name: "IX_Agents_TemplateId", table: "Agents", column: "TemplateId"); migrationBuilder.AddForeignKey( name: "FK_Agents_Templates_TemplateId", table: "Agents", column: "TemplateId", principalTable: "Templates", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Individuals_Templates_TemplateId", table: "Individuals", column: "TemplateId", principalTable: "Templates", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Templates_Accounts_SenderId", table: "Templates", column: "SenderId", principalTable: "Accounts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Agents_Templates_TemplateId", table: "Agents"); migrationBuilder.DropForeignKey( name: "FK_Individuals_Templates_TemplateId", table: "Individuals"); migrationBuilder.DropForeignKey( name: "FK_Templates_Accounts_SenderId", table: "Templates"); migrationBuilder.DropIndex( name: "IX_Templates_SenderId", table: "Templates"); migrationBuilder.DropIndex( name: "IX_Individuals_TemplateId", table: "Individuals"); migrationBuilder.DropIndex( name: "IX_Agents_TemplateId", table: "Agents"); migrationBuilder.DropColumn( name: "SenderId", table: "Templates"); migrationBuilder.DropColumn( name: "TemplateId", table: "Individuals"); migrationBuilder.DropColumn( name: "TemplateId", table: "Agents"); migrationBuilder.DropColumn( name: "Default", table: "Accounts"); } } }