diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240201203131_InitialMigration.Designer.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240201203131_InitialMigration.Designer.cs deleted file mode 100644 index ebaf704..0000000 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240201203131_InitialMigration.Designer.cs +++ /dev/null @@ -1,304 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using TeamUp.Infrastructure.Persistence; - -#nullable disable - -namespace TeamUp.Infrastructure.Persistence.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20240201203131_InitialMigration")] - partial class InitialMigration - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.1") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("EventTypeId") - .HasColumnType("uuid"); - - b.Property("From") - .HasColumnType("timestamp with time zone"); - - b.Property("MeetTime") - .HasColumnType("interval"); - - b.Property("ReplyClosingTimeBeforeMeetTime") - .HasColumnType("interval"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.Property("To") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("EventTypeId"); - - b.HasIndex("TeamId"); - - b.ToTable("Events"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.EventResponse", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("EventId") - .HasColumnType("uuid"); - - b.Property("TeamMemberId") - .HasColumnType("uuid"); - - b.Property("TimeStampUtc") - .HasColumnType("timestamp with time zone"); - - b.ComplexProperty>("Reply", "TeamUp.Domain.Aggregates.Events.EventResponse.Reply#EventReply", b1 => - { - b1.IsRequired(); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - }); - - b.HasKey("Id"); - - b.HasIndex("EventId"); - - b.HasIndex("TeamMemberId"); - - b.ToTable("EventResponse"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Invitations.Invitation", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("RecipientId") - .HasColumnType("uuid"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RecipientId"); - - b.HasIndex("TeamId"); - - b.ToTable("Invitations"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.EventType", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("TeamId"); - - b.ToTable("EventType"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.Team", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.HasKey("Id"); - - b.ToTable("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.TeamMember", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Nickname") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("TeamId"); - - b.HasIndex("UserId"); - - b.ToTable("TeamMembers"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Users.User", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("Status") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.EventType", null) - .WithMany() - .HasForeignKey("EventTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", null) - .WithMany() - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.EventResponse", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Events.Event", null) - .WithMany("EventResponses") - .HasForeignKey("EventId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.TeamMember", null) - .WithMany() - .HasForeignKey("TeamMemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Invitations.Invitation", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Users.User", null) - .WithMany() - .HasForeignKey("RecipientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", null) - .WithMany() - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.EventType", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", "Team") - .WithMany("EventTypes") - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.TeamMember", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", "Team") - .WithMany("Members") - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Users.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.Navigation("EventResponses"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.Team", b => - { - b.Navigation("EventTypes"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240208211254_Outbox.Designer.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240208211254_Outbox.Designer.cs deleted file mode 100644 index 87d993c..0000000 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240208211254_Outbox.Designer.cs +++ /dev/null @@ -1,332 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using TeamUp.Infrastructure.Persistence; - -#nullable disable - -namespace TeamUp.Infrastructure.Persistence.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20240208211254_Outbox")] - partial class Outbox - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.1") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("EventTypeId") - .HasColumnType("uuid"); - - b.Property("From") - .HasColumnType("timestamp with time zone"); - - b.Property("MeetTime") - .HasColumnType("interval"); - - b.Property("ReplyClosingTimeBeforeMeetTime") - .HasColumnType("interval"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.Property("To") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("EventTypeId"); - - b.HasIndex("TeamId"); - - b.ToTable("Events"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.EventResponse", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("EventId") - .HasColumnType("uuid"); - - b.Property("TeamMemberId") - .HasColumnType("uuid"); - - b.Property("TimeStampUtc") - .HasColumnType("timestamp with time zone"); - - b.ComplexProperty>("Reply", "TeamUp.Domain.Aggregates.Events.EventResponse.Reply#EventReply", b1 => - { - b1.IsRequired(); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - }); - - b.HasKey("Id"); - - b.HasIndex("EventId"); - - b.HasIndex("TeamMemberId"); - - b.ToTable("EventResponse"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Invitations.Invitation", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("RecipientId") - .HasColumnType("uuid"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RecipientId"); - - b.HasIndex("TeamId"); - - b.ToTable("Invitations"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.EventType", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("TeamId"); - - b.ToTable("EventType"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.Team", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.HasKey("Id"); - - b.ToTable("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.TeamMember", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Nickname") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("TeamId"); - - b.HasIndex("UserId"); - - b.ToTable("TeamMembers"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Users.User", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("Status") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("TeamUp.Infrastructure.Processing.Outbox.OutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .IsRequired() - .HasColumnType("text"); - - b.Property("Error") - .HasColumnType("text"); - - b.Property("ProcessedUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("OutboxMessages", (string)null); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.EventType", null) - .WithMany() - .HasForeignKey("EventTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", null) - .WithMany() - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.EventResponse", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Events.Event", null) - .WithMany("EventResponses") - .HasForeignKey("EventId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.TeamMember", null) - .WithMany() - .HasForeignKey("TeamMemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Invitations.Invitation", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Users.User", null) - .WithMany() - .HasForeignKey("RecipientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", null) - .WithMany() - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.EventType", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", "Team") - .WithMany("EventTypes") - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.TeamMember", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", "Team") - .WithMany("Members") - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Users.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.Navigation("EventResponses"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.Team", b => - { - b.Navigation("EventTypes"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240208211254_Outbox.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240208211254_Outbox.cs deleted file mode 100644 index d37412c..0000000 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240208211254_Outbox.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace TeamUp.Infrastructure.Persistence.Migrations -{ - /// - public partial class Outbox : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "OutboxMessages", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - CreatedUtc = table.Column(type: "timestamp with time zone", nullable: false), - Type = table.Column(type: "text", nullable: false), - Data = table.Column(type: "text", nullable: false), - ProcessedUtc = table.Column(type: "timestamp with time zone", nullable: true), - Error = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_OutboxMessages", x => x.Id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "OutboxMessages"); - } - } -} diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240210120343_TeamFix.Designer.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240210120343_TeamFix.Designer.cs deleted file mode 100644 index 6043b2b..0000000 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240210120343_TeamFix.Designer.cs +++ /dev/null @@ -1,332 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using TeamUp.Infrastructure.Persistence; - -#nullable disable - -namespace TeamUp.Infrastructure.Persistence.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20240210120343_TeamFix")] - partial class TeamFix - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.1") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("EventTypeId") - .HasColumnType("uuid"); - - b.Property("From") - .HasColumnType("timestamp with time zone"); - - b.Property("MeetTime") - .HasColumnType("interval"); - - b.Property("ReplyClosingTimeBeforeMeetTime") - .HasColumnType("interval"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.Property("To") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("EventTypeId"); - - b.HasIndex("TeamId"); - - b.ToTable("Events"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.EventResponse", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("EventId") - .HasColumnType("uuid"); - - b.Property("TeamMemberId") - .HasColumnType("uuid"); - - b.Property("TimeStampUtc") - .HasColumnType("timestamp with time zone"); - - b.ComplexProperty>("Reply", "TeamUp.Domain.Aggregates.Events.EventResponse.Reply#EventReply", b1 => - { - b1.IsRequired(); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - }); - - b.HasKey("Id"); - - b.HasIndex("EventId"); - - b.HasIndex("TeamMemberId"); - - b.ToTable("EventResponse"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Invitations.Invitation", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("RecipientId") - .HasColumnType("uuid"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RecipientId"); - - b.HasIndex("TeamId"); - - b.ToTable("Invitations"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.EventType", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("TeamId"); - - b.ToTable("EventType"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.Team", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.HasKey("Id"); - - b.ToTable("Teams"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.TeamMember", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Nickname") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("TeamId") - .HasColumnType("uuid"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("TeamId"); - - b.HasIndex("UserId"); - - b.ToTable("TeamMember"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Users.User", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("bytea"); - - b.Property("Status") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("TeamUp.Infrastructure.Processing.Outbox.OutboxMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .IsRequired() - .HasColumnType("text"); - - b.Property("Error") - .HasColumnType("text"); - - b.Property("ProcessedUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("OutboxMessages", (string)null); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.EventType", null) - .WithMany() - .HasForeignKey("EventTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", null) - .WithMany() - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.EventResponse", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Events.Event", null) - .WithMany("EventResponses") - .HasForeignKey("EventId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.TeamMember", null) - .WithMany() - .HasForeignKey("TeamMemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Invitations.Invitation", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Users.User", null) - .WithMany() - .HasForeignKey("RecipientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", null) - .WithMany() - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.EventType", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", "Team") - .WithMany("EventTypes") - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.TeamMember", b => - { - b.HasOne("TeamUp.Domain.Aggregates.Teams.Team", "Team") - .WithMany("Members") - .HasForeignKey("TeamId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TeamUp.Domain.Aggregates.Users.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Team"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Events.Event", b => - { - b.Navigation("EventResponses"); - }); - - modelBuilder.Entity("TeamUp.Domain.Aggregates.Teams.Team", b => - { - b.Navigation("EventTypes"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240210120343_TeamFix.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240210120343_TeamFix.cs deleted file mode 100644 index 1924865..0000000 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240210120343_TeamFix.cs +++ /dev/null @@ -1,234 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace TeamUp.Infrastructure.Persistence.Migrations -{ - /// - public partial class TeamFix : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_EventResponse_TeamMembers_TeamMemberId", - table: "EventResponse"); - - migrationBuilder.DropForeignKey( - name: "FK_Events_Team_TeamId", - table: "Events"); - - migrationBuilder.DropForeignKey( - name: "FK_EventType_Team_TeamId", - table: "EventType"); - - migrationBuilder.DropForeignKey( - name: "FK_Invitations_Team_TeamId", - table: "Invitations"); - - migrationBuilder.DropForeignKey( - name: "FK_TeamMembers_Team_TeamId", - table: "TeamMembers"); - - migrationBuilder.DropForeignKey( - name: "FK_TeamMembers_Users_UserId", - table: "TeamMembers"); - - migrationBuilder.DropPrimaryKey( - name: "PK_TeamMembers", - table: "TeamMembers"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Team", - table: "Team"); - - migrationBuilder.RenameTable( - name: "TeamMembers", - newName: "TeamMember"); - - migrationBuilder.RenameTable( - name: "Team", - newName: "Teams"); - - migrationBuilder.RenameIndex( - name: "IX_TeamMembers_UserId", - table: "TeamMember", - newName: "IX_TeamMember_UserId"); - - migrationBuilder.RenameIndex( - name: "IX_TeamMembers_TeamId", - table: "TeamMember", - newName: "IX_TeamMember_TeamId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_TeamMember", - table: "TeamMember", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Teams", - table: "Teams", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_EventResponse_TeamMember_TeamMemberId", - table: "EventResponse", - column: "TeamMemberId", - principalTable: "TeamMember", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Events_Teams_TeamId", - table: "Events", - column: "TeamId", - principalTable: "Teams", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_EventType_Teams_TeamId", - table: "EventType", - column: "TeamId", - principalTable: "Teams", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Invitations_Teams_TeamId", - table: "Invitations", - column: "TeamId", - principalTable: "Teams", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TeamMember_Teams_TeamId", - table: "TeamMember", - column: "TeamId", - principalTable: "Teams", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TeamMember_Users_UserId", - table: "TeamMember", - column: "UserId", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_EventResponse_TeamMember_TeamMemberId", - table: "EventResponse"); - - migrationBuilder.DropForeignKey( - name: "FK_Events_Teams_TeamId", - table: "Events"); - - migrationBuilder.DropForeignKey( - name: "FK_EventType_Teams_TeamId", - table: "EventType"); - - migrationBuilder.DropForeignKey( - name: "FK_Invitations_Teams_TeamId", - table: "Invitations"); - - migrationBuilder.DropForeignKey( - name: "FK_TeamMember_Teams_TeamId", - table: "TeamMember"); - - migrationBuilder.DropForeignKey( - name: "FK_TeamMember_Users_UserId", - table: "TeamMember"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Teams", - table: "Teams"); - - migrationBuilder.DropPrimaryKey( - name: "PK_TeamMember", - table: "TeamMember"); - - migrationBuilder.RenameTable( - name: "Teams", - newName: "Team"); - - migrationBuilder.RenameTable( - name: "TeamMember", - newName: "TeamMembers"); - - migrationBuilder.RenameIndex( - name: "IX_TeamMember_UserId", - table: "TeamMembers", - newName: "IX_TeamMembers_UserId"); - - migrationBuilder.RenameIndex( - name: "IX_TeamMember_TeamId", - table: "TeamMembers", - newName: "IX_TeamMembers_TeamId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Team", - table: "Team", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_TeamMembers", - table: "TeamMembers", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_EventResponse_TeamMembers_TeamMemberId", - table: "EventResponse", - column: "TeamMemberId", - principalTable: "TeamMembers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Events_Team_TeamId", - table: "Events", - column: "TeamId", - principalTable: "Team", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_EventType_Team_TeamId", - table: "EventType", - column: "TeamId", - principalTable: "Team", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Invitations_Team_TeamId", - table: "Invitations", - column: "TeamId", - principalTable: "Team", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TeamMembers_Team_TeamId", - table: "TeamMembers", - column: "TeamId", - principalTable: "Team", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TeamMembers_Users_UserId", - table: "TeamMembers", - column: "UserId", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240221164444_InvitationTimeStampFix.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240221164444_InvitationTimeStampFix.cs deleted file mode 100644 index 22440dc..0000000 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240221164444_InvitationTimeStampFix.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace TeamUp.Infrastructure.Persistence.Migrations -{ - /// - public partial class InvitationTimeStampFix : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CreatedUtc", - table: "Invitations", - type: "timestamp with time zone", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CreatedUtc", - table: "Invitations"); - } - } -} diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240221164444_InvitationTimeStampFix.Designer.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240223144926_InitialMigration.Designer.cs similarity index 99% rename from src/TeamUp.Infrastructure/Persistence/Migrations/20240221164444_InvitationTimeStampFix.Designer.cs rename to src/TeamUp.Infrastructure/Persistence/Migrations/20240223144926_InitialMigration.Designer.cs index 7d8569a..393075b 100644 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240221164444_InvitationTimeStampFix.Designer.cs +++ b/src/TeamUp.Infrastructure/Persistence/Migrations/20240223144926_InitialMigration.Designer.cs @@ -13,8 +13,8 @@ namespace TeamUp.Infrastructure.Persistence.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20240221164444_InvitationTimeStampFix")] - partial class InvitationTimeStampFix + [Migration("20240223144926_InitialMigration")] + partial class InitialMigration { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/src/TeamUp.Infrastructure/Persistence/Migrations/20240201203131_InitialMigration.cs b/src/TeamUp.Infrastructure/Persistence/Migrations/20240223144926_InitialMigration.cs similarity index 81% rename from src/TeamUp.Infrastructure/Persistence/Migrations/20240201203131_InitialMigration.cs rename to src/TeamUp.Infrastructure/Persistence/Migrations/20240223144926_InitialMigration.cs index 25dd286..82e90cf 100644 --- a/src/TeamUp.Infrastructure/Persistence/Migrations/20240201203131_InitialMigration.cs +++ b/src/TeamUp.Infrastructure/Persistence/Migrations/20240223144926_InitialMigration.cs @@ -12,7 +12,23 @@ public partial class InitialMigration : Migration protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "Team", + name: "OutboxMessages", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + CreatedUtc = table.Column(type: "timestamp with time zone", nullable: false), + Type = table.Column(type: "text", nullable: false), + Data = table.Column(type: "text", nullable: false), + ProcessedUtc = table.Column(type: "timestamp with time zone", nullable: true), + Error = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OutboxMessages", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Teams", columns: table => new { Id = table.Column(type: "uuid", nullable: false), @@ -20,7 +36,7 @@ protected override void Up(MigrationBuilder migrationBuilder) }, constraints: table => { - table.PrimaryKey("PK_Team", x => x.Id); + table.PrimaryKey("PK_Teams", x => x.Id); }); migrationBuilder.CreateTable( @@ -51,9 +67,9 @@ protected override void Up(MigrationBuilder migrationBuilder) { table.PrimaryKey("PK_EventType", x => x.Id); table.ForeignKey( - name: "FK_EventType_Team_TeamId", + name: "FK_EventType_Teams_TeamId", column: x => x.TeamId, - principalTable: "Team", + principalTable: "Teams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); @@ -64,15 +80,16 @@ protected override void Up(MigrationBuilder migrationBuilder) { Id = table.Column(type: "uuid", nullable: false), RecipientId = table.Column(type: "uuid", nullable: false), - TeamId = table.Column(type: "uuid", nullable: false) + TeamId = table.Column(type: "uuid", nullable: false), + CreatedUtc = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Invitations", x => x.Id); table.ForeignKey( - name: "FK_Invitations_Team_TeamId", + name: "FK_Invitations_Teams_TeamId", column: x => x.TeamId, - principalTable: "Team", + principalTable: "Teams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( @@ -84,7 +101,7 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "TeamMembers", + name: "TeamMember", columns: table => new { Id = table.Column(type: "uuid", nullable: false), @@ -95,15 +112,15 @@ protected override void Up(MigrationBuilder migrationBuilder) }, constraints: table => { - table.PrimaryKey("PK_TeamMembers", x => x.Id); + table.PrimaryKey("PK_TeamMember", x => x.Id); table.ForeignKey( - name: "FK_TeamMembers_Team_TeamId", + name: "FK_TeamMember_Teams_TeamId", column: x => x.TeamId, - principalTable: "Team", + principalTable: "Teams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_TeamMembers_Users_UserId", + name: "FK_TeamMember_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", @@ -134,9 +151,9 @@ protected override void Up(MigrationBuilder migrationBuilder) principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_Events_Team_TeamId", + name: "FK_Events_Teams_TeamId", column: x => x.TeamId, - principalTable: "Team", + principalTable: "Teams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); @@ -161,9 +178,9 @@ protected override void Up(MigrationBuilder migrationBuilder) principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_EventResponse_TeamMembers_TeamMemberId", + name: "FK_EventResponse_TeamMember_TeamMemberId", column: x => x.TeamMemberId, - principalTable: "TeamMembers", + principalTable: "TeamMember", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); @@ -204,13 +221,13 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "TeamId"); migrationBuilder.CreateIndex( - name: "IX_TeamMembers_TeamId", - table: "TeamMembers", + name: "IX_TeamMember_TeamId", + table: "TeamMember", column: "TeamId"); migrationBuilder.CreateIndex( - name: "IX_TeamMembers_UserId", - table: "TeamMembers", + name: "IX_TeamMember_UserId", + table: "TeamMember", column: "UserId"); migrationBuilder.CreateIndex( @@ -229,11 +246,14 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "Invitations"); + migrationBuilder.DropTable( + name: "OutboxMessages"); + migrationBuilder.DropTable( name: "Events"); migrationBuilder.DropTable( - name: "TeamMembers"); + name: "TeamMember"); migrationBuilder.DropTable( name: "EventType"); @@ -242,7 +262,7 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "Users"); migrationBuilder.DropTable( - name: "Team"); + name: "Teams"); } } }