Skip to content

Commit

Permalink
Clean up of purchase data (#190)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Anker Rasmussen <jonasanker@gmail.com>
  • Loading branch information
TTA777 and jonasanker authored Sep 22, 2023
1 parent 051e0b7 commit 3942151
Show file tree
Hide file tree
Showing 20 changed files with 2,638 additions and 29 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace CoffeeCard.Library.Migrations
{
public partial class AddPurchaseTypes : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "PurchaseId",
schema: "dbo",
table: "Vouchers",
type: "int",
nullable: true);

migrationBuilder.AddColumn<string>(
name: "Type",
schema: "dbo",
table: "Purchases",
type: "nvarchar(max)",
nullable: true);

migrationBuilder.CreateTable(
name: "PosPurchases",
schema: "dbo",
columns: table => new
{
PurchaseId = table.Column<int>(type: "int", nullable: false),
BaristaInitials = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PosPurchases", x => x.PurchaseId);
table.ForeignKey(
name: "FK_PosPurchases_Purchases_PurchaseId",
column: x => x.PurchaseId,
principalSchema: "dbo",
principalTable: "Purchases",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PosPurchases",
schema: "dbo");
}
}
}
Loading

0 comments on commit 3942151

Please sign in to comment.