using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Moonlight.App.Database.Migrations { /// public partial class AddedStripeIntegration : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "SubscriptionDuration", table: "Users"); migrationBuilder.AddColumn( name: "SubscriptionExpires", table: "Users", type: "datetime(6)", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddColumn( name: "Currency", table: "Subscriptions", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "Duration", table: "Subscriptions", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "Price", table: "Subscriptions", type: "double", nullable: false, defaultValue: 0.0); migrationBuilder.AddColumn( name: "StripePriceId", table: "Subscriptions", type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "StripeProductId", table: "Subscriptions", type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "SubscriptionExpires", table: "Users"); migrationBuilder.DropColumn( name: "Currency", table: "Subscriptions"); migrationBuilder.DropColumn( name: "Duration", table: "Subscriptions"); migrationBuilder.DropColumn( name: "Price", table: "Subscriptions"); migrationBuilder.DropColumn( name: "StripePriceId", table: "Subscriptions"); migrationBuilder.DropColumn( name: "StripeProductId", table: "Subscriptions"); migrationBuilder.AddColumn( name: "SubscriptionDuration", table: "Users", type: "int", nullable: false, defaultValue: 0); } } }