using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace gehGassi.Persistence.Migrations { /// public partial class DevicesAdded : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Devices", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AppUserId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), InstallationId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Platform = table.Column(type: "int", nullable: false), NotificationPlatform = table.Column(type: "int", nullable: false), Channel = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Devices", x => x.Id); table.ForeignKey( name: "FK_Devices_AppUsers_AppUserId", column: x => x.AppUserId, principalTable: "AppUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Devices_AppUserId", table: "Devices", column: "AppUserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Devices"); } } }