From 7372f24894f9ae3594d04ba22dca7f88f01e3738 Mon Sep 17 00:00:00 2001
From: Amy Benson
Date: Thu, 19 Dec 2024 11:54:52 +0000
Subject: [PATCH 01/40] EES-5580 validate EditableContentForm on submit after
reinitialisation
---
.../src/components/editable/EditableContentForm.tsx | 1 +
.../src/components/form/FormFieldEditor.tsx | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/explore-education-statistics-admin/src/components/editable/EditableContentForm.tsx b/src/explore-education-statistics-admin/src/components/editable/EditableContentForm.tsx
index 658e0aaaf4f..329fa85c165 100644
--- a/src/explore-education-statistics-admin/src/components/editable/EditableContentForm.tsx
+++ b/src/explore-education-statistics-admin/src/components/editable/EditableContentForm.tsx
@@ -289,6 +289,7 @@ const EditableContentForm = ({
onChange={setElements}
onCancelComment={toggleCommentAddForm.off}
onClickAddComment={toggleCommentAddForm.on}
+ onElementsReady={setElements}
onImageUpload={onImageUpload}
onImageUploadCancel={onImageUploadCancel}
/>
diff --git a/src/explore-education-statistics-admin/src/components/form/FormFieldEditor.tsx b/src/explore-education-statistics-admin/src/components/form/FormFieldEditor.tsx
index bc969779e6f..678339f261f 100644
--- a/src/explore-education-statistics-admin/src/components/form/FormFieldEditor.tsx
+++ b/src/explore-education-statistics-admin/src/components/form/FormFieldEditor.tsx
@@ -42,6 +42,7 @@ export default function FormFieldEditor({
testId,
onBlur,
onChange,
+ onElementsReady,
...props
}: Props) {
const {
@@ -86,7 +87,10 @@ export default function FormFieldEditor({
}
}}
onElementsChange={handleElements}
- onElementsReady={handleElements}
+ onElementsReady={els => {
+ handleElements(els);
+ onElementsReady?.(els);
+ }}
onChange={nextValue => {
setValue(
name,
From 898a54f80eff80805ac74cb797a07004288a3a18 Mon Sep 17 00:00:00 2001
From: Amy Benson
Date: Thu, 19 Dec 2024 13:39:59 +0000
Subject: [PATCH 02/40] EES-5457 show extra create data block link when more
than 5
---
.../datablocks/ReleaseDataBlocksPage.tsx | 2 +-
.../__tests__/ReleaseDataBlocksPage.test.tsx | 242 +++++++++++-------
2 files changed, 146 insertions(+), 98 deletions(-)
diff --git a/src/explore-education-statistics-admin/src/pages/release/datablocks/ReleaseDataBlocksPage.tsx b/src/explore-education-statistics-admin/src/pages/release/datablocks/ReleaseDataBlocksPage.tsx
index 2c27275ff62..94545abcda5 100644
--- a/src/explore-education-statistics-admin/src/pages/release/datablocks/ReleaseDataBlocksPage.tsx
+++ b/src/explore-education-statistics-admin/src/pages/release/datablocks/ReleaseDataBlocksPage.tsx
@@ -128,7 +128,7 @@ const ReleaseDataBlocksPage = ({
- {canUpdateRelease && filteredDataBlocks.length > 5 && (
+ {canUpdateRelease && dataBlocks.length > 5 && (
Create data block
)}
diff --git a/src/explore-education-statistics-admin/src/pages/release/datablocks/__tests__/ReleaseDataBlocksPage.test.tsx b/src/explore-education-statistics-admin/src/pages/release/datablocks/__tests__/ReleaseDataBlocksPage.test.tsx
index 11d757e419d..675d8b950c7 100644
--- a/src/explore-education-statistics-admin/src/pages/release/datablocks/__tests__/ReleaseDataBlocksPage.test.tsx
+++ b/src/explore-education-statistics-admin/src/pages/release/datablocks/__tests__/ReleaseDataBlocksPage.test.tsx
@@ -14,7 +14,6 @@ import _permissionService from '@admin/services/permissionService';
import render from '@common-test/render';
import { waitFor } from '@testing-library/dom';
import { screen, within } from '@testing-library/react';
-import userEvent from '@testing-library/user-event';
import React from 'react';
import { generatePath, MemoryRouter } from 'react-router';
import { Route } from 'react-router-dom';
@@ -218,6 +217,10 @@ describe('ReleaseDataBlocksPage', () => {
name: 'Delete block',
}),
).toBeInTheDocument();
+
+ expect(
+ screen.getByRole('link', { name: 'Create data block' }),
+ ).toBeInTheDocument();
});
test('renders page correctly when release cannot be updated', async () => {
@@ -334,9 +337,28 @@ describe('ReleaseDataBlocksPage', () => {
).toBeInTheDocument();
});
- test('clicking `Delete block` button shows modal', async () => {
- dataBlockService.listDataBlocks.mockResolvedValue(testDataBlocks);
- dataBlockService.getDeleteBlockPlan.mockResolvedValue(testBlock1DeletePlan);
+ test('renders an extra "Create data block" button when there are more than 5 blocks', async () => {
+ dataBlockService.listDataBlocks.mockResolvedValue([
+ ...testDataBlocks,
+ {
+ id: 'block-5',
+ name: 'Block 5',
+ created: '2021-02-01T15:00:00.0000000',
+ heading: 'Block 5 heading',
+ source: 'Block 5 source',
+ inContent: false,
+ chartsCount: 0,
+ },
+ {
+ id: 'block-6',
+ name: 'Block 6',
+ created: '2021-02-01T15:00:00.0000000',
+ heading: 'Block 6 heading',
+ source: 'Block 6 source',
+ inContent: false,
+ chartsCount: 0,
+ },
+ ]);
featuredTableService.listFeaturedTables.mockResolvedValue(
testFeaturedTables,
);
@@ -347,122 +369,148 @@ describe('ReleaseDataBlocksPage', () => {
expect(screen.getByTestId('dataBlocks')).toBeInTheDocument();
});
- expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
- expect(dataBlockService.getDeleteBlockPlan).toHaveBeenCalledTimes(0);
-
- const buttons = screen.getAllByRole('button', { name: 'Delete block' });
-
- await userEvent.click(buttons[0]);
-
- await waitFor(() => {
- expect(screen.getByRole('dialog')).toBeInTheDocument();
- });
-
- expect(dataBlockService.getDeleteBlockPlan).toHaveBeenCalledTimes(1);
-
- const modal = within(screen.getByRole('dialog'));
-
- expect(modal.getByTestId('deleteDataBlock-name')).toHaveTextContent(
- 'Block 1',
- );
expect(
- modal.getByTestId('deleteDataBlock-contentSectionHeading'),
- ).toHaveTextContent('Section 1');
+ screen.getAllByRole('link', { name: 'Create data block' }),
+ ).toHaveLength(2);
});
- test('clicking `Cancel` button hides modal', async () => {
- dataBlockService.listDataBlocks.mockResolvedValue(testDataBlocks);
- dataBlockService.getDeleteBlockPlan.mockResolvedValue(testBlock1DeletePlan);
- featuredTableService.listFeaturedTables.mockResolvedValue(
- testFeaturedTables,
- );
+ describe('deleting a data block', () => {
+ test('clicking `Delete block` button shows modal', async () => {
+ dataBlockService.listDataBlocks.mockResolvedValue(testDataBlocks);
+ dataBlockService.getDeleteBlockPlan.mockResolvedValue(
+ testBlock1DeletePlan,
+ );
+ featuredTableService.listFeaturedTables.mockResolvedValue(
+ testFeaturedTables,
+ );
- renderPage();
+ const { user } = renderPage();
- await waitFor(() => {
- expect(screen.getByTestId('dataBlocks')).toBeInTheDocument();
- });
+ await waitFor(() => {
+ expect(screen.getByTestId('dataBlocks')).toBeInTheDocument();
+ });
- const buttons = screen.getAllByRole('button', { name: 'Delete block' });
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ expect(dataBlockService.getDeleteBlockPlan).toHaveBeenCalledTimes(0);
- await userEvent.click(buttons[0]);
+ const buttons = screen.getAllByRole('button', { name: 'Delete block' });
- await waitFor(() => {
- expect(screen.getByRole('dialog')).toBeInTheDocument();
- });
+ await user.click(buttons[0]);
- const modal = within(screen.getByRole('dialog'));
+ await waitFor(() => {
+ expect(screen.getByRole('dialog')).toBeInTheDocument();
+ });
- await userEvent.click(modal.getByRole('button', { name: 'Cancel' }));
+ expect(dataBlockService.getDeleteBlockPlan).toHaveBeenCalledTimes(1);
- await waitFor(() => {
- expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ const modal = within(screen.getByRole('dialog'));
+
+ expect(modal.getByTestId('deleteDataBlock-name')).toHaveTextContent(
+ 'Block 1',
+ );
+ expect(
+ modal.getByTestId('deleteDataBlock-contentSectionHeading'),
+ ).toHaveTextContent('Section 1');
});
- });
- test('clicking `Confirm` button hides modal and deletes data block', async () => {
- dataBlockService.listDataBlocks.mockResolvedValue(testDataBlocks);
- dataBlockService.getDeleteBlockPlan.mockResolvedValue(testBlock1DeletePlan);
- featuredTableService.listFeaturedTables.mockResolvedValue(
- testFeaturedTables,
- );
+ test('clicking `Cancel` button hides modal', async () => {
+ dataBlockService.listDataBlocks.mockResolvedValue(testDataBlocks);
+ dataBlockService.getDeleteBlockPlan.mockResolvedValue(
+ testBlock1DeletePlan,
+ );
+ featuredTableService.listFeaturedTables.mockResolvedValue(
+ testFeaturedTables,
+ );
- renderPage();
+ const { user } = renderPage();
- await waitFor(() => {
- expect(screen.getByTestId('dataBlocks')).toBeInTheDocument();
- });
+ await waitFor(() => {
+ expect(screen.getByTestId('dataBlocks')).toBeInTheDocument();
+ });
- const buttons = screen.getAllByRole('button', { name: 'Delete block' });
+ const buttons = screen.getAllByRole('button', { name: 'Delete block' });
- await userEvent.click(buttons[0]);
+ await user.click(buttons[0]);
- await waitFor(() => {
- expect(screen.getByRole('dialog')).toBeInTheDocument();
- });
+ await waitFor(() => {
+ expect(screen.getByRole('dialog')).toBeInTheDocument();
+ });
- const modal = within(screen.getByRole('dialog'));
+ const modal = within(screen.getByRole('dialog'));
- await userEvent.click(modal.getByRole('button', { name: 'Confirm' }));
+ await user.click(modal.getByRole('button', { name: 'Cancel' }));
- await waitFor(() => {
- expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ await waitFor(() => {
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ });
});
- expect(dataBlockService.deleteDataBlock).toHaveBeenCalledTimes(1);
- expect(dataBlockService.deleteDataBlock).toHaveBeenCalledWith(
- 'release-1',
- 'block-1',
- );
-
- const featuredTablesTable = within(screen.getByTestId('featuredTables'));
- const featuredTablesRows = featuredTablesTable.getAllByRole('row');
- expect(featuredTablesRows).toHaveLength(2);
-
- const featuredTablesRow1Cells = within(featuredTablesRows[1]).getAllByRole(
- 'cell',
- );
- expect(featuredTablesRow1Cells).toHaveLength(6);
- expect(featuredTablesRow1Cells[0]).toHaveTextContent('Block 3');
- expect(featuredTablesRow1Cells[1]).toHaveTextContent('No');
- expect(featuredTablesRow1Cells[2]).toHaveTextContent('No');
- expect(featuredTablesRow1Cells[3]).toHaveTextContent('Featured 3');
- expect(featuredTablesRow1Cells[4]).toHaveTextContent(
- '1 January 2021 15:00',
- );
- expect(
- within(featuredTablesRow1Cells[5]).getByRole('link', {
- name: 'Edit block',
- }),
- ).toHaveAttribute(
- 'href',
- '/publication/publication-1/release/release-1/data-blocks/block-3',
- );
- expect(
- within(featuredTablesRow1Cells[5]).getByRole('button', {
- name: 'Delete block',
- }),
- ).toBeInTheDocument();
+ test('clicking `Confirm` button hides modal and deletes data block', async () => {
+ dataBlockService.listDataBlocks.mockResolvedValue(testDataBlocks);
+ dataBlockService.getDeleteBlockPlan.mockResolvedValue(
+ testBlock1DeletePlan,
+ );
+ featuredTableService.listFeaturedTables.mockResolvedValue(
+ testFeaturedTables,
+ );
+
+ const { user } = renderPage();
+
+ await waitFor(() => {
+ expect(screen.getByTestId('dataBlocks')).toBeInTheDocument();
+ });
+
+ const buttons = screen.getAllByRole('button', { name: 'Delete block' });
+
+ await user.click(buttons[0]);
+
+ await waitFor(() => {
+ expect(screen.getByRole('dialog')).toBeInTheDocument();
+ });
+
+ const modal = within(screen.getByRole('dialog'));
+
+ await user.click(modal.getByRole('button', { name: 'Confirm' }));
+
+ await waitFor(() => {
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
+ });
+
+ expect(dataBlockService.deleteDataBlock).toHaveBeenCalledTimes(1);
+ expect(dataBlockService.deleteDataBlock).toHaveBeenCalledWith(
+ 'release-1',
+ 'block-1',
+ );
+
+ const featuredTablesTable = within(screen.getByTestId('featuredTables'));
+ const featuredTablesRows = featuredTablesTable.getAllByRole('row');
+ expect(featuredTablesRows).toHaveLength(2);
+
+ const featuredTablesRow1Cells = within(
+ featuredTablesRows[1],
+ ).getAllByRole('cell');
+ expect(featuredTablesRow1Cells).toHaveLength(6);
+ expect(featuredTablesRow1Cells[0]).toHaveTextContent('Block 3');
+ expect(featuredTablesRow1Cells[1]).toHaveTextContent('No');
+ expect(featuredTablesRow1Cells[2]).toHaveTextContent('No');
+ expect(featuredTablesRow1Cells[3]).toHaveTextContent('Featured 3');
+ expect(featuredTablesRow1Cells[4]).toHaveTextContent(
+ '1 January 2021 15:00',
+ );
+ expect(
+ within(featuredTablesRow1Cells[5]).getByRole('link', {
+ name: 'Edit block',
+ }),
+ ).toHaveAttribute(
+ 'href',
+ '/publication/publication-1/release/release-1/data-blocks/block-3',
+ );
+ expect(
+ within(featuredTablesRow1Cells[5]).getByRole('button', {
+ name: 'Delete block',
+ }),
+ ).toBeInTheDocument();
+ });
});
const renderPage = () => {
From 0778874667513128d715535d8173303317697ec8 Mon Sep 17 00:00:00 2001
From: Mark Youngman
Date: Fri, 13 Dec 2024 11:13:35 +0000
Subject: [PATCH 03/40] EES-5738 Create new DataSetFileGeographicLevels table
---
...taSetFileGeographicLevelsTable.Designer.cs | 2272 +++++++++++++++++
..._CreateDataSetFileGeographicLevelsTable.cs | 43 +
.../ContentDbContextModelSnapshot.cs | 29 +
.../DataSetFileGeographicLevels.cs | 17 +
.../Database/ContentDbContext.cs | 18 +-
.../File.cs | 3 +
6 files changed, 2380 insertions(+), 2 deletions(-)
create mode 100644 src/GovUk.Education.ExploreEducationStatistics.Admin/Migrations/ContentMigrations/20241213112036_EES5738_CreateDataSetFileGeographicLevelsTable.Designer.cs
create mode 100644 src/GovUk.Education.ExploreEducationStatistics.Admin/Migrations/ContentMigrations/20241213112036_EES5738_CreateDataSetFileGeographicLevelsTable.cs
create mode 100644 src/GovUk.Education.ExploreEducationStatistics.Content.Model/DataSetFileGeographicLevels.cs
diff --git a/src/GovUk.Education.ExploreEducationStatistics.Admin/Migrations/ContentMigrations/20241213112036_EES5738_CreateDataSetFileGeographicLevelsTable.Designer.cs b/src/GovUk.Education.ExploreEducationStatistics.Admin/Migrations/ContentMigrations/20241213112036_EES5738_CreateDataSetFileGeographicLevelsTable.Designer.cs
new file mode 100644
index 00000000000..dcc66a1e236
--- /dev/null
+++ b/src/GovUk.Education.ExploreEducationStatistics.Admin/Migrations/ContentMigrations/20241213112036_EES5738_CreateDataSetFileGeographicLevelsTable.Designer.cs
@@ -0,0 +1,2272 @@
+//
+using System;
+using GovUk.Education.ExploreEducationStatistics.Content.Model.Database;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace GovUk.Education.ExploreEducationStatistics.Admin.Migrations.ContentMigrations
+{
+ [DbContext(typeof(ContentDbContext))]
+ [Migration("20241213112036_EES5738_CreateDataSetFileGeographicLevelsTable")]
+ partial class EES5738_CreateDataSetFileGeographicLevelsTable
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.7")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Common.Model.Contact", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContactName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactTelNo")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TeamEmail")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TeamName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Contacts");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Common.Model.FreeTextRank", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Rank")
+ .HasColumnType("int");
+
+ b.ToTable((string)null);
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.Comment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContentBlockId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LegacyCreatedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Resolved")
+ .HasColumnType("datetime2");
+
+ b.Property("ResolvedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContentBlockId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("ResolvedById");
+
+ b.ToTable("Comment");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.ContentBlock", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContentSectionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("Locked")
+ .HasColumnType("datetime2");
+
+ b.Property("LockedById")
+ .IsConcurrencyToken()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Order")
+ .HasColumnType("int");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(25)
+ .HasColumnType("nvarchar(25)");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContentSectionId");
+
+ b.HasIndex("LockedById");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.HasIndex("Type");
+
+ b.ToTable("ContentBlock", (string)null);
+
+ b.HasDiscriminator("Type").HasValue("ContentBlock");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.ContentSection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Caption")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Heading")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Order")
+ .HasColumnType("int");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(25)
+ .HasColumnType("nvarchar(25)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.HasIndex("Type");
+
+ b.ToTable("ContentSections");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.DataBlockParent", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LatestDraftVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LatestPublishedVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LatestDraftVersionId")
+ .IsUnique()
+ .HasFilter("[LatestDraftVersionId] IS NOT NULL");
+
+ b.HasIndex("LatestPublishedVersionId")
+ .IsUnique()
+ .HasFilter("[LatestPublishedVersionId] IS NOT NULL");
+
+ b.ToTable("DataBlocks", (string)null);
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.DataBlockVersion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContentBlockId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("DataBlockParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DataBlockId");
+
+ b.Property("Published")
+ .HasColumnType("datetime2");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContentBlockId");
+
+ b.HasIndex("DataBlockParentId");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.ToTable("DataBlockVersions", (string)null);
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.DataImport", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("ExpectedImportedRows")
+ .HasColumnType("int");
+
+ b.Property("FileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("GeographicLevels")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ImportedRows")
+ .HasColumnType("int");
+
+ b.Property("LastProcessedRowIndex")
+ .HasColumnType("int");
+
+ b.Property("MetaFileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("StagePercentageComplete")
+ .HasColumnType("int");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TotalRows")
+ .HasColumnType("int");
+
+ b.Property("ZipFileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FileId")
+ .IsUnique();
+
+ SqlServerIndexBuilderExtensions.IncludeProperties(b.HasIndex("FileId"), new[] { "Status" });
+
+ b.HasIndex("MetaFileId")
+ .IsUnique();
+
+ b.HasIndex("ZipFileId");
+
+ b.ToTable("DataImports");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.DataImportError", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("DataImportId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Message")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DataImportId");
+
+ b.ToTable("DataImportErrors");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.DataSetFileGeographicLevel", b =>
+ {
+ b.Property("DataSetFileVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("GeographicLevel")
+ .HasColumnType("int");
+
+ b.HasKey("DataSetFileVersionId", "GeographicLevel");
+
+ b.ToTable("DataSetFileGeographicLevels");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.EmbedBlock", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.Property("Url")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("EmbedBlocks");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.FeaturedTable", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DataBlockId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DataBlockParentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Order")
+ .HasColumnType("int");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("DataBlockId")
+ .IsUnique();
+
+ b.HasIndex("DataBlockParentId");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("FeaturedTables");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.File", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContentLength")
+ .HasColumnType("bigint");
+
+ b.Property("ContentType")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("nvarchar(255)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DataSetFileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DataSetFileMeta")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DataSetFileVersion")
+ .HasColumnType("int");
+
+ b.Property("Filename")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ReplacedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ReplacingId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RootPath")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SourceId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(25)
+ .HasColumnType("nvarchar(25)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("ReplacedById")
+ .IsUnique()
+ .HasFilter("[ReplacedById] IS NOT NULL");
+
+ b.HasIndex("ReplacingId")
+ .IsUnique()
+ .HasFilter("[ReplacingId] IS NOT NULL");
+
+ b.HasIndex("SourceId");
+
+ b.HasIndex("Type");
+
+ b.ToTable("Files");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.GlossaryEntry", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Body")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.ToTable("GlossaryEntries");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.KeyStatistic", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("GuidanceText")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("GuidanceTitle")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Order")
+ .HasColumnType("int");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Trend")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("KeyStatistics");
+
+ b.UseTptMappingStrategy();
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.Methodology", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LatestPublishedVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OwningPublicationSlug")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OwningPublicationTitle")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LatestPublishedVersionId")
+ .IsUnique()
+ .HasFilter("[LatestPublishedVersionId] IS NOT NULL");
+
+ b.ToTable("Methodologies");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.MethodologyFile", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("MethodologyVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FileId");
+
+ b.HasIndex("MethodologyVersionId");
+
+ b.ToTable("MethodologyFiles");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.MethodologyNote", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DisplayDate")
+ .HasColumnType("datetime2");
+
+ b.Property("MethodologyVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("MethodologyVersionId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("MethodologyNotes");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.MethodologyRedirect", b =>
+ {
+ b.Property("MethodologyVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Slug")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.HasKey("MethodologyVersionId", "Slug");
+
+ b.ToTable("MethodologyRedirects");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.MethodologyStatus", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ApprovalStatus")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("InternalReleaseNote")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MethodologyVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("MethodologyVersionId");
+
+ b.ToTable("MethodologyStatus");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.MethodologyVersion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AlternativeSlug")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AlternativeTitle")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("MethodologyId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PreviousVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Published")
+ .HasColumnType("datetime2");
+
+ b.Property("PublishingStrategy")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ScheduledWithReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("MethodologyId");
+
+ b.HasIndex("PreviousVersionId");
+
+ b.HasIndex("ScheduledWithReleaseVersionId");
+
+ b.ToTable("MethodologyVersions");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.MethodologyVersionContent", b =>
+ {
+ b.Property("MethodologyVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Annexes")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("MethodologyVersionId");
+
+ b.ToTable("MethodologyVersions", (string)null);
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.Permalink", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("DataSetTitle")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MigratedFromLegacy")
+ .HasColumnType("bit");
+
+ b.Property("PublicationTitle")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.HasIndex("SubjectId");
+
+ b.ToTable("Permalinks");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.Publication", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ContactId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LatestPublishedReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ReleaseSeries")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Summary")
+ .IsRequired()
+ .HasMaxLength(160)
+ .HasColumnType("nvarchar(160)");
+
+ b.Property("SupersededById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ThemeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContactId");
+
+ b.HasIndex("LatestPublishedReleaseVersionId")
+ .IsUnique()
+ .HasFilter("[LatestPublishedReleaseVersionId] IS NOT NULL");
+
+ b.HasIndex("SupersededById");
+
+ b.HasIndex("ThemeId");
+
+ b.ToTable("Publications");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.PublicationMethodology", b =>
+ {
+ b.Property("PublicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("MethodologyId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Owner")
+ .HasColumnType("bit");
+
+ b.HasKey("PublicationId", "MethodologyId");
+
+ b.HasIndex("MethodologyId");
+
+ b.ToTable("PublicationMethodologies");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.PublicationRedirect", b =>
+ {
+ b.Property("PublicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Slug")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.HasKey("PublicationId", "Slug");
+
+ b.ToTable("PublicationRedirects");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.Release", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("Label")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PublicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasMaxLength(81)
+ .HasColumnType("nvarchar(81)");
+
+ b.Property("TimePeriodCoverage")
+ .IsRequired()
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("Updated")
+ .HasColumnType("datetime2");
+
+ b.Property("Year")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PublicationId", "Year", "TimePeriodCoverage", "Label")
+ .IsUnique();
+
+ b.ToTable("Releases");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.ReleaseFile", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FilterSequence")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IndicatorSequence")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Order")
+ .HasColumnType("int");
+
+ b.Property("PublicApiDataSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PublicApiDataSetVersion")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("Published")
+ .HasColumnType("datetime2");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Summary")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FileId");
+
+ b.HasIndex("ReleaseVersionId", "FileId")
+ .IsUnique();
+
+ b.HasIndex("ReleaseVersionId", "PublicApiDataSetId", "PublicApiDataSetVersion")
+ .IsUnique()
+ .HasFilter("[PublicApiDataSetId] IS NOT NULL AND [PublicApiDataSetVersion] IS NOT NULL");
+
+ b.ToTable("ReleaseFiles");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.ReleaseRedirect", b =>
+ {
+ b.Property("ReleaseId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Slug")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.HasKey("ReleaseId", "Slug");
+
+ b.ToTable("ReleaseRedirects");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.ReleaseStatus", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ApprovalStatus")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("InternalReleaseNote")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.ToTable("ReleaseStatus");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.ReleaseVersion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ApprovalStatus")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DataGuidance")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NextReleaseDate")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NotifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("NotifySubscribers")
+ .HasColumnType("bit");
+
+ b.Property("PreReleaseAccessList")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PreviousVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PublicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PublishScheduled")
+ .HasColumnType("datetime2");
+
+ b.Property("Published")
+ .HasColumnType("datetime2");
+
+ b.Property("RelatedInformation")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ReleaseId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ReleaseName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Slug")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SoftDeleted")
+ .HasColumnType("bit");
+
+ b.Property("TimePeriodCoverage")
+ .IsRequired()
+ .HasMaxLength(6)
+ .HasColumnType("nvarchar(6)");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("UpdatePublishedDate")
+ .HasColumnType("bit");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("PublicationId");
+
+ b.HasIndex("ReleaseId");
+
+ b.HasIndex("Type");
+
+ b.HasIndex("PreviousVersionId", "Version");
+
+ b.ToTable("ReleaseVersions");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.Theme", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Slug")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Summary")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Themes");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.Update", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("On")
+ .HasColumnType("datetime2");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ReleaseVersionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("ReleaseVersionId");
+
+ b.ToTable("Update");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Email")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FirstName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SoftDeleted")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DeletedById");
+
+ b.ToTable("Users");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.UserPublicationInvite", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PublicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Role")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("PublicationId");
+
+ b.ToTable("UserPublicationInvites");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.UserPublicationRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Deleted")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedById")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PublicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Role")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("DeletedById");
+
+ b.HasIndex("PublicationId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("UserPublicationRoles");
+ });
+
+ modelBuilder.Entity("GovUk.Education.ExploreEducationStatistics.Content.Model.UserReleaseInvite", b =>
+ {
+ b.Property