using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Marco.Pms.DataAccess.Migrations { /// public partial class Added_CreatedBy_And_CareatedAt_In_Expense : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "CreatedAt", table: "Expenses", type: "datetime(6)", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddColumn( name: "CreatedById", table: "Expenses", type: "char(36)", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), collation: "ascii_general_ci"); migrationBuilder.CreateIndex( name: "IX_Expenses_CreatedById", table: "Expenses", column: "CreatedById"); migrationBuilder.AddForeignKey( name: "FK_Expenses_Employees_CreatedById", table: "Expenses", column: "CreatedById", principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Expenses_Employees_CreatedById", table: "Expenses"); migrationBuilder.DropIndex( name: "IX_Expenses_CreatedById", table: "Expenses"); migrationBuilder.DropColumn( name: "CreatedAt", table: "Expenses"); migrationBuilder.DropColumn( name: "CreatedById", table: "Expenses"); } } }