using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace NetinaShop.Repository.Migrations { /// public partial class AddPayment : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Payments", schema: "public", columns: table => new { Id = table.Column(type: "uuid", nullable: false), FactorNumber = table.Column(type: "text", nullable: false), Amount = table.Column(type: "double precision", nullable: false), Description = table.Column(type: "text", nullable: false), TransactionCode = table.Column(type: "text", nullable: false), CardPan = table.Column(type: "text", nullable: false), Authority = table.Column(type: "text", nullable: false), Type = table.Column(type: "integer", nullable: false), Status = table.Column(type: "integer", nullable: false), OrderId = table.Column(type: "uuid", nullable: false), UserId = table.Column(type: "uuid", nullable: false), RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), CreatedBy = table.Column(type: "text", nullable: true), IsRemoved = table.Column(type: "boolean", nullable: false), RemovedBy = table.Column(type: "text", nullable: true), ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), ModifiedBy = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Payments", x => x.Id); table.ForeignKey( name: "FK_Payments_Orders_OrderId", column: x => x.OrderId, principalSchema: "public", principalTable: "Orders", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Payments_Users_UserId", column: x => x.UserId, principalSchema: "public", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_Payments_OrderId", schema: "public", table: "Payments", column: "OrderId"); migrationBuilder.CreateIndex( name: "IX_Payments_UserId", schema: "public", table: "Payments", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Payments", schema: "public"); } } }