using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Hutopy.Infrastructure.Migrations
{
///
public partial class AddUserTransactions : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "UserTransactions",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Amount = table.Column(type: "decimal(18,2)", nullable: false),
Currency = table.Column(type: "nvarchar(max)", nullable: false),
TipMessage = table.Column(type: "nvarchar(max)", nullable: false),
ApplicationUserId = table.Column(type: "nvarchar(450)", nullable: false),
Created = table.Column(type: "datetimeoffset", nullable: false),
CreatedBy = table.Column(type: "nvarchar(max)", nullable: true),
LastModified = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_UserTransactions", x => x.Id);
table.ForeignKey(
name: "FK_UserTransactions_AspNetUsers_ApplicationUserId",
column: x => x.ApplicationUserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_UserTransactions_ApplicationUserId",
table: "UserTransactions",
column: "ApplicationUserId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UserTransactions");
}
}
}