gehgassi_backend/gehGassi.Persistence/Migrations/20230127105243_DevicesAdded.cs

52 lines
2.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace gehGassi.Persistence.Migrations
{
/// <inheritdoc />
public partial class DevicesAdded : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Devices",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AppUserId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
InstallationId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Platform = table.Column<int>(type: "int", nullable: false),
NotificationPlatform = table.Column<int>(type: "int", nullable: false),
Channel = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Created = table.Column<DateTimeOffset>(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");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Devices");
}
}
}