diff --git a/api/net/Areas/Subscriber/Controllers/ContentController.cs b/api/net/Areas/Subscriber/Controllers/ContentController.cs index 5ff6c63a66..aa7207169f 100644 --- a/api/net/Areas/Subscriber/Controllers/ContentController.cs +++ b/api/net/Areas/Subscriber/Controllers/ContentController.cs @@ -247,7 +247,6 @@ public async Task UpdateAsync([FromBody] ContentModel model) content.Summary = model.Summary; content.Body = model.Body; content.Versions = model.Versions; - content.IsCBRAUnqualified = model.IsCBRAUnqualified; foreach (var tonePool in model.TonePools) { // Update or Add. diff --git a/app/editor/.yarn/cache/tno-core-npm-1.0.3-7d7d539e80-7b94d711ef.zip b/app/editor/.yarn/cache/tno-core-npm-1.0.4-139085a13d-313b17b1ad.zip similarity index 85% rename from app/editor/.yarn/cache/tno-core-npm-1.0.3-7d7d539e80-7b94d711ef.zip rename to app/editor/.yarn/cache/tno-core-npm-1.0.4-139085a13d-313b17b1ad.zip index b89c43e111..2ceb4098b4 100644 Binary files a/app/editor/.yarn/cache/tno-core-npm-1.0.3-7d7d539e80-7b94d711ef.zip and b/app/editor/.yarn/cache/tno-core-npm-1.0.4-139085a13d-313b17b1ad.zip differ diff --git a/app/editor/package.json b/app/editor/package.json index 0400bda1d2..8aec0077e6 100644 --- a/app/editor/package.json +++ b/app/editor/package.json @@ -60,7 +60,7 @@ "redux-logger": "3.0.6", "styled-components": "6.1.11", "stylis": "4.3.2", - "tno-core": "1.0.3" + "tno-core": "1.0.4" }, "devDependencies": { "@simbathesailor/use-what-changed": "2.0.0", diff --git a/app/editor/src/features/content/form/constants/defaultFormValues.ts b/app/editor/src/features/content/form/constants/defaultFormValues.ts index 3cad4625e3..53ef8453a8 100644 --- a/app/editor/src/features/content/form/constants/defaultFormValues.ts +++ b/app/editor/src/features/content/form/constants/defaultFormValues.ts @@ -48,6 +48,5 @@ export const defaultFormValues = (contentType: ContentTypeName): IContentForm => edition: '', byline: '', createdOn: publishedOn.toString(), - isCBRAUnqualified: false, }; }; diff --git a/app/editor/src/features/content/form/interfaces/IContentForm.ts b/app/editor/src/features/content/form/interfaces/IContentForm.ts index 862272f087..bf5ce8b902 100644 --- a/app/editor/src/features/content/form/interfaces/IContentForm.ts +++ b/app/editor/src/features/content/form/interfaces/IContentForm.ts @@ -29,5 +29,4 @@ export interface IContentForm prep?: number; // Print Content showOther?: boolean; - isCBRAUnqualified: boolean; } diff --git a/app/editor/src/features/content/form/styled/ContentForm.tsx b/app/editor/src/features/content/form/styled/ContentForm.tsx index c441c64462..822cc7f6be 100644 --- a/app/editor/src/features/content/form/styled/ContentForm.tsx +++ b/app/editor/src/features/content/form/styled/ContentForm.tsx @@ -75,12 +75,6 @@ export const ContentForm = styled.div` padding-right: 0.5em; } - .checkbox-cbra { - margin-left: 2em; - margin-top: 2em; - padding-right: 0.5em; - } - .content-properties { flex-grow: 1; padding-top: 1em; diff --git a/app/editor/src/features/content/form/utils/toForm.ts b/app/editor/src/features/content/form/utils/toForm.ts index b783130db2..af087b3eab 100644 --- a/app/editor/src/features/content/form/utils/toForm.ts +++ b/app/editor/src/features/content/form/utils/toForm.ts @@ -55,6 +55,5 @@ export function toForm(model: IContentModel): IContentForm { section: model.section ?? '', edition: model.edition ?? '', version: model.version, - isCBRAUnqualified: model.isCBRAUnqualified, }; } diff --git a/app/editor/src/features/content/form/utils/toModel.ts b/app/editor/src/features/content/form/utils/toModel.ts index 5d3a36ab29..70647ac15b 100644 --- a/app/editor/src/features/content/form/utils/toModel.ts +++ b/app/editor/src/features/content/form/utils/toModel.ts @@ -56,6 +56,5 @@ export function toModel(values: IContentForm): IContentModel { postedOn: values.postedOn ? moment(values.postedOn).toISOString() : undefined, publishedOn: moment(values.publishedOn).toISOString(), version: values.version, - isCBRAUnqualified: values.isCBRAUnqualified, }; } diff --git a/app/editor/src/store/slices/content/hooks/useCastContentToSearchResult.ts b/app/editor/src/store/slices/content/hooks/useCastContentToSearchResult.ts index a31cebe99c..fe4dd4b8dc 100644 --- a/app/editor/src/store/slices/content/hooks/useCastContentToSearchResult.ts +++ b/app/editor/src/store/slices/content/hooks/useCastContentToSearchResult.ts @@ -38,7 +38,6 @@ export const useCastContentToSearchResult = () => { ? content.actions.some((a) => a.id === featuredStoryActionId && a.value === 'true') : false, version: content.version, - isCBRAUnqualified: content.isCBRAUnqualified, }; return result; diff --git a/app/editor/src/store/slices/content/interfaces/IContentSearchResult.ts b/app/editor/src/store/slices/content/interfaces/IContentSearchResult.ts index 0d7ff120e3..5e16383f8a 100644 --- a/app/editor/src/store/slices/content/interfaces/IContentSearchResult.ts +++ b/app/editor/src/store/slices/content/interfaces/IContentSearchResult.ts @@ -26,5 +26,4 @@ export interface IContentSearchResult { transcriptStatus?: WorkOrderStatusName; original: IContentModel; version?: number; - isCBRAUnqualified: boolean; } diff --git a/app/editor/yarn.lock b/app/editor/yarn.lock index 19c15022fd..ee81f17d2b 100644 --- a/app/editor/yarn.lock +++ b/app/editor/yarn.lock @@ -11009,7 +11009,7 @@ __metadata: sass-extract-loader: 1.1.0 styled-components: 6.1.11 stylis: 4.3.2 - tno-core: 1.0.3 + tno-core: 1.0.4 typescript: 4.9.5 languageName: unknown linkType: soft @@ -15184,9 +15184,9 @@ __metadata: languageName: node linkType: hard -"tno-core@npm:1.0.3": - version: 1.0.3 - resolution: "tno-core@npm:1.0.3" +"tno-core@npm:1.0.4": + version: 1.0.4 + resolution: "tno-core@npm:1.0.4" dependencies: "@elastic/elasticsearch": ^8.13.1 "@fortawesome/free-solid-svg-icons": ^6.4.2 @@ -15219,7 +15219,7 @@ __metadata: styled-components: ^6.1.11 stylis: ^4.3.2 yup: ^1.1.1 - checksum: 7b94d711ef5e138640b9782fa8effd797aae1d3227c07368ac264c1baf14ccde890f3501caff75ee8a730b859ee5bf813a113ee802ad445d3d106b2b539238cb + checksum: 313b17b1ad87f27205d0f8be6ae426be8a1227b938929d00409f22e25386356875ee4df5353da479fcc8ce36a5cdff7f8936dfef28167fc9e7e30614858f9836 languageName: node linkType: hard diff --git a/app/subscriber/.yarn/cache/tno-core-npm-1.0.3-7d7d539e80-7b94d711ef.zip b/app/subscriber/.yarn/cache/tno-core-npm-1.0.4-139085a13d-313b17b1ad.zip similarity index 85% rename from app/subscriber/.yarn/cache/tno-core-npm-1.0.3-7d7d539e80-7b94d711ef.zip rename to app/subscriber/.yarn/cache/tno-core-npm-1.0.4-139085a13d-313b17b1ad.zip index b89c43e111..2ceb4098b4 100644 Binary files a/app/subscriber/.yarn/cache/tno-core-npm-1.0.3-7d7d539e80-7b94d711ef.zip and b/app/subscriber/.yarn/cache/tno-core-npm-1.0.4-139085a13d-313b17b1ad.zip differ diff --git a/app/subscriber/package.json b/app/subscriber/package.json index 4e64e3755d..7d373033d2 100644 --- a/app/subscriber/package.json +++ b/app/subscriber/package.json @@ -45,7 +45,7 @@ "sheetjs": "file:packages/xlsx-0.20.1.tgz", "styled-components": "6.1.11", "stylis": "4.3.2", - "tno-core": "1.0.3" + "tno-core": "1.0.4" }, "devDependencies": { "@testing-library/jest-dom": "6.4.5", diff --git a/app/subscriber/src/features/commentary/utils/castToSearchResult.ts b/app/subscriber/src/features/commentary/utils/castToSearchResult.ts index 377a16c667..b107cd4c1b 100644 --- a/app/subscriber/src/features/commentary/utils/castToSearchResult.ts +++ b/app/subscriber/src/features/commentary/utils/castToSearchResult.ts @@ -17,6 +17,5 @@ export const castToSearchResult = (message: IContentMessageModel): IContentSearc quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }; }; diff --git a/app/subscriber/src/features/login/styled/SystemMessage.tsx b/app/subscriber/src/features/login/styled/SystemMessage.tsx index b1460188ab..f2d0635a78 100644 --- a/app/subscriber/src/features/login/styled/SystemMessage.tsx +++ b/app/subscriber/src/features/login/styled/SystemMessage.tsx @@ -13,4 +13,16 @@ export const SystemMessage = styled.div` float: right; color: ${(props) => props.theme.css.btnBkPrimary}; } + + .ql-align-left { + text-align: left; + } + + .ql-align-center { + text-align: center; + } + + .ql-align-right { + text-align: right; + } `; diff --git a/app/subscriber/src/features/my-reports/constants/defaultContent.ts b/app/subscriber/src/features/my-reports/constants/defaultContent.ts index 9144ba246c..d21598b1b4 100644 --- a/app/subscriber/src/features/my-reports/constants/defaultContent.ts +++ b/app/subscriber/src/features/my-reports/constants/defaultContent.ts @@ -31,5 +31,4 @@ export const defaultContent: IContentModel = { quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }; diff --git a/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateContent.ts b/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateContent.ts index f93dd9be94..84f31c328c 100644 --- a/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateContent.ts +++ b/app/subscriber/src/features/my-reports/edit/settings/template/utils/generateContent.ts @@ -63,7 +63,6 @@ export const generateContent = (options: IGenerateContentOptions) => { quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, ...options.content, }; return entity; diff --git a/app/subscriber/yarn.lock b/app/subscriber/yarn.lock index de8b40cfc6..66f470ce35 100644 --- a/app/subscriber/yarn.lock +++ b/app/subscriber/yarn.lock @@ -10665,7 +10665,7 @@ __metadata: sheetjs: "file:packages/xlsx-0.20.1.tgz" styled-components: 6.1.11 stylis: 4.3.2 - tno-core: 1.0.3 + tno-core: 1.0.4 typescript: 4.9.5 languageName: unknown linkType: soft @@ -14698,9 +14698,9 @@ __metadata: languageName: node linkType: hard -"tno-core@npm:1.0.3": - version: 1.0.3 - resolution: "tno-core@npm:1.0.3" +"tno-core@npm:1.0.4": + version: 1.0.4 + resolution: "tno-core@npm:1.0.4" dependencies: "@elastic/elasticsearch": ^8.13.1 "@fortawesome/free-solid-svg-icons": ^6.4.2 @@ -14733,7 +14733,7 @@ __metadata: styled-components: ^6.1.11 stylis: ^4.3.2 yup: ^1.1.1 - checksum: 7b94d711ef5e138640b9782fa8effd797aae1d3227c07368ac264c1baf14ccde890f3501caff75ee8a730b859ee5bf813a113ee802ad445d3d106b2b539238cb + checksum: 313b17b1ad87f27205d0f8be6ae426be8a1227b938929d00409f22e25386356875ee4df5353da479fcc8ce36a5cdff7f8936dfef28167fc9e7e30614858f9836 languageName: node linkType: hard diff --git a/libs/net/dal/Configuration/ContentConfiguration.cs b/libs/net/dal/Configuration/ContentConfiguration.cs index f8fba320d8..e2a32a6264 100644 --- a/libs/net/dal/Configuration/ContentConfiguration.cs +++ b/libs/net/dal/Configuration/ContentConfiguration.cs @@ -52,7 +52,6 @@ public override void Configure(EntityTypeBuilder builder) builder.HasIndex(m => new { m.ContentType, m.OtherSource, m.Uid, m.Page, m.Status, m.IsHidden }, "IX_content"); builder.HasIndex(m => new { m.Edition, m.Section, m.Byline }, "IX_print_content"); builder.HasIndex(m => m.Headline, "IX_headline"); - builder.Property(m => m.IsCBRAUnqualified).IsRequired(); base.Configure(builder); } diff --git a/libs/net/dal/Migrations/20241212002825_1.3.11.Designer.cs b/libs/net/dal/Migrations/20241212002825_1.3.11.Designer.cs new file mode 100644 index 0000000000..e8562179aa --- /dev/null +++ b/libs/net/dal/Migrations/20241212002825_1.3.11.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("20241212002825_1.3.11")] + partial class _1311 + { + /// + 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/20241212002825_1.3.11.cs b/libs/net/dal/Migrations/20241212002825_1.3.11.cs new file mode 100644 index 0000000000..5093c6e60a --- /dev/null +++ b/libs/net/dal/Migrations/20241212002825_1.3.11.cs @@ -0,0 +1,34 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using TNO.DAL; + +#nullable disable + +namespace TNO.DAL.Migrations +{ + /// + public partial class _1311 : SeedMigration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + PreUp(migrationBuilder); + migrationBuilder.DropColumn( + name: "is_cbra_unqualified", + table: "content"); + PostUp(migrationBuilder); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + PreDown(migrationBuilder); + migrationBuilder.AddColumn( + name: "is_cbra_unqualified", + table: "content", + type: "boolean", + nullable: false, + defaultValue: false); + PostDown(migrationBuilder); + } + } +} diff --git a/libs/net/dal/Migrations/TNOContextModelSnapshot.cs b/libs/net/dal/Migrations/TNOContextModelSnapshot.cs index 91d4a59b9e..10f68f74ba 100644 --- a/libs/net/dal/Migrations/TNOContextModelSnapshot.cs +++ b/libs/net/dal/Migrations/TNOContextModelSnapshot.cs @@ -875,10 +875,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("boolean") .HasColumnName("is_approved"); - b.Property("IsCBRAUnqualified") - .HasColumnType("boolean") - .HasColumnName("is_cbra_unqualified"); - b.Property("IsHidden") .HasColumnType("boolean") .HasColumnName("is_hidden"); diff --git a/libs/net/entities/Content.cs b/libs/net/entities/Content.cs index 1d148f5d44..2f00e6506d 100644 --- a/libs/net/entities/Content.cs +++ b/libs/net/entities/Content.cs @@ -304,12 +304,6 @@ public class Content : AuditColumns /// public virtual List Quotes { get; } = new List(); - /// - /// get/set - Whether content is CBRA unqualified. - /// - [Column("is_cbra_unqualified")] - public bool IsCBRAUnqualified { get; set; } - #endregion #region Constructors diff --git a/libs/net/models/Areas/Editor/Models/Content/ContentModel.cs b/libs/net/models/Areas/Editor/Models/Content/ContentModel.cs index 1351c5fb8e..403cce05ba 100644 --- a/libs/net/models/Areas/Editor/Models/Content/ContentModel.cs +++ b/libs/net/models/Areas/Editor/Models/Content/ContentModel.cs @@ -239,10 +239,6 @@ public class ContentModel : AuditColumnsModel /// public IEnumerable Quotes { get; set; } = Array.Empty(); - /// - /// get/set - Whether content is CBRA unqualified. - /// - public bool IsCBRAUnqualified { get; set; } #endregion #region Constructors @@ -299,7 +295,6 @@ public ContentModel(Entities.Content entity) : base(entity) this.Links = entity.Links.Select(e => new ContentLinkModel(e)); this.Quotes = entity.Quotes.Select(e => new QuoteModel(e)); this.Versions = entity.Versions; - this.IsCBRAUnqualified = entity.IsCBRAUnqualified; } #endregion @@ -347,7 +342,6 @@ public static explicit operator Entities.Content(ContentModel model) entity.FileReferences.AddRange(model.FileReferences.Select(f => f.ToEntity(entity.Id))); entity.TimeTrackings.AddRange(model.TimeTrackings.Select(t => t.ToEntity(entity.Id))); entity.Quotes.AddRange(model.Quotes.Select(f => f.ToEntity(entity.Id))); - entity.IsCBRAUnqualified = model.IsCBRAUnqualified; return entity; } diff --git a/libs/net/models/Areas/Report/ContentModel.cs b/libs/net/models/Areas/Report/ContentModel.cs index c3683888d6..d4d960128a 100644 --- a/libs/net/models/Areas/Report/ContentModel.cs +++ b/libs/net/models/Areas/Report/ContentModel.cs @@ -204,11 +204,6 @@ public class ContentModel /// get/set - An array of file references. /// public IEnumerable FileReferences { get; set; } = Array.Empty(); - - /// - /// get/set - Whether content is CBRA unqualified. - /// - public bool IsCBRAUnqualified { get; set; } #endregion #region Constructors @@ -254,7 +249,6 @@ public ContentModel(Entities.Content entity) this.Tags = entity.TagsManyToMany.Select(e => new ContentTagModel(e)); this.TonePools = entity.TonePoolsManyToMany.Select(e => new ContentTonePoolModel(e)); this.FileReferences = entity.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = entity.IsCBRAUnqualified; } /// @@ -294,7 +288,6 @@ public ContentModel(TNO.API.Areas.Services.Models.Content.ContentModel model) this.Tags = model.Tags.Select(e => new ContentTagModel(e)); this.TonePools = model.TonePools.Select(e => new ContentTonePoolModel(e)); this.FileReferences = model.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = model.IsCBRAUnqualified; } #endregion } diff --git a/libs/net/models/Areas/Services/Models/Content/ContentModel.cs b/libs/net/models/Areas/Services/Models/Content/ContentModel.cs index 6864b1e0f0..afe9d64313 100644 --- a/libs/net/models/Areas/Services/Models/Content/ContentModel.cs +++ b/libs/net/models/Areas/Services/Models/Content/ContentModel.cs @@ -244,11 +244,6 @@ public class ContentModel : AuditColumnsModel /// get/set - An array of quotes. /// public IEnumerable Quotes { get; set; } = Array.Empty(); - - /// - /// get/set - Whether content is CBRA unqualified. - /// - public bool IsCBRAUnqualified { get; set; } #endregion #region Constructors @@ -305,7 +300,6 @@ public ContentModel(Entities.Content entity, JsonSerializerOptions options) : ba this.Quotes = entity.Quotes.Select(e => new QuoteModel(e)); this.UserNotifications = entity.UserNotifications.Select(un => new UserContentNotificationModel(un)); this.Versions = entity.Versions; - this.IsCBRAUnqualified = entity.IsCBRAUnqualified; } #endregion @@ -352,7 +346,6 @@ public static explicit operator Entities.Content(ContentModel model) entity.FileReferences.AddRange(model.FileReferences.Select(f => f.ToEntity(entity.Id))); entity.NotificationsManyToMany.AddRange(model.Notifications.Select(n => (Entities.NotificationInstance)n)); entity.Quotes.AddRange(model.Quotes.Select(f => f.ToEntity(entity.Id))); - entity.IsCBRAUnqualified = model.IsCBRAUnqualified; return entity; } diff --git a/libs/net/models/Areas/Services/Models/Report/ContentModel.cs b/libs/net/models/Areas/Services/Models/Report/ContentModel.cs index 43e64560d7..d13c2f4076 100644 --- a/libs/net/models/Areas/Services/Models/Report/ContentModel.cs +++ b/libs/net/models/Areas/Services/Models/Report/ContentModel.cs @@ -204,11 +204,6 @@ public class ContentModel /// get/set - An array of file references. /// public IEnumerable FileReferences { get; set; } = Array.Empty(); - - /// - /// get/set - Whether content is CBRA unqualified. - /// - public bool IsCBRAUnqualified { get; set; } #endregion #region Constructors @@ -261,7 +256,6 @@ public ContentModel(Entities.Content entity) this.Labels = entity.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = entity.TonePoolsManyToMany.Select(e => new ContentTonePoolModel(e)); this.FileReferences = entity.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = entity.IsCBRAUnqualified; } /// @@ -308,7 +302,6 @@ public ContentModel(TNO.API.Areas.Services.Models.Content.ContentModel model) this.Labels = model.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = model.TonePools.Select(e => new ContentTonePoolModel(e)); this.FileReferences = model.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = model.IsCBRAUnqualified; } #endregion } diff --git a/libs/net/models/Areas/Services/Models/ReportInstance/ContentModel.cs b/libs/net/models/Areas/Services/Models/ReportInstance/ContentModel.cs index 185a94f107..035d2a5bc1 100644 --- a/libs/net/models/Areas/Services/Models/ReportInstance/ContentModel.cs +++ b/libs/net/models/Areas/Services/Models/ReportInstance/ContentModel.cs @@ -204,11 +204,6 @@ public class ContentModel /// get/set - An array of file references. /// public IEnumerable FileReferences { get; set; } = Array.Empty(); - - /// - /// get/set - Whether content is CBRA unqualified. - /// - public bool IsCBRAUnqualified { get; set; } #endregion #region Constructors @@ -261,7 +256,6 @@ public ContentModel(Entities.Content entity) this.Labels = entity.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = entity.TonePoolsManyToMany.Select(e => new ContentTonePoolModel(e)); this.FileReferences = entity.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = entity.IsCBRAUnqualified; } /// @@ -308,7 +302,6 @@ public ContentModel(TNO.API.Areas.Services.Models.Content.ContentModel model) this.Labels = model.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = model.TonePools.Select(e => new ContentTonePoolModel(e)); this.FileReferences = model.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = model.IsCBRAUnqualified; } #endregion } diff --git a/libs/net/models/Areas/Subscriber/Models/Content/ContentModel.cs b/libs/net/models/Areas/Subscriber/Models/Content/ContentModel.cs index 4ab1009142..5df5f06232 100644 --- a/libs/net/models/Areas/Subscriber/Models/Content/ContentModel.cs +++ b/libs/net/models/Areas/Subscriber/Models/Content/ContentModel.cs @@ -210,11 +210,6 @@ public class ContentModel : AuditColumnsModel /// get/set - An array of quotes. /// public IEnumerable Quotes { get; set; } = Array.Empty(); - - /// - /// get/set - Whether content is CBRA unqualified. - /// - public bool IsCBRAUnqualified { get; set; } #endregion #region Constructors @@ -267,7 +262,6 @@ public ContentModel(Entities.Content entity) : base(entity) this.TonePools = entity.TonePoolsManyToMany.Select(e => new ContentTonePoolModel(e)); this.Quotes = entity.Quotes.Select(e => new QuoteModel(e)); this.Versions = entity.Versions; - this.IsCBRAUnqualified = entity.IsCBRAUnqualified; } #endregion @@ -312,7 +306,6 @@ public static explicit operator Entities.Content(ContentModel model) entity.Labels.AddRange(model.Labels.Select(f => f.ToEntity(entity.Id))); entity.TonePoolsManyToMany.AddRange(model.TonePools.Select(tp => tp.ToEntity(entity.Id))); entity.Quotes.AddRange(model.Quotes.Select(f => f.ToEntity(entity.Id))); - entity.IsCBRAUnqualified = model.IsCBRAUnqualified; return entity; } diff --git a/libs/net/template/Models/ContentModel.cs b/libs/net/template/Models/ContentModel.cs index 65d7956579..ccd2ca3a86 100644 --- a/libs/net/template/Models/ContentModel.cs +++ b/libs/net/template/Models/ContentModel.cs @@ -219,11 +219,6 @@ public class ContentModel /// get/set - An array of file references. /// public IEnumerable FileReferences { get; set; } = Array.Empty(); - - /// - /// get/set - Whether content is CBRA unqualified. - /// - public bool IsCBRAUnqualified { get; set; } #endregion #region Constructors @@ -283,7 +278,6 @@ public ContentModel(Entities.Content entity, int sortOrder = 0, string sectionNa this.Labels = entity.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = entity.TonePoolsManyToMany.Select(e => new ContentTonePoolModel(e)); this.FileReferences = entity.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = entity.IsCBRAUnqualified; } /// @@ -337,7 +331,6 @@ public ContentModel(TNO.API.Areas.Editor.Models.Content.ContentModel model, int this.Labels = model.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = model.TonePools.Select(e => new ContentTonePoolModel(e)); this.FileReferences = model.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = model.IsCBRAUnqualified; } /// @@ -410,7 +403,6 @@ public ContentModel(TNO.API.Areas.Services.Models.Content.ContentModel model, in this.Labels = model.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = model.TonePools.Select(e => new ContentTonePoolModel(e)); this.FileReferences = model.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = model.IsCBRAUnqualified; } /// @@ -464,7 +456,6 @@ public ContentModel(TNO.API.Areas.Services.Models.Report.ContentModel model, int this.Labels = model.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = model.TonePools.Select(e => new ContentTonePoolModel(e)); this.FileReferences = model.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = model.IsCBRAUnqualified; } /// @@ -518,7 +509,6 @@ public ContentModel(TNO.API.Areas.Services.Models.ReportInstance.ContentModel mo this.Labels = model.Labels.Select(e => new ContentLabelModel(e)); this.TonePools = model.TonePools.Select(e => new ContentTonePoolModel(e)); this.FileReferences = model.FileReferences.Select(e => new FileReferenceModel(e)); - this.IsCBRAUnqualified = model.IsCBRAUnqualified; } #endregion } diff --git a/libs/npm/core/package.json b/libs/npm/core/package.json index e062974d4b..09202e5791 100644 --- a/libs/npm/core/package.json +++ b/libs/npm/core/package.json @@ -1,7 +1,7 @@ { "name": "tno-core", "description": "TNO shared library", - "version": "1.0.3", + "version": "1.0.4", "homepage": "https://github.com/bcgov/tno", "license": "Apache-2.0", "files": [ diff --git a/libs/npm/core/src/hooks/api/interfaces/IContentModel.ts b/libs/npm/core/src/hooks/api/interfaces/IContentModel.ts index a9f69233e9..8acb003d43 100644 --- a/libs/npm/core/src/hooks/api/interfaces/IContentModel.ts +++ b/libs/npm/core/src/hooks/api/interfaces/IContentModel.ts @@ -70,5 +70,4 @@ export interface IContentModel extends IAuditColumnsModel { // React-Table Properties // TODO: Should not be part of the API interface. isSelected?: boolean; - isCBRAUnqualified: boolean; } diff --git a/libs/npm/core/src/hooks/api/mocks/contents.ts b/libs/npm/core/src/hooks/api/mocks/contents.ts index 9f29a1d323..efc9d622a7 100644 --- a/libs/npm/core/src/hooks/api/mocks/contents.ts +++ b/libs/npm/core/src/hooks/api/mocks/contents.ts @@ -35,7 +35,6 @@ export const mockContents: IContentModel[] = [ quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }, { id: 2, @@ -70,7 +69,6 @@ export const mockContents: IContentModel[] = [ quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }, { id: 3, @@ -105,7 +103,6 @@ export const mockContents: IContentModel[] = [ quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }, { id: 4, @@ -140,7 +137,6 @@ export const mockContents: IContentModel[] = [ quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }, { id: 5, @@ -175,7 +171,6 @@ export const mockContents: IContentModel[] = [ quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }, { id: 6, @@ -210,6 +205,5 @@ export const mockContents: IContentModel[] = [ quotes: [], userNotifications: [], versions: {}, - isCBRAUnqualified: false, }, ];