diff --git a/backend/Modules/Tipping/Migrations/20250731175148_TippingIssues.Designer.cs b/backend/Modules/Tipping/Migrations/20250731175148_TippingIssues.Designer.cs new file mode 100644 index 0000000..b9b3cf3 --- /dev/null +++ b/backend/Modules/Tipping/Migrations/20250731175148_TippingIssues.Designer.cs @@ -0,0 +1,84 @@ +// +using System; +using Hutopy.Modules.Tipping.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Hutopy.Modules.Tipping.Migrations +{ + [DbContext(typeof(TippingDbContext))] + [Migration("20250731175148_TippingIssues")] + partial class TippingIssues + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Tipping") + .HasAnnotation("ProductVersion", "9.0.6") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Hutopy.Modules.Tipping.Data.Tip", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Amount") + .HasColumnType("numeric"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("CreatedBy") + .HasColumnType("uuid"); + + b.Property("CreatorId") + .HasColumnType("uuid"); + + b.Property("Currency") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedBy") + .HasColumnType("uuid"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Status") + .HasColumnType("smallint"); + + b.Property("StripeInvoiceUrl") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("StripeSessionId") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.ToTable("Tips", "Tipping"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/backend/Modules/Tipping/Migrations/20250731175148_TippingIssues.cs b/backend/Modules/Tipping/Migrations/20250731175148_TippingIssues.cs new file mode 100644 index 0000000..1b2222b --- /dev/null +++ b/backend/Modules/Tipping/Migrations/20250731175148_TippingIssues.cs @@ -0,0 +1,100 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Hutopy.Modules.Tipping.Migrations +{ + /// + public partial class TippingIssues : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "StripeSessionId", + schema: "Tipping", + table: "Tips", + type: "character varying(256)", + maxLength: 256, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "StripeInvoiceUrl", + schema: "Tipping", + table: "Tips", + type: "character varying(2048)", + maxLength: 2048, + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Message", + schema: "Tipping", + table: "Tips", + type: "character varying(2048)", + maxLength: 2048, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "Currency", + schema: "Tipping", + table: "Tips", + type: "character varying(8)", + maxLength: 8, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "StripeSessionId", + schema: "Tipping", + table: "Tips", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(256)", + oldMaxLength: 256); + + migrationBuilder.AlterColumn( + name: "StripeInvoiceUrl", + schema: "Tipping", + table: "Tips", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "character varying(2048)", + oldMaxLength: 2048, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Message", + schema: "Tipping", + table: "Tips", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(2048)", + oldMaxLength: 2048); + + migrationBuilder.AlterColumn( + name: "Currency", + schema: "Tipping", + table: "Tips", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(8)", + oldMaxLength: 8); + } + } +} diff --git a/backend/Modules/Tipping/Migrations/TippingDbContextModelSnapshot.cs b/backend/Modules/Tipping/Migrations/TippingDbContextModelSnapshot.cs index cd10df1..a847e01 100644 --- a/backend/Modules/Tipping/Migrations/TippingDbContextModelSnapshot.cs +++ b/backend/Modules/Tipping/Migrations/TippingDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ namespace Hutopy.Modules.Tipping.Migrations #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("Tipping") - .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("ProductVersion", "9.0.6") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -45,7 +45,8 @@ namespace Hutopy.Modules.Tipping.Migrations b.Property("Currency") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(8) + .HasColumnType("character varying(8)"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); @@ -55,17 +56,20 @@ namespace Hutopy.Modules.Tipping.Migrations b.Property("Message") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); b.Property("Status") .HasColumnType("smallint"); b.Property("StripeInvoiceUrl") - .HasColumnType("text"); + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); b.Property("StripeSessionId") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.HasKey("Id");