diff --git a/util/MySqlMigrations/Migrations/20260203083629_AddSubscriptionDiscountTable.cs b/util/MySqlMigrations/Migrations/20260203083629_AddSubscriptionDiscountTable.cs index 6c121944e1..d5642b4c6e 100644 --- a/util/MySqlMigrations/Migrations/20260203083629_AddSubscriptionDiscountTable.cs +++ b/util/MySqlMigrations/Migrations/20260203083629_AddSubscriptionDiscountTable.cs @@ -1,63 +1,61 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace Bit.MySqlMigrations.Migrations +namespace Bit.MySqlMigrations.Migrations; + +/// +public partial class AddSubscriptionDiscountTable : Migration { /// - public partial class AddSubscriptionDiscountTable : Migration + protected override void Up(MigrationBuilder migrationBuilder) { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "SubscriptionDiscount", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - StripeCouponId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - StripeProductIds = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - PercentOff = table.Column(type: "decimal(65,30)", nullable: true), - AmountOff = table.Column(type: "bigint", nullable: true), - Currency = table.Column(type: "varchar(10)", maxLength: 10, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Duration = table.Column(type: "varchar(20)", maxLength: 20, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DurationInMonths = table.Column(type: "int", nullable: true), - Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - StartDate = table.Column(type: "datetime(6)", nullable: false), - EndDate = table.Column(type: "datetime(6)", nullable: false), - AudienceType = table.Column(type: "int", nullable: false), - CreationDate = table.Column(type: "datetime(6)", nullable: false), - RevisionDate = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_SubscriptionDiscount", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "SubscriptionDiscount", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + StripeCouponId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + StripeProductIds = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PercentOff = table.Column(type: "decimal(65,30)", nullable: true), + AmountOff = table.Column(type: "bigint", nullable: true), + Currency = table.Column(type: "varchar(10)", maxLength: 10, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Duration = table.Column(type: "varchar(20)", maxLength: 20, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DurationInMonths = table.Column(type: "int", nullable: true), + Name = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + StartDate = table.Column(type: "datetime(6)", nullable: false), + EndDate = table.Column(type: "datetime(6)", nullable: false), + AudienceType = table.Column(type: "int", nullable: false), + CreationDate = table.Column(type: "datetime(6)", nullable: false), + RevisionDate = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SubscriptionDiscount", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateIndex( - name: "IX_SubscriptionDiscount_DateRange", - table: "SubscriptionDiscount", - columns: new[] { "StartDate", "EndDate" }); + migrationBuilder.CreateIndex( + name: "IX_SubscriptionDiscount_DateRange", + table: "SubscriptionDiscount", + columns: new[] { "StartDate", "EndDate" }); - migrationBuilder.CreateIndex( - name: "IX_SubscriptionDiscount_StripeCouponId", - table: "SubscriptionDiscount", - column: "StripeCouponId", - unique: true); - } + migrationBuilder.CreateIndex( + name: "IX_SubscriptionDiscount_StripeCouponId", + table: "SubscriptionDiscount", + column: "StripeCouponId", + unique: true); + } - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "SubscriptionDiscount"); - } + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "SubscriptionDiscount"); } } diff --git a/util/PostgresMigrations/Migrations/20260203083641_AddSubscriptionDiscountTable.cs b/util/PostgresMigrations/Migrations/20260203083641_AddSubscriptionDiscountTable.cs index 59cc84dc56..033ef1a305 100644 --- a/util/PostgresMigrations/Migrations/20260203083641_AddSubscriptionDiscountTable.cs +++ b/util/PostgresMigrations/Migrations/20260203083641_AddSubscriptionDiscountTable.cs @@ -1,57 +1,55 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace Bit.PostgresMigrations.Migrations +namespace Bit.PostgresMigrations.Migrations; + +/// +public partial class AddSubscriptionDiscountTable : Migration { /// - public partial class AddSubscriptionDiscountTable : Migration + protected override void Up(MigrationBuilder migrationBuilder) { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "SubscriptionDiscount", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - StripeCouponId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - StripeProductIds = table.Column(type: "text", nullable: true), - PercentOff = table.Column(type: "numeric", nullable: true), - AmountOff = table.Column(type: "bigint", nullable: true), - Currency = table.Column(type: "character varying(10)", maxLength: 10, nullable: true), - Duration = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), - DurationInMonths = table.Column(type: "integer", nullable: true), - Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), - StartDate = table.Column(type: "timestamp with time zone", nullable: false), - EndDate = table.Column(type: "timestamp with time zone", nullable: false), - AudienceType = table.Column(type: "integer", nullable: false), - CreationDate = table.Column(type: "timestamp with time zone", nullable: false), - RevisionDate = table.Column(type: "timestamp with time zone", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_SubscriptionDiscount", x => x.Id); - }); + migrationBuilder.CreateTable( + name: "SubscriptionDiscount", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + StripeCouponId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + StripeProductIds = table.Column(type: "text", nullable: true), + PercentOff = table.Column(type: "numeric", nullable: true), + AmountOff = table.Column(type: "bigint", nullable: true), + Currency = table.Column(type: "character varying(10)", maxLength: 10, nullable: true), + Duration = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + DurationInMonths = table.Column(type: "integer", nullable: true), + Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + StartDate = table.Column(type: "timestamp with time zone", nullable: false), + EndDate = table.Column(type: "timestamp with time zone", nullable: false), + AudienceType = table.Column(type: "integer", nullable: false), + CreationDate = table.Column(type: "timestamp with time zone", nullable: false), + RevisionDate = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SubscriptionDiscount", x => x.Id); + }); - migrationBuilder.CreateIndex( - name: "IX_SubscriptionDiscount_DateRange", - table: "SubscriptionDiscount", - columns: new[] { "StartDate", "EndDate" }); + migrationBuilder.CreateIndex( + name: "IX_SubscriptionDiscount_DateRange", + table: "SubscriptionDiscount", + columns: new[] { "StartDate", "EndDate" }); - migrationBuilder.CreateIndex( - name: "IX_SubscriptionDiscount_StripeCouponId", - table: "SubscriptionDiscount", - column: "StripeCouponId", - unique: true); - } + migrationBuilder.CreateIndex( + name: "IX_SubscriptionDiscount_StripeCouponId", + table: "SubscriptionDiscount", + column: "StripeCouponId", + unique: true); + } - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "SubscriptionDiscount"); - } + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "SubscriptionDiscount"); } } diff --git a/util/SqliteMigrations/Migrations/20260203083654_AddSubscriptionDiscountTable.cs b/util/SqliteMigrations/Migrations/20260203083654_AddSubscriptionDiscountTable.cs index ab6ac5e79a..847f839a2d 100644 --- a/util/SqliteMigrations/Migrations/20260203083654_AddSubscriptionDiscountTable.cs +++ b/util/SqliteMigrations/Migrations/20260203083654_AddSubscriptionDiscountTable.cs @@ -1,57 +1,55 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace Bit.SqliteMigrations.Migrations +namespace Bit.SqliteMigrations.Migrations; + +/// +public partial class AddSubscriptionDiscountTable : Migration { /// - public partial class AddSubscriptionDiscountTable : Migration + protected override void Up(MigrationBuilder migrationBuilder) { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "SubscriptionDiscount", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - StripeCouponId = table.Column(type: "TEXT", maxLength: 50, nullable: false), - StripeProductIds = table.Column(type: "TEXT", nullable: true), - PercentOff = table.Column(type: "TEXT", nullable: true), - AmountOff = table.Column(type: "INTEGER", nullable: true), - Currency = table.Column(type: "TEXT", maxLength: 10, nullable: true), - Duration = table.Column(type: "TEXT", maxLength: 20, nullable: false), - DurationInMonths = table.Column(type: "INTEGER", nullable: true), - Name = table.Column(type: "TEXT", maxLength: 100, nullable: true), - StartDate = table.Column(type: "TEXT", nullable: false), - EndDate = table.Column(type: "TEXT", nullable: false), - AudienceType = table.Column(type: "INTEGER", nullable: false), - CreationDate = table.Column(type: "TEXT", nullable: false), - RevisionDate = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_SubscriptionDiscount", x => x.Id); - }); + migrationBuilder.CreateTable( + name: "SubscriptionDiscount", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + StripeCouponId = table.Column(type: "TEXT", maxLength: 50, nullable: false), + StripeProductIds = table.Column(type: "TEXT", nullable: true), + PercentOff = table.Column(type: "TEXT", nullable: true), + AmountOff = table.Column(type: "INTEGER", nullable: true), + Currency = table.Column(type: "TEXT", maxLength: 10, nullable: true), + Duration = table.Column(type: "TEXT", maxLength: 20, nullable: false), + DurationInMonths = table.Column(type: "INTEGER", nullable: true), + Name = table.Column(type: "TEXT", maxLength: 100, nullable: true), + StartDate = table.Column(type: "TEXT", nullable: false), + EndDate = table.Column(type: "TEXT", nullable: false), + AudienceType = table.Column(type: "INTEGER", nullable: false), + CreationDate = table.Column(type: "TEXT", nullable: false), + RevisionDate = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SubscriptionDiscount", x => x.Id); + }); - migrationBuilder.CreateIndex( - name: "IX_SubscriptionDiscount_DateRange", - table: "SubscriptionDiscount", - columns: new[] { "StartDate", "EndDate" }); + migrationBuilder.CreateIndex( + name: "IX_SubscriptionDiscount_DateRange", + table: "SubscriptionDiscount", + columns: new[] { "StartDate", "EndDate" }); - migrationBuilder.CreateIndex( - name: "IX_SubscriptionDiscount_StripeCouponId", - table: "SubscriptionDiscount", - column: "StripeCouponId", - unique: true); - } + migrationBuilder.CreateIndex( + name: "IX_SubscriptionDiscount_StripeCouponId", + table: "SubscriptionDiscount", + column: "StripeCouponId", + unique: true); + } - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "SubscriptionDiscount"); - } + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "SubscriptionDiscount"); } }