diff --git a/MSDF.DataChecker.Migrations.Postgres/MSDF.DataChecker.Migrations.Postgres.csproj b/MSDF.DataChecker.Migrations.Postgres/MSDF.DataChecker.Migrations.Postgres.csproj
new file mode 100644
index 0000000..c43c789
--- /dev/null
+++ b/MSDF.DataChecker.Migrations.Postgres/MSDF.DataChecker.Migrations.Postgres.csproj
@@ -0,0 +1,15 @@
+
+
+
+ net7.0
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MSDF.DataChecker.Migrations.Postgres/Migrations/20230405175832_InitialCreate.Designer.cs b/MSDF.DataChecker.Migrations.Postgres/Migrations/20230405175832_InitialCreate.Designer.cs
new file mode 100644
index 0000000..c0400f4
--- /dev/null
+++ b/MSDF.DataChecker.Migrations.Postgres/Migrations/20230405175832_InitialCreate.Designer.cs
@@ -0,0 +1,591 @@
+//
+using System;
+using MSDF.DataChecker.Persistence.EntityFramework;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace MSDF.DataChecker.Migrations.Postgres.Migrations
+{
+ [DbContext(typeof(DatabaseContext))]
+ [Migration("20230405175832_InitialCreate")]
+ partial class InitialCreate
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.4")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Catalogs.Catalog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CatalogType")
+ .HasMaxLength(350)
+ .HasColumnType("character varying(350)");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasMaxLength(350)
+ .HasColumnType("character varying(350)");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("Catalogs", "core");
+
+ b.HasData(
+ new
+ {
+ Id = 1,
+ CatalogType = "EnvironmentType",
+ Description = "Ed-Fi v2.X",
+ Name = "Ed-Fi v2.X",
+ Updated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
+ },
+ new
+ {
+ Id = 2,
+ CatalogType = "EnvironmentType",
+ Description = "Ed-Fi v3.X",
+ Name = "Ed-Fi v3.X",
+ Updated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
+ },
+ new
+ {
+ Id = 3,
+ CatalogType = "RuleDetailsDestinationType",
+ Description = "EdFiRuleExecutionLogDetails",
+ Name = "EdFiRuleExecutionLogDetails",
+ Updated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
+ });
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Collections.Container", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("ContainerTypeId")
+ .HasColumnType("integer");
+
+ b.Property("CreatedByUserId")
+ .HasColumnType("uuid");
+
+ b.Property("DateUpdated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("EnvironmentType")
+ .HasColumnType("integer");
+
+ b.Property("IsDefault")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentContainerId")
+ .HasColumnType("uuid");
+
+ b.Property("RuleDetailsDestinationId")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerTypeId");
+
+ b.HasIndex("ParentContainerId");
+
+ b.HasIndex("RuleDetailsDestinationId");
+
+ b.ToTable("Containers", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Collections.ContainerType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("ContainerTypes", "core");
+
+ b.HasData(
+ new
+ {
+ Id = 1,
+ Name = "Collection"
+ },
+ new
+ {
+ Id = 2,
+ Name = "Folder"
+ });
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.DatabaseEnvironments.DatabaseEnvironment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DataSource")
+ .HasColumnType("text");
+
+ b.Property("Database")
+ .HasColumnType("text");
+
+ b.Property("ExtraData")
+ .HasColumnType("text");
+
+ b.Property("MapTables")
+ .HasColumnType("text");
+
+ b.Property("MaxNumberResults")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Password")
+ .HasColumnType("text");
+
+ b.Property("SecurityIntegrated")
+ .HasColumnType("boolean");
+
+ b.Property("TimeoutInMinutes")
+ .HasColumnType("integer");
+
+ b.Property("User")
+ .HasColumnType("text");
+
+ b.Property("Version")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.ToTable("DatabaseEnvironments", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Logs.Log", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DateCreated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Information")
+ .HasColumnType("text");
+
+ b.Property("Source")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Logs", "core");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.RuleExecutionLogDetails.EdFiRuleExecutionLogDetail", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CourseCode")
+ .HasColumnType("text");
+
+ b.Property("Discriminator")
+ .HasColumnType("text");
+
+ b.Property("EducationOrganizationId")
+ .HasColumnType("integer");
+
+ b.Property("OtherDetails")
+ .HasColumnType("text");
+
+ b.Property("ProgramName")
+ .HasColumnType("text");
+
+ b.Property("RuleExecutionLogId")
+ .HasColumnType("integer");
+
+ b.Property("StaffUniqueId")
+ .HasColumnType("text");
+
+ b.Property("StudentUniqueId")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RuleExecutionLogId");
+
+ b.ToTable("EdFiRuleExecutionLogDetails", "destination");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.RuleExecutionLogs.RuleExecutionLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DatabaseEnvironmentId")
+ .HasColumnType("uuid");
+
+ b.Property("DetailsSchema")
+ .HasColumnType("text");
+
+ b.Property("DetailsTableName")
+ .HasColumnType("text");
+
+ b.Property("DiagnosticSql")
+ .HasColumnType("text");
+
+ b.Property("Evaluation")
+ .HasColumnType("boolean");
+
+ b.Property("ExecutedSql")
+ .HasColumnType("text");
+
+ b.Property("ExecutionDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ExecutionTimeMs")
+ .HasColumnType("bigint");
+
+ b.Property("Response")
+ .HasColumnType("text");
+
+ b.Property("Result")
+ .HasColumnType("integer");
+
+ b.Property("RuleDetailsDestinationId")
+ .HasColumnType("integer");
+
+ b.Property("RuleId")
+ .HasColumnType("uuid");
+
+ b.Property("StatusId")
+ .HasColumnType("integer");
+
+ b.Property("ValidationRunId")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RuleId");
+
+ b.HasIndex("ValidationRunId");
+
+ b.ToTable("RuleExecutionLogs", "destination");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Rules.Rule", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("ContainerId")
+ .HasColumnType("uuid");
+
+ b.Property("DateUpdated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("DiagnosticSql")
+ .HasColumnType("text");
+
+ b.Property("ErrorMessage")
+ .HasColumnType("text");
+
+ b.Property("ErrorSeverityLevel")
+ .HasColumnType("integer");
+
+ b.Property("MaxNumberResults")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Resolution")
+ .HasColumnType("text");
+
+ b.Property("RuleIdentification")
+ .HasColumnType("text");
+
+ b.Property("Version")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.ToTable("Rules", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Tags.Tag", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("IsPublic")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("Tags", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Tags.TagEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ContainerId")
+ .HasColumnType("uuid");
+
+ b.Property("RuleId")
+ .HasColumnType("uuid");
+
+ b.Property("TagId")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerId");
+
+ b.HasIndex("RuleId");
+
+ b.HasIndex("TagId");
+
+ b.ToTable("TagEntities", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.UserParams.UserParam", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("DatabaseEnvironmentId")
+ .HasColumnType("uuid");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DatabaseEnvironmentId");
+
+ b.ToTable("UserParams", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.ValidationsRun.ValidationRun", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EndTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("HostDatabase")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("HostServer")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("RunStatus")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Source")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("StartTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("ValidationRun", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Collections.Container", b =>
+ {
+ b.HasOne("MSDF.DataChecker.Persistence.Collections.ContainerType", "ContainerType")
+ .WithMany()
+ .HasForeignKey("ContainerTypeId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("MSDF.DataChecker.Persistence.Collections.Container", "ParentContainer")
+ .WithMany("ChildContainers")
+ .HasForeignKey("ParentContainerId");
+
+ b.HasOne("MSDF.DataChecker.Persistence.Catalogs.Catalog", "RuleDetailsDestination")
+ .WithMany()
+ .HasForeignKey("RuleDetailsDestinationId");
+
+ b.Navigation("ContainerType");
+
+ b.Navigation("ParentContainer");
+
+ b.Navigation("RuleDetailsDestination");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.RuleExecutionLogDetails.EdFiRuleExecutionLogDetail", b =>
+ {
+ b.HasOne("MSDF.DataChecker.Persistence.RuleExecutionLogs.RuleExecutionLog", "RuleExecutionLog")
+ .WithMany()
+ .HasForeignKey("RuleExecutionLogId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("RuleExecutionLog");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.RuleExecutionLogs.RuleExecutionLog", b =>
+ {
+ b.HasOne("MSDF.DataChecker.Persistence.Rules.Rule", null)
+ .WithMany("RuleExecutionLogs")
+ .HasForeignKey("RuleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("MSDF.DataChecker.Persistence.ValidationsRun.ValidationRun", "ValidationRun")
+ .WithMany()
+ .HasForeignKey("ValidationRunId");
+
+ b.Navigation("ValidationRun");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Rules.Rule", b =>
+ {
+ b.HasOne("MSDF.DataChecker.Persistence.Collections.Container", null)
+ .WithMany("Rules")
+ .HasForeignKey("ContainerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Tags.TagEntity", b =>
+ {
+ b.HasOne("MSDF.DataChecker.Persistence.Collections.Container", "Container")
+ .WithMany()
+ .HasForeignKey("ContainerId");
+
+ b.HasOne("MSDF.DataChecker.Persistence.Rules.Rule", "Rule")
+ .WithMany()
+ .HasForeignKey("RuleId");
+
+ b.HasOne("MSDF.DataChecker.Persistence.Tags.Tag", "Tag")
+ .WithMany()
+ .HasForeignKey("TagId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Container");
+
+ b.Navigation("Rule");
+
+ b.Navigation("Tag");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.UserParams.UserParam", b =>
+ {
+ b.HasOne("MSDF.DataChecker.Persistence.DatabaseEnvironments.DatabaseEnvironment", null)
+ .WithMany("UserParams")
+ .HasForeignKey("DatabaseEnvironmentId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Collections.Container", b =>
+ {
+ b.Navigation("ChildContainers");
+
+ b.Navigation("Rules");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.DatabaseEnvironments.DatabaseEnvironment", b =>
+ {
+ b.Navigation("UserParams");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Rules.Rule", b =>
+ {
+ b.Navigation("RuleExecutionLogs");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/MSDF.DataChecker.Migrations.Postgres/Migrations/20230405175832_InitialCreate.cs b/MSDF.DataChecker.Migrations.Postgres/Migrations/20230405175832_InitialCreate.cs
new file mode 100644
index 0000000..b827e8a
--- /dev/null
+++ b/MSDF.DataChecker.Migrations.Postgres/Migrations/20230405175832_InitialCreate.cs
@@ -0,0 +1,470 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
+
+namespace MSDF.DataChecker.Migrations.Postgres.Migrations
+{
+ ///
+ public partial class InitialCreate : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.EnsureSchema(
+ name: "core");
+
+ migrationBuilder.EnsureSchema(
+ name: "datachecker");
+
+ migrationBuilder.EnsureSchema(
+ name: "destination");
+
+ migrationBuilder.CreateTable(
+ name: "Catalogs",
+ schema: "core",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ CatalogType = table.Column(type: "character varying(350)", maxLength: 350, nullable: true),
+ Name = table.Column(type: "character varying(350)", maxLength: 350, nullable: true),
+ Description = table.Column(type: "text", nullable: true),
+ Updated = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Catalogs", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ContainerTypes",
+ schema: "core",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Name = table.Column(type: "text", nullable: true),
+ Description = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ContainerTypes", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "DatabaseEnvironments",
+ schema: "datachecker",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ Version = table.Column(type: "integer", nullable: false),
+ Database = table.Column(type: "text", nullable: true),
+ User = table.Column(type: "text", nullable: true),
+ Password = table.Column(type: "text", nullable: true),
+ DataSource = table.Column(type: "text", nullable: true),
+ ExtraData = table.Column(type: "text", nullable: true),
+ MapTables = table.Column(type: "text", nullable: true),
+ CreatedDate = table.Column(type: "timestamp with time zone", nullable: false),
+ SecurityIntegrated = table.Column(type: "boolean", nullable: true),
+ MaxNumberResults = table.Column(type: "integer", nullable: true),
+ TimeoutInMinutes = table.Column(type: "integer", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_DatabaseEnvironments", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Logs",
+ schema: "core",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Information = table.Column(type: "text", nullable: true),
+ Source = table.Column(type: "text", nullable: true),
+ DateCreated = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Logs", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Tags",
+ schema: "datachecker",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Name = table.Column(type: "text", nullable: true),
+ Description = table.Column(type: "text", nullable: true),
+ IsPublic = table.Column(type: "boolean", nullable: false),
+ Created = table.Column(type: "timestamp with time zone", nullable: false),
+ Updated = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Tags", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ValidationRun",
+ schema: "datachecker",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ RunStatus = table.Column(type: "text", nullable: false),
+ HostServer = table.Column(type: "text", nullable: false),
+ HostDatabase = table.Column(type: "text", nullable: false),
+ Source = table.Column(type: "text", nullable: false),
+ StartTime = table.Column(type: "timestamp with time zone", nullable: false),
+ EndTime = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ValidationRun", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Containers",
+ schema: "datachecker",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ ContainerTypeId = table.Column(type: "integer", nullable: false),
+ CreatedByUserId = table.Column(type: "uuid", nullable: true),
+ ParentContainerId = table.Column(type: "uuid", nullable: true),
+ IsDefault = table.Column(type: "boolean", nullable: false),
+ Description = table.Column(type: "text", nullable: true),
+ EnvironmentType = table.Column(type: "integer", nullable: false),
+ RuleDetailsDestinationId = table.Column(type: "integer", nullable: true),
+ DateUpdated = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Containers", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Containers_Catalogs_RuleDetailsDestinationId",
+ column: x => x.RuleDetailsDestinationId,
+ principalSchema: "core",
+ principalTable: "Catalogs",
+ principalColumn: "Id");
+ table.ForeignKey(
+ name: "FK_Containers_ContainerTypes_ContainerTypeId",
+ column: x => x.ContainerTypeId,
+ principalSchema: "core",
+ principalTable: "ContainerTypes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_Containers_Containers_ParentContainerId",
+ column: x => x.ParentContainerId,
+ principalSchema: "datachecker",
+ principalTable: "Containers",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateTable(
+ name: "UserParams",
+ schema: "datachecker",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ Value = table.Column(type: "text", nullable: true),
+ DatabaseEnvironmentId = table.Column(type: "uuid", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_UserParams", x => x.Id);
+ table.ForeignKey(
+ name: "FK_UserParams_DatabaseEnvironments_DatabaseEnvironmentId",
+ column: x => x.DatabaseEnvironmentId,
+ principalSchema: "datachecker",
+ principalTable: "DatabaseEnvironments",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Rules",
+ schema: "datachecker",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ ContainerId = table.Column(type: "uuid", nullable: false),
+ Name = table.Column(type: "text", nullable: true),
+ Description = table.Column(type: "text", nullable: true),
+ ErrorMessage = table.Column(type: "text", nullable: true),
+ ErrorSeverityLevel = table.Column(type: "integer", nullable: false),
+ Resolution = table.Column(type: "text", nullable: true),
+ DiagnosticSql = table.Column(type: "text", nullable: true),
+ Version = table.Column(type: "text", nullable: true),
+ RuleIdentification = table.Column(type: "text", nullable: true),
+ MaxNumberResults = table.Column(type: "integer", nullable: true),
+ DateUpdated = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Rules", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Rules_Containers_ContainerId",
+ column: x => x.ContainerId,
+ principalSchema: "datachecker",
+ principalTable: "Containers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "RuleExecutionLogs",
+ schema: "destination",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ RuleId = table.Column(type: "uuid", nullable: false),
+ DatabaseEnvironmentId = table.Column(type: "uuid", nullable: false),
+ Response = table.Column(type: "text", nullable: true),
+ Result = table.Column(type: "integer", nullable: false),
+ Evaluation = table.Column(type: "boolean", nullable: false),
+ StatusId = table.Column(type: "integer", nullable: false),
+ ExecutionDate = table.Column(type: "timestamp with time zone", nullable: false),
+ ExecutionTimeMs = table.Column(type: "bigint", nullable: false),
+ ExecutedSql = table.Column(type: "text", nullable: true),
+ DiagnosticSql = table.Column(type: "text", nullable: true),
+ RuleDetailsDestinationId = table.Column(type: "integer", nullable: true),
+ DetailsSchema = table.Column(type: "text", nullable: true),
+ DetailsTableName = table.Column(type: "text", nullable: true),
+ ValidationRunId = table.Column(type: "integer", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_RuleExecutionLogs", x => x.Id);
+ table.ForeignKey(
+ name: "FK_RuleExecutionLogs_Rules_RuleId",
+ column: x => x.RuleId,
+ principalSchema: "datachecker",
+ principalTable: "Rules",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_RuleExecutionLogs_ValidationRun_ValidationRunId",
+ column: x => x.ValidationRunId,
+ principalSchema: "datachecker",
+ principalTable: "ValidationRun",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateTable(
+ name: "TagEntities",
+ schema: "datachecker",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ TagId = table.Column(type: "integer", nullable: false),
+ ContainerId = table.Column(type: "uuid", nullable: true),
+ RuleId = table.Column(type: "uuid", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_TagEntities", x => x.Id);
+ table.ForeignKey(
+ name: "FK_TagEntities_Containers_ContainerId",
+ column: x => x.ContainerId,
+ principalSchema: "datachecker",
+ principalTable: "Containers",
+ principalColumn: "Id");
+ table.ForeignKey(
+ name: "FK_TagEntities_Rules_RuleId",
+ column: x => x.RuleId,
+ principalSchema: "datachecker",
+ principalTable: "Rules",
+ principalColumn: "Id");
+ table.ForeignKey(
+ name: "FK_TagEntities_Tags_TagId",
+ column: x => x.TagId,
+ principalSchema: "datachecker",
+ principalTable: "Tags",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "EdFiRuleExecutionLogDetails",
+ schema: "destination",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ EducationOrganizationId = table.Column(type: "integer", nullable: true),
+ StudentUniqueId = table.Column(type: "text", nullable: true),
+ CourseCode = table.Column(type: "text", nullable: true),
+ Discriminator = table.Column(type: "text", nullable: true),
+ ProgramName = table.Column(type: "text", nullable: true),
+ StaffUniqueId = table.Column(type: "text", nullable: true),
+ OtherDetails = table.Column(type: "text", nullable: true),
+ RuleExecutionLogId = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_EdFiRuleExecutionLogDetails", x => x.Id);
+ table.ForeignKey(
+ name: "FK_EdFiRuleExecutionLogDetails_RuleExecutionLogs_RuleExecution~",
+ column: x => x.RuleExecutionLogId,
+ principalSchema: "destination",
+ principalTable: "RuleExecutionLogs",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.InsertData(
+ schema: "core",
+ table: "Catalogs",
+ columns: new[] { "Id", "CatalogType", "Description", "Name", "Updated" },
+ values: new object[,]
+ {
+ { 1, "EnvironmentType", "Ed-Fi v2.X", "Ed-Fi v2.X", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
+ { 2, "EnvironmentType", "Ed-Fi v3.X", "Ed-Fi v3.X", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
+ { 3, "RuleDetailsDestinationType", "EdFiRuleExecutionLogDetails", "EdFiRuleExecutionLogDetails", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }
+ });
+
+ migrationBuilder.InsertData(
+ schema: "core",
+ table: "ContainerTypes",
+ columns: new[] { "Id", "Description", "Name" },
+ values: new object[,]
+ {
+ { 1, null, "Collection" },
+ { 2, null, "Folder" }
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Containers_ContainerTypeId",
+ schema: "datachecker",
+ table: "Containers",
+ column: "ContainerTypeId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Containers_ParentContainerId",
+ schema: "datachecker",
+ table: "Containers",
+ column: "ParentContainerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Containers_RuleDetailsDestinationId",
+ schema: "datachecker",
+ table: "Containers",
+ column: "RuleDetailsDestinationId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_EdFiRuleExecutionLogDetails_RuleExecutionLogId",
+ schema: "destination",
+ table: "EdFiRuleExecutionLogDetails",
+ column: "RuleExecutionLogId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_RuleExecutionLogs_RuleId",
+ schema: "destination",
+ table: "RuleExecutionLogs",
+ column: "RuleId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_RuleExecutionLogs_ValidationRunId",
+ schema: "destination",
+ table: "RuleExecutionLogs",
+ column: "ValidationRunId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Rules_ContainerId",
+ schema: "datachecker",
+ table: "Rules",
+ column: "ContainerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_TagEntities_ContainerId",
+ schema: "datachecker",
+ table: "TagEntities",
+ column: "ContainerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_TagEntities_RuleId",
+ schema: "datachecker",
+ table: "TagEntities",
+ column: "RuleId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_TagEntities_TagId",
+ schema: "datachecker",
+ table: "TagEntities",
+ column: "TagId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_UserParams_DatabaseEnvironmentId",
+ schema: "datachecker",
+ table: "UserParams",
+ column: "DatabaseEnvironmentId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "EdFiRuleExecutionLogDetails",
+ schema: "destination");
+
+ migrationBuilder.DropTable(
+ name: "Logs",
+ schema: "core");
+
+ migrationBuilder.DropTable(
+ name: "TagEntities",
+ schema: "datachecker");
+
+ migrationBuilder.DropTable(
+ name: "UserParams",
+ schema: "datachecker");
+
+ migrationBuilder.DropTable(
+ name: "RuleExecutionLogs",
+ schema: "destination");
+
+ migrationBuilder.DropTable(
+ name: "Tags",
+ schema: "datachecker");
+
+ migrationBuilder.DropTable(
+ name: "DatabaseEnvironments",
+ schema: "datachecker");
+
+ migrationBuilder.DropTable(
+ name: "Rules",
+ schema: "datachecker");
+
+ migrationBuilder.DropTable(
+ name: "ValidationRun",
+ schema: "datachecker");
+
+ migrationBuilder.DropTable(
+ name: "Containers",
+ schema: "datachecker");
+
+ migrationBuilder.DropTable(
+ name: "Catalogs",
+ schema: "core");
+
+ migrationBuilder.DropTable(
+ name: "ContainerTypes",
+ schema: "core");
+ }
+ }
+}
diff --git a/MSDF.DataChecker.Migrations.Postgres/Migrations/DatabaseContextModelSnapshot.cs b/MSDF.DataChecker.Migrations.Postgres/Migrations/DatabaseContextModelSnapshot.cs
new file mode 100644
index 0000000..46b722e
--- /dev/null
+++ b/MSDF.DataChecker.Migrations.Postgres/Migrations/DatabaseContextModelSnapshot.cs
@@ -0,0 +1,588 @@
+//
+using System;
+using MSDF.DataChecker.Persistence.EntityFramework;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace MSDF.DataChecker.Migrations.Postgres.Migrations
+{
+ [DbContext(typeof(DatabaseContext))]
+ partial class DatabaseContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.4")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Catalogs.Catalog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CatalogType")
+ .HasMaxLength(350)
+ .HasColumnType("character varying(350)");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasMaxLength(350)
+ .HasColumnType("character varying(350)");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("Catalogs", "core");
+
+ b.HasData(
+ new
+ {
+ Id = 1,
+ CatalogType = "EnvironmentType",
+ Description = "Ed-Fi v2.X",
+ Name = "Ed-Fi v2.X",
+ Updated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
+ },
+ new
+ {
+ Id = 2,
+ CatalogType = "EnvironmentType",
+ Description = "Ed-Fi v3.X",
+ Name = "Ed-Fi v3.X",
+ Updated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
+ },
+ new
+ {
+ Id = 3,
+ CatalogType = "RuleDetailsDestinationType",
+ Description = "EdFiRuleExecutionLogDetails",
+ Name = "EdFiRuleExecutionLogDetails",
+ Updated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
+ });
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Collections.Container", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("ContainerTypeId")
+ .HasColumnType("integer");
+
+ b.Property("CreatedByUserId")
+ .HasColumnType("uuid");
+
+ b.Property("DateUpdated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("EnvironmentType")
+ .HasColumnType("integer");
+
+ b.Property("IsDefault")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("ParentContainerId")
+ .HasColumnType("uuid");
+
+ b.Property("RuleDetailsDestinationId")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ContainerTypeId");
+
+ b.HasIndex("ParentContainerId");
+
+ b.HasIndex("RuleDetailsDestinationId");
+
+ b.ToTable("Containers", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Collections.ContainerType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("ContainerTypes", "core");
+
+ b.HasData(
+ new
+ {
+ Id = 1,
+ Name = "Collection"
+ },
+ new
+ {
+ Id = 2,
+ Name = "Folder"
+ });
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.DatabaseEnvironments.DatabaseEnvironment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DataSource")
+ .HasColumnType("text");
+
+ b.Property("Database")
+ .HasColumnType("text");
+
+ b.Property("ExtraData")
+ .HasColumnType("text");
+
+ b.Property("MapTables")
+ .HasColumnType("text");
+
+ b.Property("MaxNumberResults")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Password")
+ .HasColumnType("text");
+
+ b.Property("SecurityIntegrated")
+ .HasColumnType("boolean");
+
+ b.Property("TimeoutInMinutes")
+ .HasColumnType("integer");
+
+ b.Property("User")
+ .HasColumnType("text");
+
+ b.Property("Version")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.ToTable("DatabaseEnvironments", "datachecker");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.Logs.Log", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DateCreated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Information")
+ .HasColumnType("text");
+
+ b.Property("Source")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Logs", "core");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.RuleExecutionLogDetails.EdFiRuleExecutionLogDetail", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CourseCode")
+ .HasColumnType("text");
+
+ b.Property("Discriminator")
+ .HasColumnType("text");
+
+ b.Property("EducationOrganizationId")
+ .HasColumnType("integer");
+
+ b.Property("OtherDetails")
+ .HasColumnType("text");
+
+ b.Property("ProgramName")
+ .HasColumnType("text");
+
+ b.Property("RuleExecutionLogId")
+ .HasColumnType("integer");
+
+ b.Property("StaffUniqueId")
+ .HasColumnType("text");
+
+ b.Property("StudentUniqueId")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RuleExecutionLogId");
+
+ b.ToTable("EdFiRuleExecutionLogDetails", "destination");
+ });
+
+ modelBuilder.Entity("MSDF.DataChecker.Persistence.RuleExecutionLogs.RuleExecutionLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DatabaseEnvironmentId")
+ .HasColumnType("uuid");
+
+ b.Property("DetailsSchema")
+ .HasColumnType("text");
+
+ b.Property("DetailsTableName")
+ .HasColumnType("text");
+
+ b.Property("DiagnosticSql")
+ .HasColumnType("text");
+
+ b.Property("Evaluation")
+ .HasColumnType("boolean");
+
+ b.Property("ExecutedSql")
+ .HasColumnType("text");
+
+ b.Property("ExecutionDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ExecutionTimeMs")
+ .HasColumnType("bigint");
+
+ b.Property("Response")
+ .HasColumnType("text");
+
+ b.Property("Result")
+ .HasColumnType("integer");
+
+ b.Property("RuleDetailsDestinationId")
+ .HasColumnType("integer");
+
+ b.Property("RuleId")
+ .HasColumnType("uuid");
+
+ b.Property