aboutsummaryrefslogtreecommitdiffstats
path: root/src/Migrations/20210309193123_RemoveVippsResponses.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-06-01 21:13:43 +0200
committerivarlovlie <git@ivarlovlie.no>2022-06-01 21:13:43 +0200
commit9383a2fb09ffb60cfe63683106945bd688affa59 (patch)
tree65b3f4b48841583e355887db5de5a16e7005fc87 /src/Migrations/20210309193123_RemoveVippsResponses.cs
downloadvinjesvingenhandel.no-9383a2fb09ffb60cfe63683106945bd688affa59.tar.xz
vinjesvingenhandel.no-9383a2fb09ffb60cfe63683106945bd688affa59.zip
feat: Initial commit after clean slate
Diffstat (limited to 'src/Migrations/20210309193123_RemoveVippsResponses.cs')
-rw-r--r--src/Migrations/20210309193123_RemoveVippsResponses.cs81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/Migrations/20210309193123_RemoveVippsResponses.cs b/src/Migrations/20210309193123_RemoveVippsResponses.cs
new file mode 100644
index 0000000..8fdd4f0
--- /dev/null
+++ b/src/Migrations/20210309193123_RemoveVippsResponses.cs
@@ -0,0 +1,81 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace VSH.Migrations
+{
+ public partial class RemoveVippsResponses : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "VippsResponses");
+
+ migrationBuilder.AddColumn<int>(
+ name: "vipps_status",
+ table: "Orders",
+ type: "integer",
+ nullable: false,
+ defaultValue: 0);
+
+ migrationBuilder.AddColumn<string>(
+ name: "vipps_transaction_id",
+ table: "Orders",
+ type: "text",
+ nullable: true);
+
+ migrationBuilder.AddColumn<int>(
+ name: "vipps_transaction_status",
+ table: "Orders",
+ type: "integer",
+ nullable: false,
+ defaultValue: 0);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "vipps_status",
+ table: "Orders");
+
+ migrationBuilder.DropColumn(
+ name: "vipps_transaction_id",
+ table: "Orders");
+
+ migrationBuilder.DropColumn(
+ name: "vipps_transaction_status",
+ table: "Orders");
+
+ migrationBuilder.CreateTable(
+ name: "VippsResponses",
+ columns: table => new
+ {
+ id = table.Column<Guid>(type: "uuid", nullable: false),
+ cancellation_response = table.Column<string>(type: "jsonb", nullable: true),
+ capture_response = table.Column<string>(type: "jsonb", nullable: true),
+ created = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
+ error_response = table.Column<string>(type: "jsonb", nullable: true),
+ initiation_response = table.Column<string>(type: "jsonb", nullable: true),
+ order_id = table.Column<Guid>(type: "uuid", nullable: false),
+ payment_detail_response = table.Column<string>(type: "jsonb", nullable: true),
+ refund_response = table.Column<string>(type: "jsonb", nullable: true),
+ status_code = table.Column<int>(type: "integer", nullable: false),
+ updated = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_vipps_responses", x => x.id);
+ table.ForeignKey(
+ name: "fk_vipps_responses_orders_order_id",
+ column: x => x.order_id,
+ principalTable: "Orders",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "ix_vipps_responses_order_id",
+ table: "VippsResponses",
+ column: "order_id");
+ }
+ }
+}