From 9383a2fb09ffb60cfe63683106945bd688affa59 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Wed, 1 Jun 2022 21:13:43 +0200 Subject: feat: Initial commit after clean slate --- .../20210309193123_RemoveVippsResponses.cs | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/Migrations/20210309193123_RemoveVippsResponses.cs (limited to 'src/Migrations/20210309193123_RemoveVippsResponses.cs') 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( + name: "vipps_status", + table: "Orders", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "vipps_transaction_id", + table: "Orders", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + 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(type: "uuid", nullable: false), + cancellation_response = table.Column(type: "jsonb", nullable: true), + capture_response = table.Column(type: "jsonb", nullable: true), + created = table.Column(type: "timestamp without time zone", nullable: false), + error_response = table.Column(type: "jsonb", nullable: true), + initiation_response = table.Column(type: "jsonb", nullable: true), + order_id = table.Column(type: "uuid", nullable: false), + payment_detail_response = table.Column(type: "jsonb", nullable: true), + refund_response = table.Column(type: "jsonb", nullable: true), + status_code = table.Column(type: "integer", nullable: false), + updated = table.Column(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"); + } + } +} -- cgit v1.3