From a06d5b91aaf31b983e14be13aff36a44d6de1d89 Mon Sep 17 00:00:00 2001 From: Dao Yu Lai Date: Sat, 30 Nov 2024 15:57:15 -0800 Subject: [PATCH] MMI-3116 Update Source and Series CBRA source - added is CBRA source to source and series page - updated source and series data models --- .../features/admin/series/SeriesDetails.tsx | 1 + .../admin/series/constants/columns.tsx | 7 + .../admin/series/constants/defaultSeries.ts | 1 + .../features/admin/sources/SourceDetails.tsx | 1 + .../admin/sources/constants/defaultSource.ts | 1 + .../settings/template/utils/generateSeries.ts | 1 + .../settings/template/utils/generateSource.ts | 1 + .../dal/Configuration/SeriesConfiguration.cs | 1 + .../dal/Configuration/SourceConfiguration.cs | 1 + .../1.3.8/Down/PostDown/00-source-series.sql | 7 + .../1.3.8/Up/PostUp/00-source-series.sql | 7 + .../20241129161926_1.3.8.Designer.cs | 7376 +++++++++++++++++ .../dal/Migrations/20241129161926_1.3.8.cs | 40 + .../dal/Migrations/TNOContextModelSnapshot.cs | 10 +- libs/net/entities/Series.cs | 6 + libs/net/entities/Source.cs | 6 + .../models/Areas/Admin/Series/SeriesModel.cs | 7 + .../models/Areas/Admin/Series/SourceModel.cs | 6 + .../models/Areas/Admin/Source/SourceModel.cs | 11 +- .../Editor/Models/Content/SeriesModel.cs | 6 + .../Editor/Models/Content/SourceModel.cs | 11 +- .../Areas/Editor/Models/Series/SeriesModel.cs | 6 + .../Areas/Editor/Models/Source/SourceModel.cs | 6 + .../Services/Models/Content/SeriesModel.cs | 7 + .../Services/Models/Content/SourceModel.cs | 11 +- .../Subscriber/Models/Content/SeriesModel.cs | 6 + .../Subscriber/Models/Content/SourceModel.cs | 11 +- .../Subscriber/Models/Series/SeriesModel.cs | 6 + .../Subscriber/Models/Source/SourceModel.cs | 6 + .../src/hooks/api/interfaces/ISeriesModel.ts | 1 + .../src/hooks/api/interfaces/ISourceModel.ts | 1 + libs/npm/core/src/hooks/api/mocks/series.ts | 1 + libs/npm/core/src/hooks/api/mocks/sources.ts | 2 + services/net/content/ContentManager.cs | 3 +- 34 files changed, 7565 insertions(+), 10 deletions(-) create mode 100644 libs/net/dal/Migrations/1.3.8/Down/PostDown/00-source-series.sql create mode 100644 libs/net/dal/Migrations/1.3.8/Up/PostUp/00-source-series.sql create mode 100644 libs/net/dal/Migrations/20241129161926_1.3.8.Designer.cs create mode 100644 libs/net/dal/Migrations/20241129161926_1.3.8.cs diff --git a/app/editor/src/features/admin/series/SeriesDetails.tsx b/app/editor/src/features/admin/series/SeriesDetails.tsx index d9a3d1ad54..283c54e1f0 100644 --- a/app/editor/src/features/admin/series/SeriesDetails.tsx +++ b/app/editor/src/features/admin/series/SeriesDetails.tsx @@ -136,6 +136,7 @@ const SeriesDetails: React.FC = () => { + diff --git a/app/editor/src/features/admin/series/constants/columns.tsx b/app/editor/src/features/admin/series/constants/columns.tsx index e4b8a33476..01138f3fc4 100644 --- a/app/editor/src/features/admin/series/constants/columns.tsx +++ b/app/editor/src/features/admin/series/constants/columns.tsx @@ -47,4 +47,11 @@ export const columns: ITableHookColumn[] = [ hAlign: 'center', cell: (cell) => , }, + { + label: 'Is CBRA Source', + accessor: 'isCBRASource', + width: 1, + hAlign: 'center', + cell: (cell) => , + }, ]; diff --git a/app/editor/src/features/admin/series/constants/defaultSeries.ts b/app/editor/src/features/admin/series/constants/defaultSeries.ts index b019e2db95..ae95fecc02 100644 --- a/app/editor/src/features/admin/series/constants/defaultSeries.ts +++ b/app/editor/src/features/admin/series/constants/defaultSeries.ts @@ -10,4 +10,5 @@ export const defaultSeries: ISeriesForm = { sortOrder: 0, autoTranscribe: false, useInTopics: false, + isCBRASource: false, }; diff --git a/app/editor/src/features/admin/sources/SourceDetails.tsx b/app/editor/src/features/admin/sources/SourceDetails.tsx index e558356593..5e7b6fef65 100644 --- a/app/editor/src/features/admin/sources/SourceDetails.tsx +++ b/app/editor/src/features/admin/sources/SourceDetails.tsx @@ -127,6 +127,7 @@ const SourceDetails: React.FC = () => { + ); diff --git a/app/editor/src/features/admin/sources/constants/defaultSource.ts b/app/editor/src/features/admin/sources/constants/defaultSource.ts index 83fb36b9e7..afd8951baa 100644 --- a/app/editor/src/features/admin/sources/constants/defaultSource.ts +++ b/app/editor/src/features/admin/sources/constants/defaultSource.ts @@ -20,4 +20,5 @@ export const defaultSource: ISourceForm = { }, actions: [], metrics: [], + isCBRASource: false, }; diff --git a/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSeries.ts b/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSeries.ts index e9b267397b..42568ae14c 100644 --- a/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSeries.ts +++ b/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSeries.ts @@ -15,6 +15,7 @@ export const generateSeries = (options: IGenerateSeriesOptions) => { isOther: false, autoTranscribe: false, useInTopics: false, + isCBRASource: false, ...options.init, }; return entity; diff --git a/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSource.ts b/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSource.ts index 8b67b822fe..088c836de6 100644 --- a/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSource.ts +++ b/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateSource.ts @@ -27,6 +27,7 @@ export const generateSource = (options: IGenerateSourceOptions) => { configuration: {}, actions: [], metrics: [], + isCBRASource: false, ...options.init, }; return entity; diff --git a/libs/net/dal/Configuration/SeriesConfiguration.cs b/libs/net/dal/Configuration/SeriesConfiguration.cs index 389cde2f27..14e0824baf 100644 --- a/libs/net/dal/Configuration/SeriesConfiguration.cs +++ b/libs/net/dal/Configuration/SeriesConfiguration.cs @@ -12,6 +12,7 @@ public override void Configure(EntityTypeBuilder builder) builder.Property(m => m.SourceId).IsRequired(false); builder.Property(m => m.AutoTranscribe).IsRequired(); builder.Property(m => m.UseInTopics).IsRequired(); + builder.Property(m => m.IsCBRASource).IsRequired(false); builder.HasOne(m => m.Source).WithMany(m => m.Series).HasForeignKey(m => m.SourceId).OnDelete(DeleteBehavior.Cascade); builder.HasMany(m => m.MediaTypeSearchMappings).WithMany(m => m.SeriesSearchMappings).UsingEntity(); diff --git a/libs/net/dal/Configuration/SourceConfiguration.cs b/libs/net/dal/Configuration/SourceConfiguration.cs index a6a97fc846..5c378bb843 100644 --- a/libs/net/dal/Configuration/SourceConfiguration.cs +++ b/libs/net/dal/Configuration/SourceConfiguration.cs @@ -21,6 +21,7 @@ public override void Configure(EntityTypeBuilder builder) builder.Property(m => m.DisableTranscribe).IsRequired(); builder.Property(m => m.UseInTopics).IsRequired(); builder.Property(m => m.Configuration).IsRequired().HasColumnType("jsonb").HasDefaultValueSql("'{}'::jsonb"); + builder.Property(m => m.IsCBRASource).IsRequired(false); builder.HasOne(m => m.Owner).WithMany().HasForeignKey(m => m.OwnerId).OnDelete(DeleteBehavior.SetNull); builder.HasOne(m => m.License).WithMany(m => m.Sources).HasForeignKey(m => m.LicenseId).OnDelete(DeleteBehavior.Restrict); diff --git a/libs/net/dal/Migrations/1.3.8/Down/PostDown/00-source-series.sql b/libs/net/dal/Migrations/1.3.8/Down/PostDown/00-source-series.sql new file mode 100644 index 0000000000..1f2c039cd5 --- /dev/null +++ b/libs/net/dal/Migrations/1.3.8/Down/PostDown/00-source-series.sql @@ -0,0 +1,7 @@ +DO $$ +BEGIN + +ALTER TABLE public."source" DROP COLUMN "is_cbra_source"; +ALTER TABLE public."series" DROP COLUMN "is_cbra_source"; + +END $$; diff --git a/libs/net/dal/Migrations/1.3.8/Up/PostUp/00-source-series.sql b/libs/net/dal/Migrations/1.3.8/Up/PostUp/00-source-series.sql new file mode 100644 index 0000000000..dc6cac01a9 --- /dev/null +++ b/libs/net/dal/Migrations/1.3.8/Up/PostUp/00-source-series.sql @@ -0,0 +1,7 @@ +DO $$ +BEGIN + +ALTER TABLE public."source" ADD COLUMN "is_cbra_source" boolean NOT NULL DEFAULT false; +ALTER TABLE public."series" ADD COLUMN "is_cbra_source" boolean NOT NULL DEFAULT false; + +END $$; diff --git a/libs/net/dal/Migrations/20241129161926_1.3.8.Designer.cs b/libs/net/dal/Migrations/20241129161926_1.3.8.Designer.cs new file mode 100644 index 0000000000..2fc46322b2 --- /dev/null +++ b/libs/net/dal/Migrations/20241129161926_1.3.8.Designer.cs @@ -0,0 +1,7376 @@ +// +using System; +using System.Collections.Generic; +using System.Text.Json; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using TNO.DAL; +using TNO.Entities.Models; + +#nullable disable + +namespace TNO.DAL.Migrations +{ + [DbContext(typeof(TNOContext))] + [Migration("20241129161926_1.3.8")] + partial class _138 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("TNO.Entities.AVOverviewInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("IsPublished") + .HasColumnType("boolean"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("published_on"); + + b.Property("Response") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("response") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("TemplateType") + .HasColumnType("integer") + .HasColumnName("template_type"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("PublishedOn") + .IsUnique(); + + b.HasIndex("TemplateType", "PublishedOn"); + + b.ToTable("av_overview_instance"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewSection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Anchors") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("anchors"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("InstanceId") + .HasColumnType("bigint") + .HasColumnName("av_overview_instance_id"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.Property("OtherSource") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("other_source"); + + b.Property("SeriesId") + .HasColumnType("integer") + .HasColumnName("series_id"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("StartTime") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)") + .HasColumnName("start_time"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("InstanceId"); + + b.HasIndex("SeriesId"); + + b.HasIndex("SourceId"); + + b.ToTable("av_overview_section"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewSectionItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("ItemType") + .HasColumnType("integer") + .HasColumnName("item_type"); + + b.Property("SectionId") + .HasColumnType("integer") + .HasColumnName("av_overview_section_id"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("Summary") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("summary"); + + b.Property("Time") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)") + .HasColumnName("time"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex("SectionId"); + + b.ToTable("av_overview_section_item"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplate", b => + { + b.Property("TemplateType") + .HasColumnType("integer") + .HasColumnName("template_type"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("TemplateId") + .HasColumnType("integer") + .HasColumnName("report_template_id"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("TemplateType"); + + b.HasIndex("TemplateId"); + + b.ToTable("av_overview_template"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplateSection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Anchors") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("anchors"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.Property("OtherSource") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("other_source"); + + b.Property("SeriesId") + .HasColumnType("integer") + .HasColumnName("series_id"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("StartTime") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)") + .HasColumnName("start_time"); + + b.Property("TemplateType") + .HasColumnType("integer") + .HasColumnName("av_overview_template_id"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("SeriesId"); + + b.HasIndex("SourceId"); + + b.HasIndex("TemplateType"); + + b.ToTable("av_overview_template_section"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplateSectionItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("ItemType") + .HasColumnType("integer") + .HasColumnName("item_type"); + + b.Property("SectionId") + .HasColumnType("integer") + .HasColumnName("av_overview_template_section_id"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("Summary") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("summary"); + + b.Property("Time") + .IsRequired() + .HasMaxLength(8) + .HasColumnType("character varying(8)") + .HasColumnName("time"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("SectionId"); + + b.ToTable("av_overview_template_section_item"); + }); + + modelBuilder.Entity("TNO.Entities.Action", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("DefaultValue") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("default_value") + .HasDefaultValueSql("''"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("ValueLabel") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("value_label") + .HasDefaultValueSql("''"); + + b.Property("ValueType") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("value_type"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "ValueType", "ValueLabel" }, "IX_action"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_action_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique(); + + b.ToTable("action"); + }); + + modelBuilder.Entity("TNO.Entities.Cache", b => + { + b.Property("Key") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("key"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("character varying(150)") + .HasColumnName("value"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Key"); + + b.HasIndex(new[] { "Key", "Value" }, "IX_cache"); + + b.ToTable("cache"); + }); + + modelBuilder.Entity("TNO.Entities.ChartTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("Template") + .IsRequired() + .HasColumnType("text") + .HasColumnName("template"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_charttemplate_is_enabled"); + + b.ToTable("chart_template"); + }); + + modelBuilder.Entity("TNO.Entities.Connection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Configuration") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("configuration") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("ConnectionType") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("connection_type"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsReadOnly") + .HasColumnType("boolean") + .HasColumnName("is_read_only"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_connection_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique() + .HasDatabaseName("IX_name1"); + + b.ToTable("connection"); + }); + + modelBuilder.Entity("TNO.Entities.Content", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasColumnType("text") + .HasColumnName("body"); + + b.Property("Byline") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("byline"); + + b.Property("ContentType") + .HasColumnType("integer") + .HasColumnName("content_type"); + + b.Property("ContributorId") + .HasColumnType("integer") + .HasColumnName("contributor_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Edition") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("edition"); + + b.Property("ExternalUid") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasDefaultValue("") + .HasColumnName("external_uid"); + + b.Property("Headline") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("headline"); + + b.Property("IngestTypeId") + .HasColumnType("integer"); + + b.Property("IsApproved") + .HasColumnType("boolean") + .HasColumnName("is_approved"); + + b.Property("IsHidden") + .HasColumnType("boolean") + .HasColumnName("is_hidden"); + + b.Property("IsPrivate") + .HasColumnType("boolean") + .HasColumnName("is_private"); + + b.Property("LicenseId") + .HasColumnType("integer") + .HasColumnName("license_id"); + + b.Property("MediaTypeId") + .HasColumnType("integer") + .HasColumnName("media_type_id"); + + b.Property("OtherSource") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("source"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("Page") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("page"); + + b.Property("PostedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("posted_on"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("published_on"); + + b.Property("Section") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("section"); + + b.Property("SeriesId") + .HasColumnType("integer") + .HasColumnName("series_id"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("SourceUrl") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("source_url"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("Summary") + .IsRequired() + .HasColumnType("text") + .HasColumnName("summary"); + + b.Property("Uid") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("uid"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.Property>("Versions") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("versions") + .HasDefaultValueSql("'{}'::jsonb"); + + b.HasKey("Id"); + + b.HasIndex("ContributorId"); + + b.HasIndex("IngestTypeId"); + + b.HasIndex("LicenseId"); + + b.HasIndex("MediaTypeId"); + + b.HasIndex("OwnerId"); + + b.HasIndex("SeriesId"); + + b.HasIndex("SourceId"); + + b.HasIndex(new[] { "ContentType", "OtherSource", "Uid", "Page", "Status", "IsHidden" }, "IX_content"); + + b.HasIndex(new[] { "PublishedOn", "CreatedOn" }, "IX_content_dates"); + + b.HasIndex(new[] { "Headline" }, "IX_headline"); + + b.HasIndex(new[] { "Edition", "Section", "Byline" }, "IX_print_content"); + + b.ToTable("content"); + }); + + modelBuilder.Entity("TNO.Entities.ContentAction", b => + { + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("ActionId") + .HasColumnType("integer") + .HasColumnName("action_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("character varying(150)") + .HasColumnName("value"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ContentId", "ActionId"); + + b.HasIndex("ActionId"); + + b.ToTable("content_action"); + }); + + modelBuilder.Entity("TNO.Entities.ContentLabel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("key"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("value"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex(new[] { "Key", "Value" }, "IX_content_label"); + + b.ToTable("content_label"); + }); + + modelBuilder.Entity("TNO.Entities.ContentLink", b => + { + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("LinkId") + .HasColumnType("bigint") + .HasColumnName("link_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("value"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ContentId", "LinkId"); + + b.HasIndex("LinkId"); + + b.ToTable("content_link"); + }); + + modelBuilder.Entity("TNO.Entities.ContentLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("message"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.ToTable("content_log"); + }); + + modelBuilder.Entity("TNO.Entities.ContentReference", b => + { + b.Property("Source") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("source"); + + b.Property("Uid") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("uid"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Metadata") + .HasColumnType("jsonb") + .HasColumnName("metadata"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("published_on"); + + b.Property("SourceUpdateOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("source_updated_on"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("Topic") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("topic"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Source", "Uid"); + + b.HasIndex(new[] { "PublishedOn", "Status" }, "IX_content_reference"); + + b.HasIndex(new[] { "Source", "Uid" }, "IX_source_uid"); + + b.ToTable("content_reference"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTag", b => + { + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("TagId") + .HasColumnType("integer") + .HasColumnName("tag_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ContentId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("content_tag"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTonePool", b => + { + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("TonePoolId") + .HasColumnType("integer") + .HasColumnName("tone_pool_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Value") + .HasColumnType("integer") + .HasColumnName("value"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ContentId", "TonePoolId"); + + b.HasIndex("TonePoolId"); + + b.ToTable("content_tone"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTopic", b => + { + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("TopicId") + .HasColumnType("integer") + .HasColumnName("topic_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Score") + .HasColumnType("integer") + .HasColumnName("score"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ContentId", "TopicId"); + + b.HasIndex("TopicId"); + + b.ToTable("content_topic"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTypeAction", b => + { + b.Property("ContentType") + .HasColumnType("integer") + .HasColumnName("content_type"); + + b.Property("ActionId") + .HasColumnType("integer") + .HasColumnName("action_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ContentType", "ActionId"); + + b.HasIndex("ActionId"); + + b.ToTable("content_type_action"); + }); + + modelBuilder.Entity("TNO.Entities.Contributor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Aliases") + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("aliases"); + + b.Property("AutoTranscribe") + .HasColumnType("boolean") + .HasColumnName("auto_transcribe"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPress") + .HasColumnType("boolean") + .HasColumnName("is_press"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("SourceId"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_contributor_is_enabled"); + + b.ToTable("contributor"); + }); + + modelBuilder.Entity("TNO.Entities.DataLocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ConnectionId") + .HasColumnType("integer") + .HasColumnName("connection_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ConnectionId"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_datalocation_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique() + .HasDatabaseName("IX_name2"); + + b.ToTable("data_location"); + }); + + modelBuilder.Entity("TNO.Entities.EarnedMedia", b => + { + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("ContentType") + .HasColumnType("integer") + .HasColumnName("content_type"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("LengthOfContent") + .HasColumnType("integer") + .HasColumnName("length_of_content"); + + b.Property("Rate") + .HasColumnType("real") + .HasColumnName("rate"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("SourceId", "ContentType"); + + b.ToTable("earned_media"); + }); + + modelBuilder.Entity("TNO.Entities.EventSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description"); + + b.Property("EventType") + .HasColumnType("integer") + .HasColumnName("event_type"); + + b.Property("FolderId") + .HasColumnType("integer") + .HasColumnName("folder_id"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("LastRanOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_ran_on"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("NotificationId") + .HasColumnType("integer") + .HasColumnName("notification_id"); + + b.Property("ReportId") + .HasColumnType("integer") + .HasColumnName("report_id"); + + b.Property("RequestSentOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("request_sent_on"); + + b.Property("ScheduleId") + .HasColumnType("integer") + .HasColumnName("schedule_id"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("FolderId"); + + b.HasIndex("NotificationId"); + + b.HasIndex("ReportId"); + + b.HasIndex("ScheduleId"); + + b.ToTable("event_schedule"); + }); + + modelBuilder.Entity("TNO.Entities.FileReference", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("ContentType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("content_type"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("file_name"); + + b.Property("IsSyncedToS3") + .HasColumnType("boolean") + .HasColumnName("is_synced_to_s3"); + + b.Property("IsUploaded") + .HasColumnType("boolean") + .HasColumnName("is_uploaded"); + + b.Property("LastSyncedToS3On") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_synced_to_s3_on"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("path"); + + b.Property("RunningTime") + .HasColumnType("bigint") + .HasColumnName("running_time"); + + b.Property("S3Path") + .HasColumnType("text") + .HasColumnName("s3_path"); + + b.Property("Size") + .HasColumnType("bigint") + .HasColumnName("size"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.ToTable("file_reference"); + }); + + modelBuilder.Entity("TNO.Entities.Filter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("Query") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("query") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId", "Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_filter_is_enabled"); + + b.ToTable("filter"); + }); + + modelBuilder.Entity("TNO.Entities.Folder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("FilterId") + .HasColumnType("integer") + .HasColumnName("filter_id"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("FilterId"); + + b.HasIndex("OwnerId", "Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_folder_is_enabled"); + + b.ToTable("folder"); + }); + + modelBuilder.Entity("TNO.Entities.FolderContent", b => + { + b.Property("FolderId") + .HasColumnType("integer") + .HasColumnName("folder_id"); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("FolderId", "ContentId"); + + b.HasIndex("ContentId"); + + b.ToTable("folder_content"); + }); + + modelBuilder.Entity("TNO.Entities.Ingest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Configuration") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("configuration") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("DestinationConnectionId") + .HasColumnType("integer") + .HasColumnName("destination_connection_id"); + + b.Property("IngestTypeId") + .HasColumnType("integer") + .HasColumnName("ingest_type_id"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("MediaTypeId") + .HasColumnType("integer") + .HasColumnName("media_type_id"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("name"); + + b.Property("ResetRetryAfterDelayMs") + .HasColumnType("integer") + .HasColumnName("reset_retry_after_delay_ms"); + + b.Property("RetryLimit") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(3) + .HasColumnName("retry_limit"); + + b.Property("ScheduleType") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("schedule_type"); + + b.Property("SourceConnectionId") + .HasColumnType("integer") + .HasColumnName("source_connection_id"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("Topic") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("topic"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("DestinationConnectionId"); + + b.HasIndex("MediaTypeId"); + + b.HasIndex("SourceConnectionId"); + + b.HasIndex("SourceId"); + + b.HasIndex(new[] { "IngestTypeId", "SourceId", "Topic" }, "IX_ingest"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique() + .HasDatabaseName("IX_name3"); + + b.ToTable("ingest"); + }); + + modelBuilder.Entity("TNO.Entities.IngestDataLocation", b => + { + b.Property("IngestId") + .HasColumnType("integer") + .HasColumnName("ingest_id"); + + b.Property("DataLocationId") + .HasColumnType("integer") + .HasColumnName("data_location_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("IngestId", "DataLocationId"); + + b.HasIndex("DataLocationId"); + + b.ToTable("ingest_data_location"); + }); + + modelBuilder.Entity("TNO.Entities.IngestSchedule", b => + { + b.Property("IngestId") + .HasColumnType("integer") + .HasColumnName("ingest_id"); + + b.Property("ScheduleId") + .HasColumnType("integer") + .HasColumnName("schedule_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("IngestId", "ScheduleId"); + + b.HasIndex("ScheduleId"); + + b.ToTable("ingest_schedule"); + }); + + modelBuilder.Entity("TNO.Entities.IngestState", b => + { + b.Property("IngestId") + .HasColumnType("integer") + .HasColumnName("ingest_id"); + + b.Property("CreationDateOfLastItem") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_date_of_last_item"); + + b.Property("FailedAttempts") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("failed_attempts"); + + b.Property("LastRanOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_ran_on"); + + b.HasKey("IngestId"); + + b.ToTable("ingest_state"); + }); + + modelBuilder.Entity("TNO.Entities.IngestType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoTranscribe") + .HasColumnType("boolean") + .HasColumnName("auto_transcribe"); + + b.Property("ContentType") + .HasColumnType("integer") + .HasColumnName("content_type"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("DisableTranscribe") + .HasColumnType("boolean") + .HasColumnName("disable_transcribe"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_ingesttype_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique() + .HasDatabaseName("IX_name4"); + + b.ToTable("ingest_type"); + }); + + modelBuilder.Entity("TNO.Entities.License", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("TTL") + .HasColumnType("integer") + .HasColumnName("ttl"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_license_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique() + .HasDatabaseName("IX_name5"); + + b.ToTable("license"); + }); + + modelBuilder.Entity("TNO.Entities.MediaType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoTranscribe") + .HasColumnType("boolean") + .HasColumnName("auto_transcribe"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("ListOption") + .HasColumnType("integer") + .HasColumnName("list_option"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_mediatype_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique() + .HasDatabaseName("IX_name6"); + + b.ToTable("media_type"); + }); + + modelBuilder.Entity("TNO.Entities.Metric", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_metric_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_name") + .IsUnique() + .HasDatabaseName("IX_name7"); + + b.ToTable("metric"); + }); + + modelBuilder.Entity("TNO.Entities.Minister", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Aliases") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("aliases") + .HasDefaultValueSql("''"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("OrganizationId") + .HasColumnType("integer") + .HasColumnName("organization_id"); + + b.Property("Position") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("position") + .HasDefaultValueSql("''"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("OrganizationId"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_minister_is_enabled"); + + b.ToTable("minister"); + }); + + modelBuilder.Entity("TNO.Entities.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AlertOnIndex") + .HasColumnType("boolean") + .HasColumnName("alert_on_index"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("NotificationType") + .HasColumnType("integer") + .HasColumnName("notification_type"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("Query") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("query") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("Resend") + .HasColumnType("integer") + .HasColumnName("resend"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("TemplateId") + .HasColumnType("integer") + .HasColumnName("notification_template_id"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("TemplateId"); + + b.HasIndex("OwnerId", "Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_notification_is_enabled"); + + b.ToTable("notification"); + }); + + modelBuilder.Entity("TNO.Entities.NotificationInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasColumnType("text") + .HasColumnName("body"); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("NotificationId") + .HasColumnType("integer") + .HasColumnName("notification_id"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("Response") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("response") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SentOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_on"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("text") + .HasColumnName("subject"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex("NotificationId"); + + b.ToTable("notification_instance"); + }); + + modelBuilder.Entity("TNO.Entities.NotificationTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasColumnType("text") + .HasColumnName("body"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("text") + .HasColumnName("subject"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("IsPublic", "IsEnabled"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_notificationtemplate_is_enabled"); + + b.ToTable("notification_template"); + }); + + modelBuilder.Entity("TNO.Entities.Organization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("ParentId") + .HasColumnType("integer") + .HasColumnName("parent_id"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ParentId", "Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_organization_is_enabled"); + + b.ToTable("organization"); + }); + + modelBuilder.Entity("TNO.Entities.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("ProductType") + .HasColumnType("integer") + .HasColumnName("product_type"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("TargetProductId") + .HasColumnType("integer") + .HasColumnName("target_product_id"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("Name", "TargetProductId", "ProductType") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_product_is_enabled"); + + b.ToTable("product"); + }); + + modelBuilder.Entity("TNO.Entities.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Byline") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("byline"); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("IsRelevant") + .HasColumnType("boolean") + .HasColumnName("is_relevant"); + + b.Property("Statement") + .IsRequired() + .HasColumnType("text") + .HasColumnName("statement"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex(new[] { "Statement" }, "IX_statement"); + + b.ToTable("quote"); + }); + + modelBuilder.Entity("TNO.Entities.Report", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("TemplateId") + .HasColumnType("integer") + .HasColumnName("report_template_id"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("TemplateId"); + + b.HasIndex("OwnerId", "Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_report_is_enabled"); + + b.ToTable("report"); + }); + + modelBuilder.Entity("TNO.Entities.ReportInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasColumnType("text") + .HasColumnName("body"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("PublishedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("published_on"); + + b.Property("ReportId") + .HasColumnType("integer") + .HasColumnName("report_id"); + + b.Property("Response") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("response") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SentOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_on"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("text") + .HasColumnName("subject"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.HasIndex("ReportId"); + + b.HasIndex(new[] { "PublishedOn", "CreatedOn" }, "IX_report_dates"); + + b.ToTable("report_instance"); + }); + + modelBuilder.Entity("TNO.Entities.ReportInstanceContent", b => + { + b.Property("InstanceId") + .HasColumnType("bigint") + .HasColumnName("report_instance_id"); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("SectionName") + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("section_name") + .HasDefaultValueSql("''"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("InstanceId", "ContentId", "SectionName"); + + b.HasIndex("ContentId"); + + b.ToTable("report_instance_content"); + }); + + modelBuilder.Entity("TNO.Entities.ReportSection", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("FilterId") + .HasColumnType("integer") + .HasColumnName("filter_id"); + + b.Property("FolderId") + .HasColumnType("integer") + .HasColumnName("folder_id"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("LinkedReportId") + .HasColumnType("integer") + .HasColumnName("linked_report_id"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("ReportId") + .HasColumnType("integer") + .HasColumnName("report_id"); + + b.Property("SectionType") + .HasColumnType("integer") + .HasColumnName("section_type"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("FilterId"); + + b.HasIndex("FolderId"); + + b.HasIndex("LinkedReportId"); + + b.HasIndex("ReportId", "Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_reportsection_is_enabled"); + + b.ToTable("report_section"); + }); + + modelBuilder.Entity("TNO.Entities.ReportSectionChartTemplate", b => + { + b.Property("ReportSectionId") + .HasColumnType("integer") + .HasColumnName("report_section_id"); + + b.Property("ChartTemplateId") + .HasColumnType("integer") + .HasColumnName("chart_template_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ReportSectionId", "ChartTemplateId"); + + b.HasIndex("ChartTemplateId"); + + b.ToTable("report_section_chart_template"); + }); + + modelBuilder.Entity("TNO.Entities.ReportTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Body") + .IsRequired() + .HasColumnType("text") + .HasColumnName("body"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("ReportType") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("report_type") + .HasDefaultValueSql("0"); + + b.Property("Settings") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("settings") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("text") + .HasColumnName("subject"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("IsPublic", "IsEnabled"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_reporttemplate_is_enabled"); + + b.ToTable("report_template"); + }); + + modelBuilder.Entity("TNO.Entities.ReportTemplateChartTemplate", b => + { + b.Property("ReportTemplateId") + .HasColumnType("integer") + .HasColumnName("report_template_id"); + + b.Property("ChartTemplateId") + .HasColumnType("integer") + .HasColumnName("chart_template_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("ReportTemplateId", "ChartTemplateId"); + + b.HasIndex("ChartTemplateId"); + + b.ToTable("report_template_chart_template"); + }); + + modelBuilder.Entity("TNO.Entities.Schedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("DayOfMonth") + .HasColumnType("integer") + .HasColumnName("day_of_month"); + + b.Property("DelayMS") + .HasColumnType("integer") + .HasColumnName("delay_ms"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("Repeat") + .HasColumnType("boolean") + .HasColumnName("repeat"); + + b.Property("RequestedById") + .HasColumnType("integer") + .HasColumnName("requested_by_id"); + + b.Property("RunOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("run_on"); + + b.Property("RunOnMonths") + .HasColumnType("integer") + .HasColumnName("run_on_months"); + + b.Property("RunOnWeekDays") + .HasColumnType("integer") + .HasColumnName("run_on_week_days"); + + b.Property("RunOnlyOnce") + .HasColumnType("boolean") + .HasColumnName("run_only_once"); + + b.Property("StartAt") + .HasColumnType("interval") + .HasColumnName("start_at"); + + b.Property("StopAt") + .HasColumnType("interval") + .HasColumnName("stop_at"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("RequestedById"); + + b.HasIndex(new[] { "Name", "IsEnabled" }, "IX_schedule"); + + b.ToTable("schedule"); + }); + + modelBuilder.Entity("TNO.Entities.Sentiment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("Rate") + .HasColumnType("real") + .HasColumnName("rate"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Value") + .HasColumnType("real") + .HasColumnName("value"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_sentiment_is_enabled"); + + b.ToTable("sentiment"); + }); + + modelBuilder.Entity("TNO.Entities.Series", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoTranscribe") + .HasColumnType("boolean") + .HasColumnName("auto_transcribe"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsCBRASource") + .HasColumnType("boolean") + .HasColumnName("is_cbra_source"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsOther") + .HasColumnType("boolean") + .HasColumnName("is_other"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UseInTopics") + .HasColumnType("boolean") + .HasColumnName("use_in_topics"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("SourceId"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_series_is_enabled"); + + b.ToTable("series"); + }); + + modelBuilder.Entity("TNO.Entities.SeriesMediaTypeSearchMapping", b => + { + b.Property("SeriesId") + .HasColumnType("integer") + .HasColumnName("series_id"); + + b.Property("MediaTypeId") + .HasColumnType("integer") + .HasColumnName("media_type_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("SeriesId", "MediaTypeId"); + + b.HasIndex("MediaTypeId"); + + b.ToTable("series_media_type_search_mapping"); + }); + + modelBuilder.Entity("TNO.Entities.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Value") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("value") + .HasDefaultValueSql("''"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_setting_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_setting_name") + .IsUnique(); + + b.ToTable("setting"); + }); + + modelBuilder.Entity("TNO.Entities.Source", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoTranscribe") + .HasColumnType("boolean") + .HasColumnName("auto_transcribe"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("code"); + + b.Property("Configuration") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("configuration") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("DisableTranscribe") + .HasColumnType("boolean") + .HasColumnName("disable_transcribe"); + + b.Property("IsCBRASource") + .HasColumnType("boolean") + .HasColumnName("is_cbra_source"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("LicenseId") + .HasColumnType("integer") + .HasColumnName("license_id"); + + b.Property("MediaTypeId") + .HasColumnType("integer") + .HasColumnName("media_type_id"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("ShortName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("short_name") + .HasDefaultValueSql("''"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UseInTopics") + .HasColumnType("boolean") + .HasColumnName("use_in_topics"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("LicenseId"); + + b.HasIndex("MediaTypeId"); + + b.HasIndex("OwnerId"); + + b.HasIndex(new[] { "Code" }, "IX_source_code") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_source_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_source_name") + .IsUnique(); + + b.ToTable("source"); + }); + + modelBuilder.Entity("TNO.Entities.SourceMediaTypeSearchMapping", b => + { + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("MediaTypeId") + .HasColumnType("integer") + .HasColumnName("media_type_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("SourceId", "MediaTypeId"); + + b.HasIndex("MediaTypeId"); + + b.ToTable("source_media_type_search_mapping"); + }); + + modelBuilder.Entity("TNO.Entities.SourceMetric", b => + { + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("MetricId") + .HasColumnType("integer") + .HasColumnName("metric_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Earned") + .ValueGeneratedOnAdd() + .HasColumnType("real") + .HasDefaultValue(0f) + .HasColumnName("earned"); + + b.Property("Impression") + .ValueGeneratedOnAdd() + .HasColumnType("real") + .HasDefaultValue(0f) + .HasColumnName("impression"); + + b.Property("Reach") + .ValueGeneratedOnAdd() + .HasColumnType("real") + .HasDefaultValue(0f) + .HasColumnName("reach"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("SourceId", "MetricId"); + + b.HasIndex("MetricId"); + + b.ToTable("source_metric"); + }); + + modelBuilder.Entity("TNO.Entities.SystemMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasColumnName("description"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text") + .HasColumnName("message"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasColumnType("text") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on"); + + b.Property("Version") + .HasColumnType("bigint") + .HasColumnName("version"); + + b.HasKey("Id"); + + b.ToTable("system_message"); + }); + + modelBuilder.Entity("TNO.Entities.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("character varying(15)") + .HasColumnName("code"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "Code" }, "IX_tag_code") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_tag_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_tag_name") + .IsUnique(); + + b.ToTable("tag"); + }); + + modelBuilder.Entity("TNO.Entities.TimeTracking", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Activity") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("activity"); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Effort") + .HasColumnType("real") + .HasColumnName("effort"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("ContentId"); + + b.HasIndex("UserId"); + + b.ToTable("time_tracking"); + }); + + modelBuilder.Entity("TNO.Entities.TonePool", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("is_public"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("owner_id"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "OwnerId", "Name" }, "IX_tone_pool_name") + .IsUnique(); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_tonepool_is_enabled"); + + b.ToTable("tone_pool"); + }); + + modelBuilder.Entity("TNO.Entities.Topic", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("description") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("name"); + + b.Property("SortOrder") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("sort_order"); + + b.Property("TopicType") + .HasColumnType("integer") + .HasColumnName("topic_type"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "IsEnabled", "Name" }, "IX_topic_is_enabled"); + + b.HasIndex(new[] { "Name" }, "IX_topic_name") + .IsUnique(); + + b.ToTable("topic"); + }); + + modelBuilder.Entity("TNO.Entities.TopicScoreRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CharacterMax") + .HasColumnType("integer") + .HasColumnName("char_max"); + + b.Property("CharacterMin") + .HasColumnType("integer") + .HasColumnName("char_min"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("HasImage") + .HasColumnType("boolean") + .HasColumnName("has_image"); + + b.Property("PageMax") + .HasMaxLength(5) + .HasColumnType("character varying(5)") + .HasColumnName("page_max"); + + b.Property("PageMin") + .HasMaxLength(5) + .HasColumnType("character varying(5)") + .HasColumnName("page_min"); + + b.Property("Score") + .HasColumnType("integer") + .HasColumnName("score"); + + b.Property("Section") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("section"); + + b.Property("SeriesId") + .HasColumnType("integer") + .HasColumnName("series_id"); + + b.Property("SortOrder") + .HasColumnType("integer") + .HasColumnName("sort_order"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("TimeMax") + .HasColumnType("interval") + .HasColumnName("time_max"); + + b.Property("TimeMin") + .HasColumnType("interval") + .HasColumnName("time_min"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex("SeriesId"); + + b.HasIndex(new[] { "SourceId", "SeriesId", "Section" }, "IX_source_id_series_id_section"); + + b.ToTable("topic_score_rule"); + }); + + modelBuilder.Entity("TNO.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AccountType") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("account_type"); + + b.Property("Code") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(10) + .HasColumnType("character varying(10)") + .HasColumnName("code") + .HasDefaultValueSql("''"); + + b.Property("CodeCreatedOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("code_created_on"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("DisplayName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("display_name") + .HasDefaultValueSql("''"); + + b.Property("Email") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("email") + .HasDefaultValueSql("''"); + + b.Property("EmailVerified") + .HasColumnType("boolean") + .HasColumnName("email_verified"); + + b.Property("FirstName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("first_name") + .HasDefaultValueSql("''"); + + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("is_enabled"); + + b.Property("IsSystemAccount") + .HasColumnType("boolean") + .HasColumnName("is_system_account"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("key"); + + b.Property("LastLoginOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("last_login_on"); + + b.Property("LastName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("last_name") + .HasDefaultValueSql("''"); + + b.Property("Note") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("note") + .HasDefaultValueSql("''"); + + b.Property("Preferences") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("preferences") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("PreferredEmail") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("preferred_email") + .HasDefaultValueSql("''"); + + b.Property("Roles") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("roles") + .HasDefaultValueSql("''"); + + b.Property("Status") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("status"); + + b.Property("UniqueLogins") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("unique_logins") + .HasDefaultValueSql("0"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("username"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("Id"); + + b.HasIndex(new[] { "Email" }, "IX_email"); + + b.HasIndex(new[] { "Key" }, "IX_key") + .IsUnique(); + + b.HasIndex(new[] { "LastName", "FirstName" }, "IX_last_first_name"); + + b.HasIndex(new[] { "Username" }, "IX_username") + .IsUnique(); + + b.ToTable("user"); + }); + + modelBuilder.Entity("TNO.Entities.UserAVOverview", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("TemplateType") + .HasColumnType("integer") + .HasColumnName("av_overview_template_type"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("IsSubscribed") + .HasColumnType("boolean") + .HasColumnName("is_subscribed"); + + b.Property("SendTo") + .HasColumnType("integer") + .HasColumnName("send_to"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "TemplateType"); + + b.HasIndex("TemplateType"); + + b.ToTable("user_av_overview"); + }); + + modelBuilder.Entity("TNO.Entities.UserAVOverviewInstance", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("InstanceId") + .HasColumnType("bigint") + .HasColumnName("report_instance_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Response") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("response") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("SentOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("sent_on"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "InstanceId"); + + b.HasIndex("InstanceId"); + + b.ToTable("user_av_overview_instance"); + }); + + modelBuilder.Entity("TNO.Entities.UserColleague", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("ColleagueId") + .HasColumnType("integer") + .HasColumnName("colleague_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "ColleagueId"); + + b.HasIndex("ColleagueId"); + + b.ToTable("user_colleague"); + }); + + modelBuilder.Entity("TNO.Entities.UserContentNotification", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("IsSubscribed") + .HasColumnType("boolean") + .HasColumnName("is_subscribed"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "ContentId"); + + b.HasIndex("ContentId"); + + b.ToTable("user_content_notification"); + }); + + modelBuilder.Entity("TNO.Entities.UserDistribution", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("LinkedUserId") + .HasColumnType("integer") + .HasColumnName("linked_user_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "LinkedUserId"); + + b.HasIndex("LinkedUserId"); + + b.ToTable("user_distribution"); + }); + + modelBuilder.Entity("TNO.Entities.UserMediaType", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("MediaTypeId") + .HasColumnType("integer") + .HasColumnName("media_type_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "MediaTypeId"); + + b.HasIndex("MediaTypeId"); + + b.ToTable("user_media_type"); + }); + + modelBuilder.Entity("TNO.Entities.UserNotification", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("NotificationId") + .HasColumnType("integer") + .HasColumnName("notification_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("IsSubscribed") + .HasColumnType("boolean") + .HasColumnName("is_subscribed"); + + b.Property("Resend") + .HasColumnType("integer") + .HasColumnName("resend"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "NotificationId"); + + b.HasIndex("NotificationId"); + + b.ToTable("user_notification"); + }); + + modelBuilder.Entity("TNO.Entities.UserOrganization", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("OrganizationId") + .HasColumnType("integer") + .HasColumnName("organization_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "OrganizationId"); + + b.HasIndex("OrganizationId"); + + b.ToTable("user_organization"); + }); + + modelBuilder.Entity("TNO.Entities.UserProduct", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("ProductId") + .HasColumnType("integer") + .HasColumnName("product_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "ProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("user_product"); + }); + + modelBuilder.Entity("TNO.Entities.UserReport", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("ReportId") + .HasColumnType("integer") + .HasColumnName("report_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Format") + .HasColumnType("integer") + .HasColumnName("format"); + + b.Property("IsSubscribed") + .HasColumnType("boolean") + .HasColumnName("is_subscribed"); + + b.Property("SendTo") + .HasColumnType("integer") + .HasColumnName("send_to"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "ReportId"); + + b.HasIndex("ReportId"); + + b.ToTable("user_report"); + }); + + modelBuilder.Entity("TNO.Entities.UserReportInstance", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("InstanceId") + .HasColumnType("bigint") + .HasColumnName("report_instance_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("LinkResponse") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("link_response") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("LinkSentOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("link_sent_on"); + + b.Property("LinkStatus") + .HasColumnType("integer") + .HasColumnName("link_status"); + + b.Property("TextResponse") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("text_response") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("TextSentOn") + .HasColumnType("timestamp with time zone") + .HasColumnName("text_sent_on"); + + b.Property("TextStatus") + .HasColumnType("integer") + .HasColumnName("text_status"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "InstanceId"); + + b.HasIndex("InstanceId"); + + b.ToTable("user_report_instance"); + }); + + modelBuilder.Entity("TNO.Entities.UserSource", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("user_id"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.HasKey("UserId", "SourceId"); + + b.HasIndex("SourceId"); + + b.ToTable("user_source"); + }); + + modelBuilder.Entity("TNO.Entities.WorkOrder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AssignedId") + .HasColumnType("integer") + .HasColumnName("assigned_id"); + + b.Property("Configuration") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("jsonb") + .HasColumnName("configuration") + .HasDefaultValueSql("'{}'::jsonb"); + + b.Property("ContentId") + .HasColumnType("bigint") + .HasColumnName("content_id"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("created_by"); + + b.Property("CreatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("created_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("character varying(500)") + .HasColumnName("description"); + + b.Property("Note") + .IsRequired() + .HasColumnType("text") + .HasColumnName("note"); + + b.Property("RequestorId") + .HasColumnType("integer") + .HasColumnName("requestor_id"); + + b.Property("Status") + .HasColumnType("integer") + .HasColumnName("status"); + + b.Property("UpdatedBy") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)") + .HasColumnName("updated_by"); + + b.Property("UpdatedOn") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_on") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("version") + .HasDefaultValueSql("0"); + + b.Property("WorkType") + .HasColumnType("integer") + .HasColumnName("work_type"); + + b.HasKey("Id"); + + b.HasIndex("AssignedId"); + + b.HasIndex("ContentId"); + + b.HasIndex("RequestorId"); + + b.HasIndex(new[] { "WorkType", "Status", "CreatedOn", "RequestorId", "AssignedId" }, "IX_work_order"); + + b.ToTable("work_order"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewInstance", b => + { + b.HasOne("TNO.Entities.AVOverviewTemplate", "Template") + .WithMany("Instances") + .HasForeignKey("TemplateType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewSection", b => + { + b.HasOne("TNO.Entities.AVOverviewInstance", "Instance") + .WithMany("Sections") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Series", "Series") + .WithMany() + .HasForeignKey("SeriesId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Source", "Source") + .WithMany() + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Instance"); + + b.Navigation("Series"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewSectionItem", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany() + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.AVOverviewSection", "Section") + .WithMany("Items") + .HasForeignKey("SectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("Section"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplate", b => + { + b.HasOne("TNO.Entities.ReportTemplate", "Template") + .WithMany() + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplateSection", b => + { + b.HasOne("TNO.Entities.Series", "Series") + .WithMany() + .HasForeignKey("SeriesId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Source", "Source") + .WithMany() + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.AVOverviewTemplate", "Template") + .WithMany("Sections") + .HasForeignKey("TemplateType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Series"); + + b.Navigation("Source"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplateSectionItem", b => + { + b.HasOne("TNO.Entities.AVOverviewTemplateSection", "Section") + .WithMany("Items") + .HasForeignKey("SectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Section"); + }); + + modelBuilder.Entity("TNO.Entities.Content", b => + { + b.HasOne("TNO.Entities.Contributor", "Contributor") + .WithMany("Contents") + .HasForeignKey("ContributorId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.IngestType", null) + .WithMany("Contents") + .HasForeignKey("IngestTypeId"); + + b.HasOne("TNO.Entities.License", "License") + .WithMany("Contents") + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.MediaType", "MediaType") + .WithMany("Contents") + .HasForeignKey("MediaTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "Owner") + .WithMany("Contents") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("TNO.Entities.Series", "Series") + .WithMany("Contents") + .HasForeignKey("SeriesId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("Contents") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Contributor"); + + b.Navigation("License"); + + b.Navigation("MediaType"); + + b.Navigation("Owner"); + + b.Navigation("Series"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.ContentAction", b => + { + b.HasOne("TNO.Entities.Action", "Action") + .WithMany("ContentsManyToMany") + .HasForeignKey("ActionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("ActionsManyToMany") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Action"); + + b.Navigation("Content"); + }); + + modelBuilder.Entity("TNO.Entities.ContentLabel", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("Labels") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + }); + + modelBuilder.Entity("TNO.Entities.ContentLink", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("Links") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Content", "Link") + .WithMany() + .HasForeignKey("LinkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("Link"); + }); + + modelBuilder.Entity("TNO.Entities.ContentLog", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("Logs") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTag", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("TagsManyToMany") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Tag", "Tag") + .WithMany("ContentsManyToMany") + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("Tag"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTonePool", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("TonePoolsManyToMany") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.TonePool", "TonePool") + .WithMany("ContentsManyToMany") + .HasForeignKey("TonePoolId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("TonePool"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTopic", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("TopicsManyToMany") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Topic", "Topic") + .WithMany("ContentsManyToMany") + .HasForeignKey("TopicId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("Topic"); + }); + + modelBuilder.Entity("TNO.Entities.ContentTypeAction", b => + { + b.HasOne("TNO.Entities.Action", "Action") + .WithMany("ContentTypes") + .HasForeignKey("ActionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Action"); + }); + + modelBuilder.Entity("TNO.Entities.Contributor", b => + { + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("Contributors") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.DataLocation", b => + { + b.HasOne("TNO.Entities.Connection", "Connection") + .WithMany("DataLocations") + .HasForeignKey("ConnectionId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Connection"); + }); + + modelBuilder.Entity("TNO.Entities.EarnedMedia", b => + { + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("EarnedMedia") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.EventSchedule", b => + { + b.HasOne("TNO.Entities.Folder", "Folder") + .WithMany("Events") + .HasForeignKey("FolderId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Notification", "Notification") + .WithMany("Schedules") + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Report", "Report") + .WithMany("Events") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Schedule", "Schedule") + .WithMany("Events") + .HasForeignKey("ScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Folder"); + + b.Navigation("Notification"); + + b.Navigation("Report"); + + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("TNO.Entities.FileReference", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("FileReferences") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + }); + + modelBuilder.Entity("TNO.Entities.Filter", b => + { + b.HasOne("TNO.Entities.User", "Owner") + .WithMany("Filters") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("TNO.Entities.Folder", b => + { + b.HasOne("TNO.Entities.Filter", "Filter") + .WithMany("Folders") + .HasForeignKey("FilterId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.User", "Owner") + .WithMany("Folders") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Filter"); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("TNO.Entities.FolderContent", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("FoldersManyToMany") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Folder", "Folder") + .WithMany("ContentManyToMany") + .HasForeignKey("FolderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("Folder"); + }); + + modelBuilder.Entity("TNO.Entities.Ingest", b => + { + b.HasOne("TNO.Entities.Connection", "DestinationConnection") + .WithMany("DestinationIngests") + .HasForeignKey("DestinationConnectionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("TNO.Entities.IngestType", "IngestType") + .WithMany("Ingests") + .HasForeignKey("IngestTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("TNO.Entities.MediaType", "MediaType") + .WithMany("Ingests") + .HasForeignKey("MediaTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("TNO.Entities.Connection", "SourceConnection") + .WithMany("SourceIngests") + .HasForeignKey("SourceConnectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("Ingests") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("DestinationConnection"); + + b.Navigation("IngestType"); + + b.Navigation("MediaType"); + + b.Navigation("Source"); + + b.Navigation("SourceConnection"); + }); + + modelBuilder.Entity("TNO.Entities.IngestDataLocation", b => + { + b.HasOne("TNO.Entities.DataLocation", "DataLocation") + .WithMany("IngestsManyToMany") + .HasForeignKey("DataLocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Ingest", "Ingest") + .WithMany("DataLocationsManyToMany") + .HasForeignKey("IngestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DataLocation"); + + b.Navigation("Ingest"); + }); + + modelBuilder.Entity("TNO.Entities.IngestSchedule", b => + { + b.HasOne("TNO.Entities.Ingest", "Ingest") + .WithMany("SchedulesManyToMany") + .HasForeignKey("IngestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Schedule", "Schedule") + .WithMany("IngestsManyToMany") + .HasForeignKey("ScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ingest"); + + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("TNO.Entities.IngestState", b => + { + b.HasOne("TNO.Entities.Ingest", "Ingest") + .WithOne("State") + .HasForeignKey("TNO.Entities.IngestState", "IngestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ingest"); + }); + + modelBuilder.Entity("TNO.Entities.Minister", b => + { + b.HasOne("TNO.Entities.Organization", "Organization") + .WithMany("Ministers") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("TNO.Entities.Notification", b => + { + b.HasOne("TNO.Entities.User", "Owner") + .WithMany("Notifications") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.NotificationTemplate", "Template") + .WithMany("Notifications") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("TNO.Entities.NotificationInstance", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("NotificationsManyToMany") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Notification", "Notification") + .WithMany("Instances") + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("Notification"); + }); + + modelBuilder.Entity("TNO.Entities.Organization", b => + { + b.HasOne("TNO.Entities.Organization", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("TNO.Entities.Quote", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("Quotes") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + }); + + modelBuilder.Entity("TNO.Entities.Report", b => + { + b.HasOne("TNO.Entities.User", "Owner") + .WithMany("Reports") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.ReportTemplate", "Template") + .WithMany("Reports") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("TNO.Entities.ReportInstance", b => + { + b.HasOne("TNO.Entities.User", "Owner") + .WithMany("ReportInstances") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Report", "Report") + .WithMany("Instances") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + + b.Navigation("Report"); + }); + + modelBuilder.Entity("TNO.Entities.ReportInstanceContent", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("ReportsManyToMany") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.ReportInstance", "Instance") + .WithMany("ContentManyToMany") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("Instance"); + }); + + modelBuilder.Entity("TNO.Entities.ReportSection", b => + { + b.HasOne("TNO.Entities.Filter", "Filter") + .WithMany("ReportSections") + .HasForeignKey("FilterId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Folder", "Folder") + .WithMany("ReportSections") + .HasForeignKey("FolderId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Report", "LinkedReport") + .WithMany() + .HasForeignKey("LinkedReportId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Report", "Report") + .WithMany("Sections") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Filter"); + + b.Navigation("Folder"); + + b.Navigation("LinkedReport"); + + b.Navigation("Report"); + }); + + modelBuilder.Entity("TNO.Entities.ReportSectionChartTemplate", b => + { + b.HasOne("TNO.Entities.ChartTemplate", "ChartTemplate") + .WithMany("ReportSectionsManyToMany") + .HasForeignKey("ChartTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.ReportSection", "ReportSection") + .WithMany("ChartTemplatesManyToMany") + .HasForeignKey("ReportSectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChartTemplate"); + + b.Navigation("ReportSection"); + }); + + modelBuilder.Entity("TNO.Entities.ReportTemplateChartTemplate", b => + { + b.HasOne("TNO.Entities.ChartTemplate", "ChartTemplate") + .WithMany("ReportTemplatesManyToMany") + .HasForeignKey("ChartTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.ReportTemplate", "ReportTemplate") + .WithMany("ChartTemplatesManyToMany") + .HasForeignKey("ReportTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChartTemplate"); + + b.Navigation("ReportTemplate"); + }); + + modelBuilder.Entity("TNO.Entities.Schedule", b => + { + b.HasOne("TNO.Entities.User", "RequestedBy") + .WithMany() + .HasForeignKey("RequestedById") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("RequestedBy"); + }); + + modelBuilder.Entity("TNO.Entities.Series", b => + { + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("Series") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.SeriesMediaTypeSearchMapping", b => + { + b.HasOne("TNO.Entities.MediaType", "MediaType") + .WithMany("SeriesSearchMappingsManyToMany") + .HasForeignKey("MediaTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Series", "Series") + .WithMany("MediaTypeSearchMappingsManyToMany") + .HasForeignKey("SeriesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaType"); + + b.Navigation("Series"); + }); + + modelBuilder.Entity("TNO.Entities.Source", b => + { + b.HasOne("TNO.Entities.License", "License") + .WithMany("Sources") + .HasForeignKey("LicenseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("TNO.Entities.MediaType", "MediaType") + .WithMany("Sources") + .HasForeignKey("MediaTypeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("TNO.Entities.User", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("License"); + + b.Navigation("MediaType"); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("TNO.Entities.SourceMediaTypeSearchMapping", b => + { + b.HasOne("TNO.Entities.MediaType", "MediaType") + .WithMany("SourceSearchMappingsManyToMany") + .HasForeignKey("MediaTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("MediaTypeSearchMappingsManyToMany") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaType"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.SourceMetric", b => + { + b.HasOne("TNO.Entities.Metric", "Metric") + .WithMany("SourcesManyToMany") + .HasForeignKey("MetricId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("MetricsManyToMany") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Metric"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.TimeTracking", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("TimeTrackings") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("TimeTrackings") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.TonePool", b => + { + b.HasOne("TNO.Entities.User", "Owner") + .WithMany("TonePools") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("TNO.Entities.TopicScoreRule", b => + { + b.HasOne("TNO.Entities.Series", "Series") + .WithMany("ScoreRules") + .HasForeignKey("SeriesId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("ScoreRules") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Series"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("TNO.Entities.UserAVOverview", b => + { + b.HasOne("TNO.Entities.AVOverviewTemplate", "Template") + .WithMany("SubscribersManyToMany") + .HasForeignKey("TemplateType") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("AVOverviewSubscriptionsManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserAVOverviewInstance", b => + { + b.HasOne("TNO.Entities.AVOverviewInstance", "Instance") + .WithMany("UserInstances") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Instance"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserColleague", b => + { + b.HasOne("TNO.Entities.User", "Colleague") + .WithMany() + .HasForeignKey("ColleagueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("ColleaguesManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Colleague"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserContentNotification", b => + { + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("UserNotifications") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("ContentNotifications") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Content"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserDistribution", b => + { + b.HasOne("TNO.Entities.User", "LinkedUser") + .WithMany() + .HasForeignKey("LinkedUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("Distribution") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedUser"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserMediaType", b => + { + b.HasOne("TNO.Entities.MediaType", "MediaType") + .WithMany("UsersManyToMany") + .HasForeignKey("MediaTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("MediaTypesManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaType"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserNotification", b => + { + b.HasOne("TNO.Entities.Notification", "Notification") + .WithMany("SubscribersManyToMany") + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("NotificationSubscriptionsManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Notification"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserOrganization", b => + { + b.HasOne("TNO.Entities.Organization", "Organization") + .WithMany("UsersManyToMany") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("OrganizationsManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserProduct", b => + { + b.HasOne("TNO.Entities.Product", "Product") + .WithMany("SubscribersManyToMany") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("ProductSubscriptionsManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserReport", b => + { + b.HasOne("TNO.Entities.Report", "Report") + .WithMany("SubscribersManyToMany") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("ReportSubscriptionsManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Report"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserReportInstance", b => + { + b.HasOne("TNO.Entities.ReportInstance", "Instance") + .WithMany("UserInstances") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Instance"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.UserSource", b => + { + b.HasOne("TNO.Entities.Source", "Source") + .WithMany("UsersManyToMany") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("TNO.Entities.User", "User") + .WithMany("SourcesManyToMany") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Source"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("TNO.Entities.WorkOrder", b => + { + b.HasOne("TNO.Entities.User", "Assigned") + .WithMany("WorkOrdersAssigned") + .HasForeignKey("AssignedId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("TNO.Entities.Content", "Content") + .WithMany("WorkOrders") + .HasForeignKey("ContentId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("TNO.Entities.User", "Requestor") + .WithMany("WorkOrderRequests") + .HasForeignKey("RequestorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Assigned"); + + b.Navigation("Content"); + + b.Navigation("Requestor"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewInstance", b => + { + b.Navigation("Sections"); + + b.Navigation("UserInstances"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewSection", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplate", b => + { + b.Navigation("Instances"); + + b.Navigation("Sections"); + + b.Navigation("SubscribersManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.AVOverviewTemplateSection", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("TNO.Entities.Action", b => + { + b.Navigation("ContentTypes"); + + b.Navigation("ContentsManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.ChartTemplate", b => + { + b.Navigation("ReportSectionsManyToMany"); + + b.Navigation("ReportTemplatesManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Connection", b => + { + b.Navigation("DataLocations"); + + b.Navigation("DestinationIngests"); + + b.Navigation("SourceIngests"); + }); + + modelBuilder.Entity("TNO.Entities.Content", b => + { + b.Navigation("ActionsManyToMany"); + + b.Navigation("FileReferences"); + + b.Navigation("FoldersManyToMany"); + + b.Navigation("Labels"); + + b.Navigation("Links"); + + b.Navigation("Logs"); + + b.Navigation("NotificationsManyToMany"); + + b.Navigation("Quotes"); + + b.Navigation("ReportsManyToMany"); + + b.Navigation("TagsManyToMany"); + + b.Navigation("TimeTrackings"); + + b.Navigation("TonePoolsManyToMany"); + + b.Navigation("TopicsManyToMany"); + + b.Navigation("UserNotifications"); + + b.Navigation("WorkOrders"); + }); + + modelBuilder.Entity("TNO.Entities.Contributor", b => + { + b.Navigation("Contents"); + }); + + modelBuilder.Entity("TNO.Entities.DataLocation", b => + { + b.Navigation("IngestsManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Filter", b => + { + b.Navigation("Folders"); + + b.Navigation("ReportSections"); + }); + + modelBuilder.Entity("TNO.Entities.Folder", b => + { + b.Navigation("ContentManyToMany"); + + b.Navigation("Events"); + + b.Navigation("ReportSections"); + }); + + modelBuilder.Entity("TNO.Entities.Ingest", b => + { + b.Navigation("DataLocationsManyToMany"); + + b.Navigation("SchedulesManyToMany"); + + b.Navigation("State"); + }); + + modelBuilder.Entity("TNO.Entities.IngestType", b => + { + b.Navigation("Contents"); + + b.Navigation("Ingests"); + }); + + modelBuilder.Entity("TNO.Entities.License", b => + { + b.Navigation("Contents"); + + b.Navigation("Sources"); + }); + + modelBuilder.Entity("TNO.Entities.MediaType", b => + { + b.Navigation("Contents"); + + b.Navigation("Ingests"); + + b.Navigation("SeriesSearchMappingsManyToMany"); + + b.Navigation("SourceSearchMappingsManyToMany"); + + b.Navigation("Sources"); + + b.Navigation("UsersManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Metric", b => + { + b.Navigation("SourcesManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Notification", b => + { + b.Navigation("Instances"); + + b.Navigation("Schedules"); + + b.Navigation("SubscribersManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.NotificationTemplate", b => + { + b.Navigation("Notifications"); + }); + + modelBuilder.Entity("TNO.Entities.Organization", b => + { + b.Navigation("Children"); + + b.Navigation("Ministers"); + + b.Navigation("UsersManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Product", b => + { + b.Navigation("SubscribersManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Report", b => + { + b.Navigation("Events"); + + b.Navigation("Instances"); + + b.Navigation("Sections"); + + b.Navigation("SubscribersManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.ReportInstance", b => + { + b.Navigation("ContentManyToMany"); + + b.Navigation("UserInstances"); + }); + + modelBuilder.Entity("TNO.Entities.ReportSection", b => + { + b.Navigation("ChartTemplatesManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.ReportTemplate", b => + { + b.Navigation("ChartTemplatesManyToMany"); + + b.Navigation("Reports"); + }); + + modelBuilder.Entity("TNO.Entities.Schedule", b => + { + b.Navigation("Events"); + + b.Navigation("IngestsManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Series", b => + { + b.Navigation("Contents"); + + b.Navigation("MediaTypeSearchMappingsManyToMany"); + + b.Navigation("ScoreRules"); + }); + + modelBuilder.Entity("TNO.Entities.Source", b => + { + b.Navigation("Contents"); + + b.Navigation("Contributors"); + + b.Navigation("EarnedMedia"); + + b.Navigation("Ingests"); + + b.Navigation("MediaTypeSearchMappingsManyToMany"); + + b.Navigation("MetricsManyToMany"); + + b.Navigation("ScoreRules"); + + b.Navigation("Series"); + + b.Navigation("UsersManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Tag", b => + { + b.Navigation("ContentsManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.TonePool", b => + { + b.Navigation("ContentsManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.Topic", b => + { + b.Navigation("ContentsManyToMany"); + }); + + modelBuilder.Entity("TNO.Entities.User", b => + { + b.Navigation("AVOverviewSubscriptionsManyToMany"); + + b.Navigation("ColleaguesManyToMany"); + + b.Navigation("ContentNotifications"); + + b.Navigation("Contents"); + + b.Navigation("Distribution"); + + b.Navigation("Filters"); + + b.Navigation("Folders"); + + b.Navigation("MediaTypesManyToMany"); + + b.Navigation("NotificationSubscriptionsManyToMany"); + + b.Navigation("Notifications"); + + b.Navigation("OrganizationsManyToMany"); + + b.Navigation("ProductSubscriptionsManyToMany"); + + b.Navigation("ReportInstances"); + + b.Navigation("ReportSubscriptionsManyToMany"); + + b.Navigation("Reports"); + + b.Navigation("SourcesManyToMany"); + + b.Navigation("TimeTrackings"); + + b.Navigation("TonePools"); + + b.Navigation("WorkOrderRequests"); + + b.Navigation("WorkOrdersAssigned"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/libs/net/dal/Migrations/20241129161926_1.3.8.cs b/libs/net/dal/Migrations/20241129161926_1.3.8.cs new file mode 100644 index 0000000000..14ca5eb377 --- /dev/null +++ b/libs/net/dal/Migrations/20241129161926_1.3.8.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace TNO.DAL.Migrations +{ + /// + public partial class _138 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "is_cbra_source", + table: "source", + type: "boolean", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "is_cbra_source", + table: "series", + type: "boolean", + nullable: false, + defaultValue: false); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "is_cbra_source", + table: "source"); + + migrationBuilder.DropColumn( + name: "is_cbra_source", + table: "series"); + } + } +} diff --git a/libs/net/dal/Migrations/TNOContextModelSnapshot.cs b/libs/net/dal/Migrations/TNOContextModelSnapshot.cs index b65f6f13bd..10f68f74ba 100644 --- a/libs/net/dal/Migrations/TNOContextModelSnapshot.cs +++ b/libs/net/dal/Migrations/TNOContextModelSnapshot.cs @@ -20,7 +20,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.20") + .HasAnnotation("ProductVersion", "9.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -4148,6 +4148,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnName("description") .HasDefaultValueSql("''"); + b.Property("IsCBRASource") + .HasColumnType("boolean") + .HasColumnName("is_cbra_source"); + b.Property("IsEnabled") .HasColumnType("boolean") .HasColumnName("is_enabled"); @@ -4384,6 +4388,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("boolean") .HasColumnName("disable_transcribe"); + b.Property("IsCBRASource") + .HasColumnType("boolean") + .HasColumnName("is_cbra_source"); + b.Property("IsEnabled") .HasColumnType("boolean") .HasColumnName("is_enabled"); diff --git a/libs/net/entities/Series.cs b/libs/net/entities/Series.cs index dd2987ad43..dea34b4d97 100644 --- a/libs/net/entities/Series.cs +++ b/libs/net/entities/Series.cs @@ -34,6 +34,12 @@ public class Series : BaseType [Column("use_in_topics")] public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + [Column("is_cbra_source")] + public bool IsCBRASource { get; set; } + /// /// get/set - Is a secondary source - generally added via use of "Other" field. /// Will not be displayed in the primary Series/Source dropdown or in search filters diff --git a/libs/net/entities/Source.cs b/libs/net/entities/Source.cs index b7a63fb0ba..cba4d6c264 100644 --- a/libs/net/entities/Source.cs +++ b/libs/net/entities/Source.cs @@ -90,6 +90,12 @@ public class Source : BaseType /// [Column("configuration")] public JsonDocument Configuration { get; set; } = JsonDocument.Parse("{}"); + + /// + /// get/set - is CBRA source or not. + /// + [Column("is_cbra_source")] + public bool IsCBRASource { get; set; } /// /// get - List of content linked to this source. diff --git a/libs/net/models/Areas/Admin/Series/SeriesModel.cs b/libs/net/models/Areas/Admin/Series/SeriesModel.cs index a3f63a001a..38eb338ff6 100644 --- a/libs/net/models/Areas/Admin/Series/SeriesModel.cs +++ b/libs/net/models/Areas/Admin/Series/SeriesModel.cs @@ -63,6 +63,11 @@ public class SeriesModel : AuditColumnsModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - Is a secondary source - generally added via use of "Other" field. /// Will not be displayed in the primary Series/Source dropdown or in search filters @@ -93,6 +98,7 @@ public SeriesModel(Entities.Series entity) : base(entity) this.UseInTopics = entity.UseInTopics; this.IsOther = entity.IsOther; this.MediaTypeSearchMappings = entity.MediaTypeSearchMappingsManyToMany.Select(m => new MediaTypeModel(m.MediaType!)); + this.IsCBRASource = entity.IsCBRASource; } #endregion @@ -113,6 +119,7 @@ public static explicit operator Entities.Series(SeriesModel model) UseInTopics = model.UseInTopics, IsOther = model.IsOther, Version = model.Version ?? 0, + IsCBRASource = model.IsCBRASource }; entity.MediaTypeSearchMappingsManyToMany.AddRange(model.MediaTypeSearchMappings.Select(s => new Entities.SeriesMediaTypeSearchMapping(model.Id, s.Id))); return entity; diff --git a/libs/net/models/Areas/Admin/Series/SourceModel.cs b/libs/net/models/Areas/Admin/Series/SourceModel.cs index 0242a9bba5..bb392cdb1d 100644 --- a/libs/net/models/Areas/Admin/Series/SourceModel.cs +++ b/libs/net/models/Areas/Admin/Series/SourceModel.cs @@ -65,6 +65,11 @@ public class SourceModel /// get/set - Whether to show the topics on the content form. /// public bool UseInTopics { get; set; } + + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } #endregion #region Constructors @@ -91,6 +96,7 @@ public SourceModel(Entities.Source entity) this.AutoTranscribe = entity.AutoTranscribe; this.DisableTranscribe = entity.DisableTranscribe; this.UseInTopics = entity.UseInTopics; + this.IsCBRASource = entity.IsCBRASource; } #endregion } diff --git a/libs/net/models/Areas/Admin/Source/SourceModel.cs b/libs/net/models/Areas/Admin/Source/SourceModel.cs index 49f1a935db..e8ee8c8186 100644 --- a/libs/net/models/Areas/Admin/Source/SourceModel.cs +++ b/libs/net/models/Areas/Admin/Source/SourceModel.cs @@ -69,6 +69,11 @@ public class SourceModel : BaseTypeWithAuditColumnsModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - /// @@ -109,7 +114,8 @@ public SourceModel(Entities.Source entity, JsonSerializerOptions options) : base this.AutoTranscribe = entity.AutoTranscribe; this.DisableTranscribe = entity.DisableTranscribe; this.UseInTopics = entity.UseInTopics; - this.Configuration = JsonSerializer.Deserialize>(entity.Configuration, options) ?? new Dictionary(); + this.Configuration = JsonSerializer.Deserialize>(entity.Configuration, options) ?? new Dictionary(); + this.IsCBRASource = entity.IsCBRASource; this.Metrics = entity.MetricsManyToMany.Select(m => new SourceMetricModel(m)); this.MediaTypeSearchMappings = entity.MediaTypeSearchMappingsManyToMany.Select(m => new MediaTypeModel(m.MediaType!)); @@ -147,7 +153,8 @@ public static explicit operator Entities.Source(SourceModel model) DisableTranscribe = model.DisableTranscribe, UseInTopics = model.UseInTopics, Configuration = JsonDocument.Parse(JsonSerializer.Serialize(model.Configuration)), - Version = model.Version ?? 0 + Version = model.Version ?? 0, + IsCBRASource = model.IsCBRASource }; entity.MetricsManyToMany.AddRange(model.Metrics.Select(m => m.ToEntity(entity.Id))); diff --git a/libs/net/models/Areas/Editor/Models/Content/SeriesModel.cs b/libs/net/models/Areas/Editor/Models/Content/SeriesModel.cs index 0fa74ccbde..6e0cfb01ab 100644 --- a/libs/net/models/Areas/Editor/Models/Content/SeriesModel.cs +++ b/libs/net/models/Areas/Editor/Models/Content/SeriesModel.cs @@ -17,6 +17,11 @@ public class SeriesModel : BaseTypeModel /// get/set - Whether to show the topics on the content form. /// public bool UseInTopics { get; set; } + + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } #endregion #region Constructors @@ -33,6 +38,7 @@ public SeriesModel(Entities.Series entity) : base(entity) { this.SourceId = entity.SourceId; this.UseInTopics = entity.UseInTopics; + this.IsCBRASource = entity.IsCBRASource; } #endregion } diff --git a/libs/net/models/Areas/Editor/Models/Content/SourceModel.cs b/libs/net/models/Areas/Editor/Models/Content/SourceModel.cs index 23f4a55b55..b58f350912 100644 --- a/libs/net/models/Areas/Editor/Models/Content/SourceModel.cs +++ b/libs/net/models/Areas/Editor/Models/Content/SourceModel.cs @@ -51,6 +51,11 @@ public class SourceModel : BaseTypeModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - /// @@ -82,7 +87,8 @@ public SourceModel(Entities.Source entity) : base(entity) this.AutoTranscribe = entity.AutoTranscribe; this.DisableTranscribe = entity.DisableTranscribe; this.UseInTopics = entity.UseInTopics; - this.Configuration = JsonSerializer.Deserialize>(entity.Configuration) ?? new Dictionary(); + this.Configuration = JsonSerializer.Deserialize>(entity.Configuration) ?? new Dictionary(); + this.IsCBRASource = entity.IsCBRASource; } #endregion @@ -105,7 +111,8 @@ public static explicit operator Entities.Source(SourceModel model) AutoTranscribe = model.AutoTranscribe, DisableTranscribe = model.DisableTranscribe, UseInTopics = model.UseInTopics, - Configuration = JsonDocument.Parse(JsonSerializer.Serialize(model.Configuration)) + Configuration = JsonDocument.Parse(JsonSerializer.Serialize(model.Configuration)), + IsCBRASource = model.IsCBRASource }; } #endregion diff --git a/libs/net/models/Areas/Editor/Models/Series/SeriesModel.cs b/libs/net/models/Areas/Editor/Models/Series/SeriesModel.cs index 8bde8725ec..ae03956dc5 100644 --- a/libs/net/models/Areas/Editor/Models/Series/SeriesModel.cs +++ b/libs/net/models/Areas/Editor/Models/Series/SeriesModel.cs @@ -18,6 +18,11 @@ public class SeriesModel : BaseTypeModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - Is a secondary source - generally added via use of "Other" field. /// Will not be displayed in the primary Series/Source dropdown or in search filters @@ -40,6 +45,7 @@ public SeriesModel(Entities.Series entity) : base(entity) this.SourceId = entity.SourceId; this.UseInTopics = entity.UseInTopics; this.IsOther = entity.IsOther; + this.IsCBRASource = entity.IsCBRASource; } #endregion } diff --git a/libs/net/models/Areas/Editor/Models/Source/SourceModel.cs b/libs/net/models/Areas/Editor/Models/Source/SourceModel.cs index 879dbe3c5e..815a9f37c2 100644 --- a/libs/net/models/Areas/Editor/Models/Source/SourceModel.cs +++ b/libs/net/models/Areas/Editor/Models/Source/SourceModel.cs @@ -88,6 +88,11 @@ public class SourceModel /// get/set - /// public Dictionary Configuration { get; set; } = new Dictionary(); + + /// + /// get/set - + /// + public bool IsCBRASource { get; set; } #endregion #region Constructors @@ -119,6 +124,7 @@ public SourceModel(Entities.Source entity, JsonSerializerOptions options) this.DisableTranscribe = entity.DisableTranscribe; this.UseInTopics = entity.UseInTopics; this.Configuration = JsonSerializer.Deserialize>(entity.Configuration, options) ?? new Dictionary(); + this.IsCBRASource = entity.IsCBRASource; } #endregion } diff --git a/libs/net/models/Areas/Services/Models/Content/SeriesModel.cs b/libs/net/models/Areas/Services/Models/Content/SeriesModel.cs index 6733e712d6..ac9bd105a8 100644 --- a/libs/net/models/Areas/Services/Models/Content/SeriesModel.cs +++ b/libs/net/models/Areas/Services/Models/Content/SeriesModel.cs @@ -18,6 +18,11 @@ public class SeriesModel : BaseTypeModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - Whether this is an 'other' series. /// @@ -39,6 +44,7 @@ public SeriesModel(Entities.Series entity) : base(entity) this.SourceId = entity.SourceId; this.UseInTopics = entity.UseInTopics; this.IsOther = entity.IsOther; + this.IsCBRASource = entity.IsCBRASource; } #endregion @@ -57,6 +63,7 @@ public static explicit operator Entities.Series(SeriesModel model) SortOrder = model.SortOrder, IsOther = model.IsOther, UseInTopics = model.UseInTopics, + IsCBRASource = model.IsCBRASource }; } #endregion diff --git a/libs/net/models/Areas/Services/Models/Content/SourceModel.cs b/libs/net/models/Areas/Services/Models/Content/SourceModel.cs index 8a562b4ecb..12fbda0742 100644 --- a/libs/net/models/Areas/Services/Models/Content/SourceModel.cs +++ b/libs/net/models/Areas/Services/Models/Content/SourceModel.cs @@ -51,6 +51,11 @@ public class SourceModel : BaseTypeModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - /// @@ -82,7 +87,8 @@ public SourceModel(Entities.Source entity) : base(entity) this.AutoTranscribe = entity.AutoTranscribe; this.DisableTranscribe = entity.DisableTranscribe; this.UseInTopics = entity.UseInTopics; - this.Configuration = JsonSerializer.Deserialize>(entity.Configuration) ?? new Dictionary(); + this.Configuration = JsonSerializer.Deserialize>(entity.Configuration) ?? new Dictionary(); + this.IsCBRASource = entity.IsCBRASource; } #endregion @@ -105,7 +111,8 @@ public static explicit operator Entities.Source(SourceModel model) AutoTranscribe = model.AutoTranscribe, DisableTranscribe = model.DisableTranscribe, UseInTopics = model.UseInTopics, - Configuration = JsonDocument.Parse(JsonSerializer.Serialize(model.Configuration)) + Configuration = JsonDocument.Parse(JsonSerializer.Serialize(model.Configuration)), + IsCBRASource = model.IsCBRASource }; } #endregion diff --git a/libs/net/models/Areas/Subscriber/Models/Content/SeriesModel.cs b/libs/net/models/Areas/Subscriber/Models/Content/SeriesModel.cs index 97f069ad15..00b02c0f8c 100644 --- a/libs/net/models/Areas/Subscriber/Models/Content/SeriesModel.cs +++ b/libs/net/models/Areas/Subscriber/Models/Content/SeriesModel.cs @@ -17,6 +17,11 @@ public class SeriesModel : BaseTypeModel /// get/set - Whether to show the topics on the content form. /// public bool UseInTopics { get; set; } + + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } #endregion #region Constructors @@ -33,6 +38,7 @@ public SeriesModel(Entities.Series entity) : base(entity) { this.SourceId = entity.SourceId; this.UseInTopics = entity.UseInTopics; + this.IsCBRASource = entity.IsCBRASource; } #endregion } diff --git a/libs/net/models/Areas/Subscriber/Models/Content/SourceModel.cs b/libs/net/models/Areas/Subscriber/Models/Content/SourceModel.cs index dfddadcb6b..4590b85f26 100644 --- a/libs/net/models/Areas/Subscriber/Models/Content/SourceModel.cs +++ b/libs/net/models/Areas/Subscriber/Models/Content/SourceModel.cs @@ -51,6 +51,11 @@ public class SourceModel : BaseTypeModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - /// @@ -82,7 +87,8 @@ public SourceModel(Entities.Source entity) : base(entity) this.AutoTranscribe = entity.AutoTranscribe; this.DisableTranscribe = entity.DisableTranscribe; this.UseInTopics = entity.UseInTopics; - this.Configuration = JsonSerializer.Deserialize>(entity.Configuration) ?? new Dictionary(); + this.Configuration = JsonSerializer.Deserialize>(entity.Configuration) ?? new Dictionary(); + this.IsCBRASource = entity.IsCBRASource; } #endregion @@ -105,7 +111,8 @@ public static explicit operator Entities.Source(SourceModel model) AutoTranscribe = model.AutoTranscribe, DisableTranscribe = model.DisableTranscribe, UseInTopics = model.UseInTopics, - Configuration = JsonDocument.Parse(JsonSerializer.Serialize(model.Configuration)) + Configuration = JsonDocument.Parse(JsonSerializer.Serialize(model.Configuration)), + IsCBRASource = model.IsCBRASource }; } #endregion diff --git a/libs/net/models/Areas/Subscriber/Models/Series/SeriesModel.cs b/libs/net/models/Areas/Subscriber/Models/Series/SeriesModel.cs index ad8ffd8a9a..accca0be49 100644 --- a/libs/net/models/Areas/Subscriber/Models/Series/SeriesModel.cs +++ b/libs/net/models/Areas/Subscriber/Models/Series/SeriesModel.cs @@ -19,6 +19,11 @@ public class SeriesModel : BaseTypeModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + /// /// get/set - Is a secondary source - generally added via use of "Other" field. /// Will not be displayed in the primary Series/Source dropdown or in search filters @@ -52,6 +57,7 @@ public SeriesModel(Entities.Series entity) : base(entity) this.UseInTopics = entity.UseInTopics; this.IsOther = entity.IsOther; this.MediaTypeSearchMappings = entity.MediaTypeSearchMappingsManyToMany.Select(m => new MediaTypeModel(m.MediaType!)); + this.IsCBRASource = entity.IsCBRASource; } #endregion } diff --git a/libs/net/models/Areas/Subscriber/Models/Source/SourceModel.cs b/libs/net/models/Areas/Subscriber/Models/Source/SourceModel.cs index bf23cb6a6c..2e62b82c6e 100644 --- a/libs/net/models/Areas/Subscriber/Models/Source/SourceModel.cs +++ b/libs/net/models/Areas/Subscriber/Models/Source/SourceModel.cs @@ -84,6 +84,11 @@ public class SourceModel /// public bool UseInTopics { get; set; } + /// + /// get/set - is CBRA source or not. + /// + public bool IsCBRASource { get; set; } + #endregion #region Constructors @@ -114,6 +119,7 @@ public SourceModel(Entities.Source entity, JsonSerializerOptions options) this.AutoTranscribe = entity.AutoTranscribe; this.DisableTranscribe = entity.DisableTranscribe; this.UseInTopics = entity.UseInTopics; + this.IsCBRASource = entity.IsCBRASource; } #endregion } diff --git a/libs/npm/core/src/hooks/api/interfaces/ISeriesModel.ts b/libs/npm/core/src/hooks/api/interfaces/ISeriesModel.ts index 1ad05fea59..8dfb904b2a 100644 --- a/libs/npm/core/src/hooks/api/interfaces/ISeriesModel.ts +++ b/libs/npm/core/src/hooks/api/interfaces/ISeriesModel.ts @@ -8,4 +8,5 @@ export interface ISeriesModel extends ISortableModel { autoTranscribe: boolean; isOther: boolean; useInTopics: boolean; + isCBRASource: boolean; } diff --git a/libs/npm/core/src/hooks/api/interfaces/ISourceModel.ts b/libs/npm/core/src/hooks/api/interfaces/ISourceModel.ts index eeb3c4e188..ee0b8f99c3 100644 --- a/libs/npm/core/src/hooks/api/interfaces/ISourceModel.ts +++ b/libs/npm/core/src/hooks/api/interfaces/ISourceModel.ts @@ -23,4 +23,5 @@ export interface ISourceModel extends ISortableModel { configuration: any; actions: ISourceActionModel[]; metrics: IMetricModel[]; + isCBRASource: boolean; } diff --git a/libs/npm/core/src/hooks/api/mocks/series.ts b/libs/npm/core/src/hooks/api/mocks/series.ts index 7a16c07eee..e878ff89be 100644 --- a/libs/npm/core/src/hooks/api/mocks/series.ts +++ b/libs/npm/core/src/hooks/api/mocks/series.ts @@ -10,5 +10,6 @@ export const mockSeries: ISeriesModel[] = [ autoTranscribe: false, isOther: false, useInTopics: false, + isCBRASource: false, }, ]; diff --git a/libs/npm/core/src/hooks/api/mocks/sources.ts b/libs/npm/core/src/hooks/api/mocks/sources.ts index 571f12718d..b35a316c70 100644 --- a/libs/npm/core/src/hooks/api/mocks/sources.ts +++ b/libs/npm/core/src/hooks/api/mocks/sources.ts @@ -17,6 +17,7 @@ export const mockSources: ISourceModel[] = [ mediaTypeSearchMappings: [], actions: [], metrics: [], + isCBRASource: false, }, { id: 2, @@ -34,5 +35,6 @@ export const mockSources: ISourceModel[] = [ mediaTypeSearchMappings: [], actions: [], metrics: [], + isCBRASource: false, }, ]; diff --git a/services/net/content/ContentManager.cs b/services/net/content/ContentManager.cs index a1380bff8e..c311663c12 100644 --- a/services/net/content/ContentManager.cs +++ b/services/net/content/ContentManager.cs @@ -1006,7 +1006,8 @@ private async Task CopyFileWithSSHAsync(DataLocationModel dataLoca Name = targetSeries.Name, SortOrder = targetSeries.SortOrder, UseInTopics = targetSeries.UseInTopics, - SourceId = targetSeries.SourceId + SourceId = targetSeries.SourceId, + IsCBRASource = targetSeries.IsCBRASource }; }