using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace MyOffice.Migrations.Postgres.Migrations { /// public partial class MotionAccountFix2 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AccountMotions", columns: table => new { Id = table.Column(type: "uuid", nullable: false), CreatedOn = table.Column(type: "timestamp with time zone", nullable: false), DateTime = table.Column(type: "timestamp with time zone", nullable: false), MotionId = table.Column(type: "integer", nullable: false), AccountId = table.Column(type: "uuid", nullable: false), Description = table.Column(type: "text", nullable: true), AmountPlus = table.Column(type: "numeric", nullable: false), AmountMinus = table.Column(type: "numeric", nullable: false), UserId = table.Column(type: "uuid", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AccountMotions", x => x.Id); table.ForeignKey( name: "FK_AccountMotions_Accounts_AccountId", column: x => x.AccountId, principalTable: "Accounts", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AccountMotions_Motions_MotionId", column: x => x.MotionId, principalTable: "Motions", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AccountMotions_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_AccountMotions_AccountId", table: "AccountMotions", column: "AccountId"); migrationBuilder.CreateIndex( name: "IX_AccountMotions_MotionId", table: "AccountMotions", column: "MotionId"); migrationBuilder.CreateIndex( name: "IX_AccountMotions_UserId", table: "AccountMotions", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AccountMotions"); } } }