-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jonas Anker Rasmussen <jonasanker@gmail.com>
- Loading branch information
1 parent
051e0b7
commit 3942151
Showing
20 changed files
with
2,638 additions
and
29 deletions.
There are no files selected for viewing
572 changes: 572 additions & 0 deletions
572
coffeecard/CoffeeCard.Library/Migrations/20230711144034_AddPurchaseTypes.Designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
coffeecard/CoffeeCard.Library/Migrations/20230711144034_AddPurchaseTypes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} | ||
} |
Oops, something went wrong.