53 lines
2.2 KiB
C#
53 lines
2.2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Hutopy.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddUserTransactions : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "UserTransactions",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
|
Currency = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
TipMessage = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
ApplicationUserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
|
Created = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
LastModified = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
|
LastModifiedBy = table.Column<string>(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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "UserTransactions");
|
|
}
|
|
}
|
|
}
|