summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/Data/Database/BaseWithOwner.cs16
-rw-r--r--server/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs656
-rw-r--r--server/src/Migrations/20220602214238_NullableOptionalBaseFields.cs649
-rw-r--r--server/src/Migrations/AppDbContextModelSnapshot.cs62
4 files changed, 1329 insertions, 54 deletions
diff --git a/server/src/Data/Database/BaseWithOwner.cs b/server/src/Data/Database/BaseWithOwner.cs
index eb4438d..bc60b48 100644
--- a/server/src/Data/Database/BaseWithOwner.cs
+++ b/server/src/Data/Database/BaseWithOwner.cs
@@ -11,14 +11,14 @@ public class BaseWithOwner : Base
UserId = userId;
}
- public Guid UserId { get; init; }
+ public Guid UserId { get; set; }
public User User { get; init; }
- public Guid TenantId { get; set; }
+ public Guid? TenantId { get; init; }
public Tenant Tenant { get; init; }
- public Guid ModifiedById { get; init; }
- public User ModifiedBy { get; set; }
- public Guid CreatedById { get; init; }
- public User CreatedBy { get; set; }
- public Guid DeletedById { get; init; }
- public User DeletedBy { get; set; }
+ public Guid? ModifiedById { get; init; }
+ public User ModifiedBy { get; init; }
+ public Guid? CreatedById { get; init; }
+ public User CreatedBy { get; init; }
+ public Guid? DeletedById { get; init; }
+ public User DeletedBy { get; init; }
}
diff --git a/server/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs b/server/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs
new file mode 100644
index 0000000..a05b0e4
--- /dev/null
+++ b/server/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs
@@ -0,0 +1,656 @@
+// <auto-generated />
+using System;
+using IOL.GreatOffice.Api.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 IOL.GreatOffice.Api.Migrations
+{
+ [DbContext(typeof(AppDbContext))]
+ [Migration("20220602214238_NullableOptionalBaseFields")]
+ partial class NullableOptionalBaseFields
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "6.0.5")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.ApiAccessToken", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property<bool>("AllowCreate")
+ .HasColumnType("boolean")
+ .HasColumnName("allow_create");
+
+ b.Property<bool>("AllowDelete")
+ .HasColumnType("boolean")
+ .HasColumnName("allow_delete");
+
+ b.Property<bool>("AllowRead")
+ .HasColumnType("boolean")
+ .HasColumnName("allow_read");
+
+ b.Property<bool>("AllowUpdate")
+ .HasColumnType("boolean")
+ .HasColumnName("allow_update");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property<DateTime>("ExpiryDate")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expiry_date");
+
+ b.Property<DateTime?>("ModifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("modified_at");
+
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_api_access_tokens");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_api_access_tokens_user_id");
+
+ b.ToTable("api_access_tokens", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.ForgotPasswordRequest", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_forgot_password_requests");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_forgot_password_requests_user_id");
+
+ b.ToTable("forgot_password_requests", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.GithubUserMapping", b =>
+ {
+ b.Property<string>("GithubId")
+ .HasColumnType("text")
+ .HasColumnName("github_id");
+
+ b.Property<string>("Email")
+ .HasColumnType("text")
+ .HasColumnName("email");
+
+ b.Property<string>("RefreshToken")
+ .HasColumnType("text")
+ .HasColumnName("refresh_token");
+
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("GithubId")
+ .HasName("pk_github_user_mappings");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_github_user_mappings_user_id");
+
+ b.ToTable("github_user_mappings", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.Tenant", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property<string>("ContactEmail")
+ .HasColumnType("text")
+ .HasColumnName("contact_email");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property<Guid?>("CreatedById")
+ .HasColumnType("uuid")
+ .HasColumnName("created_by_id");
+
+ b.Property<Guid?>("DeletedById")
+ .HasColumnType("uuid")
+ .HasColumnName("deleted_by_id");
+
+ b.Property<string>("Description")
+ .HasColumnType("text")
+ .HasColumnName("description");
+
+ b.Property<Guid>("MasterUserId")
+ .HasColumnType("uuid")
+ .HasColumnName("master_user_id");
+
+ b.Property<string>("MasterUserPassword")
+ .HasColumnType("text")
+ .HasColumnName("master_user_password");
+
+ b.Property<DateTime?>("ModifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("modified_at");
+
+ b.Property<Guid?>("ModifiedById")
+ .HasColumnType("uuid")
+ .HasColumnName("modified_by_id");
+
+ b.Property<string>("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.Property<Guid?>("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("tenant_id");
+
+ b.Property<Guid?>("TenantId1")
+ .HasColumnType("uuid")
+ .HasColumnName("tenant_id1");
+
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_tenants");
+
+ b.HasIndex("CreatedById")
+ .HasDatabaseName("ix_tenants_created_by_id");
+
+ b.HasIndex("DeletedById")
+ .HasDatabaseName("ix_tenants_deleted_by_id");
+
+ b.HasIndex("ModifiedById")
+ .HasDatabaseName("ix_tenants_modified_by_id");
+
+ b.HasIndex("TenantId1")
+ .HasDatabaseName("ix_tenants_tenant_id1");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_tenants_user_id");
+
+ b.ToTable("tenants", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.TimeCategory", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property<string>("Color")
+ .HasColumnType("text")
+ .HasColumnName("color");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property<Guid?>("CreatedById")
+ .HasColumnType("uuid")
+ .HasColumnName("created_by_id");
+
+ b.Property<Guid?>("DeletedById")
+ .HasColumnType("uuid")
+ .HasColumnName("deleted_by_id");
+
+ b.Property<DateTime?>("ModifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("modified_at");
+
+ b.Property<Guid?>("ModifiedById")
+ .HasColumnType("uuid")
+ .HasColumnName("modified_by_id");
+
+ b.Property<string>("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.Property<Guid?>("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("tenant_id");
+
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_time_categories");
+
+ b.HasIndex("CreatedById")
+ .HasDatabaseName("ix_time_categories_created_by_id");
+
+ b.HasIndex("DeletedById")
+ .HasDatabaseName("ix_time_categories_deleted_by_id");
+
+ b.HasIndex("ModifiedById")
+ .HasDatabaseName("ix_time_categories_modified_by_id");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("ix_time_categories_tenant_id");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_time_categories_user_id");
+
+ b.ToTable("time_categories", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.TimeEntry", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property<Guid?>("CategoryId")
+ .HasColumnType("uuid")
+ .HasColumnName("category_id");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property<Guid?>("CreatedById")
+ .HasColumnType("uuid")
+ .HasColumnName("created_by_id");
+
+ b.Property<Guid?>("DeletedById")
+ .HasColumnType("uuid")
+ .HasColumnName("deleted_by_id");
+
+ b.Property<string>("Description")
+ .HasColumnType("text")
+ .HasColumnName("description");
+
+ b.Property<DateTime?>("ModifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("modified_at");
+
+ b.Property<Guid?>("ModifiedById")
+ .HasColumnType("uuid")
+ .HasColumnName("modified_by_id");
+
+ b.Property<DateTime>("Start")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("start");
+
+ b.Property<DateTime>("Stop")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("stop");
+
+ b.Property<Guid?>("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("tenant_id");
+
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_time_entries");
+
+ b.HasIndex("CategoryId")
+ .HasDatabaseName("ix_time_entries_category_id");
+
+ b.HasIndex("CreatedById")
+ .HasDatabaseName("ix_time_entries_created_by_id");
+
+ b.HasIndex("DeletedById")
+ .HasDatabaseName("ix_time_entries_deleted_by_id");
+
+ b.HasIndex("ModifiedById")
+ .HasDatabaseName("ix_time_entries_modified_by_id");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("ix_time_entries_tenant_id");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_time_entries_user_id");
+
+ b.ToTable("time_entries", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.TimeLabel", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property<string>("Color")
+ .HasColumnType("text")
+ .HasColumnName("color");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property<Guid?>("CreatedById")
+ .HasColumnType("uuid")
+ .HasColumnName("created_by_id");
+
+ b.Property<Guid?>("DeletedById")
+ .HasColumnType("uuid")
+ .HasColumnName("deleted_by_id");
+
+ b.Property<DateTime?>("ModifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("modified_at");
+
+ b.Property<Guid?>("ModifiedById")
+ .HasColumnType("uuid")
+ .HasColumnName("modified_by_id");
+
+ b.Property<string>("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.Property<Guid?>("TenantId")
+ .HasColumnType("uuid")
+ .HasColumnName("tenant_id");
+
+ b.Property<Guid?>("TimeEntryId")
+ .HasColumnType("uuid")
+ .HasColumnName("time_entry_id");
+
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_time_labels");
+
+ b.HasIndex("CreatedById")
+ .HasDatabaseName("ix_time_labels_created_by_id");
+
+ b.HasIndex("DeletedById")
+ .HasDatabaseName("ix_time_labels_deleted_by_id");
+
+ b.HasIndex("ModifiedById")
+ .HasDatabaseName("ix_time_labels_modified_by_id");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("ix_time_labels_tenant_id");
+
+ b.HasIndex("TimeEntryId")
+ .HasDatabaseName("ix_time_labels_time_entry_id");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_time_labels_user_id");
+
+ b.ToTable("time_labels", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.User", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property<DateTime?>("ModifiedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("modified_at");
+
+ b.Property<string>("Password")
+ .HasColumnType("text")
+ .HasColumnName("password");
+
+ b.Property<string>("Username")
+ .HasColumnType("text")
+ .HasColumnName("username");
+
+ b.HasKey("Id")
+ .HasName("pk_users");
+
+ b.ToTable("users", (string)null);
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.ApiAccessToken", b =>
+ {
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .HasConstraintName("fk_api_access_tokens_users_user_id");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.ForgotPasswordRequest", b =>
+ {
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_forgot_password_requests_users_user_id");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.GithubUserMapping", b =>
+ {
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .HasConstraintName("fk_github_user_mappings_users_user_id");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.Tenant", b =>
+ {
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
+ .WithMany()
+ .HasForeignKey("CreatedById")
+ .HasConstraintName("fk_tenants_users_created_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
+ .WithMany()
+ .HasForeignKey("DeletedById")
+ .HasConstraintName("fk_tenants_users_deleted_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
+ .WithMany()
+ .HasForeignKey("ModifiedById")
+ .HasConstraintName("fk_tenants_users_modified_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
+ .WithMany()
+ .HasForeignKey("TenantId1")
+ .HasConstraintName("fk_tenants_tenants_tenant_id1");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_tenants_users_user_id");
+
+ b.Navigation("CreatedBy");
+
+ b.Navigation("DeletedBy");
+
+ b.Navigation("ModifiedBy");
+
+ b.Navigation("Tenant");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.TimeCategory", b =>
+ {
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
+ .WithMany()
+ .HasForeignKey("CreatedById")
+ .HasConstraintName("fk_time_categories_users_created_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
+ .WithMany()
+ .HasForeignKey("DeletedById")
+ .HasConstraintName("fk_time_categories_users_deleted_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
+ .WithMany()
+ .HasForeignKey("ModifiedById")
+ .HasConstraintName("fk_time_categories_users_modified_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
+ .WithMany()
+ .HasForeignKey("TenantId")
+ .HasConstraintName("fk_time_categories_tenants_tenant_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_time_categories_users_user_id");
+
+ b.Navigation("CreatedBy");
+
+ b.Navigation("DeletedBy");
+
+ b.Navigation("ModifiedBy");
+
+ b.Navigation("Tenant");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.TimeEntry", b =>
+ {
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.TimeCategory", "Category")
+ .WithMany()
+ .HasForeignKey("CategoryId")
+ .HasConstraintName("fk_time_entries_time_categories_category_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
+ .WithMany()
+ .HasForeignKey("CreatedById")
+ .HasConstraintName("fk_time_entries_users_created_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
+ .WithMany()
+ .HasForeignKey("DeletedById")
+ .HasConstraintName("fk_time_entries_users_deleted_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
+ .WithMany()
+ .HasForeignKey("ModifiedById")
+ .HasConstraintName("fk_time_entries_users_modified_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
+ .WithMany()
+ .HasForeignKey("TenantId")
+ .HasConstraintName("fk_time_entries_tenants_tenant_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_time_entries_users_user_id");
+
+ b.Navigation("Category");
+
+ b.Navigation("CreatedBy");
+
+ b.Navigation("DeletedBy");
+
+ b.Navigation("ModifiedBy");
+
+ b.Navigation("Tenant");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.TimeLabel", b =>
+ {
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
+ .WithMany()
+ .HasForeignKey("CreatedById")
+ .HasConstraintName("fk_time_labels_users_created_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
+ .WithMany()
+ .HasForeignKey("DeletedById")
+ .HasConstraintName("fk_time_labels_users_deleted_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
+ .WithMany()
+ .HasForeignKey("ModifiedById")
+ .HasConstraintName("fk_time_labels_users_modified_by_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
+ .WithMany()
+ .HasForeignKey("TenantId")
+ .HasConstraintName("fk_time_labels_tenants_tenant_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.TimeEntry", null)
+ .WithMany("Labels")
+ .HasForeignKey("TimeEntryId")
+ .HasConstraintName("fk_time_labels_time_entries_time_entry_id");
+
+ b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_time_labels_users_user_id");
+
+ b.Navigation("CreatedBy");
+
+ b.Navigation("DeletedBy");
+
+ b.Navigation("ModifiedBy");
+
+ b.Navigation("Tenant");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IOL.GreatOffice.Api.Data.Database.TimeEntry", b =>
+ {
+ b.Navigation("Labels");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/server/src/Migrations/20220602214238_NullableOptionalBaseFields.cs b/server/src/Migrations/20220602214238_NullableOptionalBaseFields.cs
new file mode 100644
index 0000000..eebab5c
--- /dev/null
+++ b/server/src/Migrations/20220602214238_NullableOptionalBaseFields.cs
@@ -0,0 +1,649 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace IOL.GreatOffice.Api.Migrations
+{
+ public partial class NullableOptionalBaseFields : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "fk_tenants_users_created_by_id",
+ table: "tenants");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_tenants_users_deleted_by_id",
+ table: "tenants");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_tenants_users_modified_by_id",
+ table: "tenants");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_tenants_tenant_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_users_created_by_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_users_deleted_by_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_users_modified_by_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_tenants_tenant_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_users_created_by_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_users_deleted_by_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_users_modified_by_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_tenants_tenant_id",
+ table: "time_labels");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_users_created_by_id",
+ table: "time_labels");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_users_deleted_by_id",
+ table: "time_labels");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_users_modified_by_id",
+ table: "time_labels");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_tenants_users_created_by_id",
+ table: "tenants",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_tenants_users_deleted_by_id",
+ table: "tenants",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_tenants_users_modified_by_id",
+ table: "tenants",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_tenants_tenant_id",
+ table: "time_categories",
+ column: "tenant_id",
+ principalTable: "tenants",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_users_created_by_id",
+ table: "time_categories",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_users_deleted_by_id",
+ table: "time_categories",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_users_modified_by_id",
+ table: "time_categories",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_tenants_tenant_id",
+ table: "time_entries",
+ column: "tenant_id",
+ principalTable: "tenants",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_users_created_by_id",
+ table: "time_entries",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_users_deleted_by_id",
+ table: "time_entries",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_users_modified_by_id",
+ table: "time_entries",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_tenants_tenant_id",
+ table: "time_labels",
+ column: "tenant_id",
+ principalTable: "tenants",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_users_created_by_id",
+ table: "time_labels",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_users_deleted_by_id",
+ table: "time_labels",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_users_modified_by_id",
+ table: "time_labels",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "fk_tenants_users_created_by_id",
+ table: "tenants");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_tenants_users_deleted_by_id",
+ table: "tenants");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_tenants_users_modified_by_id",
+ table: "tenants");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_tenants_tenant_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_users_created_by_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_users_deleted_by_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_users_modified_by_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_tenants_tenant_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_users_created_by_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_users_deleted_by_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_users_modified_by_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_tenants_tenant_id",
+ table: "time_labels");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_users_created_by_id",
+ table: "time_labels");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_users_deleted_by_id",
+ table: "time_labels");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_users_modified_by_id",
+ table: "time_labels");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "tenant_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "modified_by_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "deleted_by_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "created_by_id",
+ table: "tenants",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_tenants_users_created_by_id",
+ table: "tenants",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_tenants_users_deleted_by_id",
+ table: "tenants",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_tenants_users_modified_by_id",
+ table: "tenants",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_tenants_tenant_id",
+ table: "time_categories",
+ column: "tenant_id",
+ principalTable: "tenants",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_users_created_by_id",
+ table: "time_categories",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_users_deleted_by_id",
+ table: "time_categories",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_users_modified_by_id",
+ table: "time_categories",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_tenants_tenant_id",
+ table: "time_entries",
+ column: "tenant_id",
+ principalTable: "tenants",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_users_created_by_id",
+ table: "time_entries",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_users_deleted_by_id",
+ table: "time_entries",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_users_modified_by_id",
+ table: "time_entries",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_tenants_tenant_id",
+ table: "time_labels",
+ column: "tenant_id",
+ principalTable: "tenants",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_users_created_by_id",
+ table: "time_labels",
+ column: "created_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_users_deleted_by_id",
+ table: "time_labels",
+ column: "deleted_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_users_modified_by_id",
+ table: "time_labels",
+ column: "modified_by_id",
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ }
+ }
+}
diff --git a/server/src/Migrations/AppDbContextModelSnapshot.cs b/server/src/Migrations/AppDbContextModelSnapshot.cs
index e040cfb..a777782 100644
--- a/server/src/Migrations/AppDbContextModelSnapshot.cs
+++ b/server/src/Migrations/AppDbContextModelSnapshot.cs
@@ -136,11 +136,11 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
- b.Property<Guid>("CreatedById")
+ b.Property<Guid?>("CreatedById")
.HasColumnType("uuid")
.HasColumnName("created_by_id");
- b.Property<Guid>("DeletedById")
+ b.Property<Guid?>("DeletedById")
.HasColumnType("uuid")
.HasColumnName("deleted_by_id");
@@ -160,7 +160,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
- b.Property<Guid>("ModifiedById")
+ b.Property<Guid?>("ModifiedById")
.HasColumnType("uuid")
.HasColumnName("modified_by_id");
@@ -168,7 +168,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("text")
.HasColumnName("name");
- b.Property<Guid>("TenantId")
+ b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("tenant_id");
@@ -216,11 +216,11 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
- b.Property<Guid>("CreatedById")
+ b.Property<Guid?>("CreatedById")
.HasColumnType("uuid")
.HasColumnName("created_by_id");
- b.Property<Guid>("DeletedById")
+ b.Property<Guid?>("DeletedById")
.HasColumnType("uuid")
.HasColumnName("deleted_by_id");
@@ -228,7 +228,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
- b.Property<Guid>("ModifiedById")
+ b.Property<Guid?>("ModifiedById")
.HasColumnType("uuid")
.HasColumnName("modified_by_id");
@@ -236,7 +236,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("text")
.HasColumnName("name");
- b.Property<Guid>("TenantId")
+ b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("tenant_id");
@@ -280,11 +280,11 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
- b.Property<Guid>("CreatedById")
+ b.Property<Guid?>("CreatedById")
.HasColumnType("uuid")
.HasColumnName("created_by_id");
- b.Property<Guid>("DeletedById")
+ b.Property<Guid?>("DeletedById")
.HasColumnType("uuid")
.HasColumnName("deleted_by_id");
@@ -296,7 +296,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
- b.Property<Guid>("ModifiedById")
+ b.Property<Guid?>("ModifiedById")
.HasColumnType("uuid")
.HasColumnName("modified_by_id");
@@ -308,7 +308,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("stop");
- b.Property<Guid>("TenantId")
+ b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("tenant_id");
@@ -355,11 +355,11 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
- b.Property<Guid>("CreatedById")
+ b.Property<Guid?>("CreatedById")
.HasColumnType("uuid")
.HasColumnName("created_by_id");
- b.Property<Guid>("DeletedById")
+ b.Property<Guid?>("DeletedById")
.HasColumnType("uuid")
.HasColumnName("deleted_by_id");
@@ -367,7 +367,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
- b.Property<Guid>("ModifiedById")
+ b.Property<Guid?>("ModifiedById")
.HasColumnType("uuid")
.HasColumnName("modified_by_id");
@@ -375,7 +375,7 @@ namespace IOL.GreatOffice.Api.Migrations
.HasColumnType("text")
.HasColumnName("name");
- b.Property<Guid>("TenantId")
+ b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("tenant_id");
@@ -477,22 +477,16 @@ namespace IOL.GreatOffice.Api.Migrations
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_tenants_users_created_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
.WithMany()
.HasForeignKey("DeletedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_tenants_users_deleted_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
.WithMany()
.HasForeignKey("ModifiedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_tenants_users_modified_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
@@ -523,29 +517,21 @@ namespace IOL.GreatOffice.Api.Migrations
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_categories_users_created_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
.WithMany()
.HasForeignKey("DeletedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_categories_users_deleted_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
.WithMany()
.HasForeignKey("ModifiedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_categories_users_modified_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_categories_tenants_tenant_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
@@ -576,29 +562,21 @@ namespace IOL.GreatOffice.Api.Migrations
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_entries_users_created_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
.WithMany()
.HasForeignKey("DeletedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_entries_users_deleted_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
.WithMany()
.HasForeignKey("ModifiedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_entries_users_modified_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_entries_tenants_tenant_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "User")
@@ -626,29 +604,21 @@ namespace IOL.GreatOffice.Api.Migrations
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_labels_users_created_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "DeletedBy")
.WithMany()
.HasForeignKey("DeletedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_labels_users_deleted_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.User", "ModifiedBy")
.WithMany()
.HasForeignKey("ModifiedById")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_labels_users_modified_by_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired()
.HasConstraintName("fk_time_labels_tenants_tenant_id");
b.HasOne("IOL.GreatOffice.Api.Data.Database.TimeEntry", null)