From dba6d819ce7c9195e44a530ec6dc98c7811fbae7 Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Wed, 11 Oct 2023 15:50:15 -0500 Subject: [PATCH 1/3] Add ASL columns to Video Table --- .../20231011192212_aslvideo3.Designer.cs | 1887 +++++++++++++++++ .../Migrations/20231011192212_aslvideo3.cs | 82 + .../Migrations/CTDbContextModelSnapshot.cs | 21 + ClassTranscribeDatabase/Models/Models.cs | 8 + 4 files changed, 1998 insertions(+) create mode 100644 ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.Designer.cs create mode 100644 ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.cs diff --git a/ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.Designer.cs b/ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.Designer.cs new file mode 100644 index 0000000..9fe03af --- /dev/null +++ b/ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.Designer.cs @@ -0,0 +1,1887 @@ +// +using System; +using ClassTranscribeDatabase; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +namespace ClassTranscribeDatabase.Migrations +{ + [DbContext(typeof(CTDbContext))] + [Migration("20231011192212_aslvideo3")] + partial class aslvideo3 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ASLVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("DownloadURL") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Kind") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LicenseTag") + .HasColumnType("text"); + + b.Property("Likes") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("text"); + + b.Property("Term") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.Property("UniqueASLIdentifier") + .HasColumnType("text"); + + b.Property("WebsiteURL") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ASLVideos"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ASLVideoGlossaryMap", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ASLVideoId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("GlossaryId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Published") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("ASLVideoGlossaryMaps"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Metadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("NormalizedEmail") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.Property("UserName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.HasIndex("UniversityId"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Caption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Begin") + .HasColumnType("interval"); + + b.Property("CaptionType") + .HasColumnType("integer"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("DownVote") + .HasColumnType("integer"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.Property("TranscriptionId") + .HasColumnType("text"); + + b.Property("UpVote") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TranscriptionId"); + + b.ToTable("Captions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Course", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CourseNumber") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("DepartmentId") + .HasColumnType("text"); + + b.Property("FilePath") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.ToTable("Courses"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.CourseOffering", b => + { + b.Property("CourseId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("FilePath") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("CourseId", "OfferingId"); + + b.HasIndex("OfferingId"); + + b.ToTable("CourseOfferings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Department", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Acronym") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UniversityId"); + + b.ToTable("Departments"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Dictionary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Dictionaries"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.EPub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Author") + .HasColumnType("text"); + + b.Property("Chapters") + .HasColumnType("text"); + + b.Property("Cover") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Filename") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("Publisher") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("VideoId"); + + b.ToTable("EPubs"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.FileRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("FileName") + .HasColumnType("text"); + + b.Property("Hash") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PrivatePath") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("FileRecords"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Glossary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CourseId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("Editable") + .HasColumnType("boolean"); + + b.Property("Explanation") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LicenseTag") + .HasColumnType("text"); + + b.Property("Likes") + .HasColumnType("integer"); + + b.Property("Link") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("Shared") + .HasColumnType("boolean"); + + b.Property("Source") + .HasColumnType("text"); + + b.Property("Term") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CourseId", "OfferingId"); + + b.ToTable("Glossaries"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("ImageFileId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ImageFileId"); + + b.ToTable("Images"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Log", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EventType") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Json") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Logs"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("PlaylistId") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("UniqueMediaIdentifier") + .HasColumnType("text"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PlaylistId"); + + b.HasIndex("VideoId"); + + b.ToTable("Medias"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Ack") + .HasColumnType("integer"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LogLevel") + .HasColumnType("integer"); + + b.Property("Payload") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Offering", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AccessType") + .HasColumnType("integer"); + + b.Property("CourseName") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LogEventsFlag") + .HasColumnType("boolean"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SectionName") + .HasColumnType("text"); + + b.Property("TermId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TermId"); + + b.ToTable("Offerings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Playlist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("ListCheckedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ListUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("PlaylistIdentifier") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OfferingId"); + + b.ToTable("Playlists"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Subscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("ResourceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResourceType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasAlternateKey("ResourceType", "ResourceId", "ApplicationUserId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Subscriptions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.TaskItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AncestorTaskItemId") + .HasColumnType("text"); + + b.Property("AttemptNumber") + .HasColumnType("integer"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DebugMessage") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EndedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("EstimatedCompletionAt") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OfferingId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OpaqueMessageRef") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentTaskItemId") + .HasColumnType("text"); + + b.Property("PercentComplete") + .HasColumnType("integer"); + + b.Property("PlaylistId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PreviousAttemptTaskItemId") + .HasColumnType("text"); + + b.Property("QueuedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemoteResultData") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResultData") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rule") + .IsRequired() + .HasColumnType("text"); + + b.Property("StartedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("TaskParameters") + .IsRequired() + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TaskType") + .HasColumnType("integer"); + + b.Property("UniqueId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("VideoId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasAlternateKey("MediaId"); + + b.HasAlternateKey("OfferingId"); + + b.HasAlternateKey("OpaqueMessageRef"); + + b.HasAlternateKey("PlaylistId"); + + b.HasAlternateKey("Rule"); + + b.HasAlternateKey("UserId"); + + b.HasAlternateKey("VideoId"); + + b.HasAlternateKey("UniqueId", "TaskType"); + + b.ToTable("TaskItems"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EndDate") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("timestamp without time zone"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UniversityId"); + + b.ToTable("Terms"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.TextData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TextData"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Transcription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Editable") + .HasColumnType("integer"); + + b.Property("FileId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Label") + .HasColumnType("text"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceInternalRef") + .HasColumnType("text"); + + b.Property("SourceLabel") + .HasColumnType("text"); + + b.Property("SrtFileId") + .HasColumnType("text"); + + b.Property("TranscriptionType") + .HasColumnType("integer"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("SrtFileId"); + + b.HasIndex("VideoId"); + + b.ToTable("Transcriptions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.University", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Universities"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.UserOffering", b => + { + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("IdentityRoleId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("ApplicationUserId", "OfferingId", "IdentityRoleId"); + + b.HasIndex("IdentityRoleId"); + + b.HasIndex("OfferingId"); + + b.ToTable("UserOfferings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Video", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ASLVideoId") + .HasColumnType("text"); + + b.Property("AudioId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Duration") + .HasColumnType("interval"); + + b.Property("FileMediaInfo") + .IsRequired() + .HasColumnType("text"); + + b.Property("Glossary") + .IsRequired() + .HasColumnType("text"); + + b.Property("GlossaryDataId") + .HasColumnType("text"); + + b.Property("GlossaryTimestampId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PhraseHints") + .HasColumnType("text"); + + b.Property("PhraseHintsDataId") + .HasColumnType("text"); + + b.Property("ProcessedASLVideoId") + .HasColumnType("text"); + + b.Property("ProcessedVideo1Id") + .HasColumnType("text"); + + b.Property("ProcessedVideo2Id") + .HasColumnType("text"); + + b.Property("ProcessingLog") + .HasColumnType("text"); + + b.Property("SceneData") + .IsRequired() + .HasColumnType("text"); + + b.Property("SceneObjectDataId") + .HasColumnType("text"); + + b.Property("TranscribingAttempts") + .HasColumnType("integer"); + + b.Property("TranscriptionStatus") + .HasColumnType("text"); + + b.Property("Video1Id") + .HasColumnType("text"); + + b.Property("Video2Id") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ASLVideoId"); + + b.HasIndex("AudioId"); + + b.HasIndex("ProcessedASLVideoId"); + + b.HasIndex("ProcessedVideo1Id"); + + b.HasIndex("ProcessedVideo2Id"); + + b.HasIndex("Video1Id"); + + b.HasIndex("Video2Id"); + + b.ToTable("Videos"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.WatchHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Json") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("MediaId"); + + b.ToTable("WatchHistories"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ApplicationUser", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany() + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Caption", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Transcription", "Transcription") + .WithMany("Captions") + .HasForeignKey("TranscriptionId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Course", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Department", "Department") + .WithMany("Courses") + .HasForeignKey("DepartmentId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.CourseOffering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Course", "Course") + .WithMany("CourseOfferings") + .HasForeignKey("CourseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("CourseOfferings") + .HasForeignKey("OfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Department", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany("Departments") + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.EPub", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Video", null) + .WithMany("EPubs") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Glossary", b => + { + b.HasOne("ClassTranscribeDatabase.Models.CourseOffering", "CourseOffering") + .WithMany("Glossaries") + .HasForeignKey("CourseId", "OfferingId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Image", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ImageFile") + .WithMany() + .HasForeignKey("ImageFileId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Media", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Playlist", "Playlist") + .WithMany("Medias") + .HasForeignKey("PlaylistId"); + + b.HasOne("ClassTranscribeDatabase.Models.Video", "Video") + .WithMany("Medias") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Message", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Offering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Term", "Term") + .WithMany("Offerings") + .HasForeignKey("TermId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Playlist", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("Playlists") + .HasForeignKey("OfferingId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Subscription", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Term", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany("Terms") + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Transcription", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "File") + .WithMany() + .HasForeignKey("FileId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "SrtFile") + .WithMany() + .HasForeignKey("SrtFileId"); + + b.HasOne("ClassTranscribeDatabase.Models.Video", "Video") + .WithMany("Transcriptions") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.UserOffering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany("UserOfferings") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", "IdentityRole") + .WithMany() + .HasForeignKey("IdentityRoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("OfferingUsers") + .HasForeignKey("OfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Video", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ASLVideo") + .WithMany() + .HasForeignKey("ASLVideoId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Audio") + .WithMany() + .HasForeignKey("AudioId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedASLVideo") + .WithMany() + .HasForeignKey("ProcessedASLVideoId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedVideo1") + .WithMany() + .HasForeignKey("ProcessedVideo1Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedVideo2") + .WithMany() + .HasForeignKey("ProcessedVideo2Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Video1") + .WithMany() + .HasForeignKey("Video1Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Video2") + .WithMany() + .HasForeignKey("Video2Id"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.WatchHistory", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + + b.HasOne("ClassTranscribeDatabase.Models.Media", "Media") + .WithMany("WatchHistories") + .HasForeignKey("MediaId"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.cs b/ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.cs new file mode 100644 index 0000000..a555b33 --- /dev/null +++ b/ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.cs @@ -0,0 +1,82 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ClassTranscribeDatabase.Migrations +{ + public partial class aslvideo3 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ASLVideoId", + table: "Videos", + nullable: true); + + migrationBuilder.AddColumn( + name: "ProcessedASLVideoId", + table: "Videos", + nullable: true); + + migrationBuilder.AddColumn( + name: "ProcessingLog", + table: "Videos", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_Videos_ASLVideoId", + table: "Videos", + column: "ASLVideoId"); + + migrationBuilder.CreateIndex( + name: "IX_Videos_ProcessedASLVideoId", + table: "Videos", + column: "ProcessedASLVideoId"); + + migrationBuilder.AddForeignKey( + name: "FK_Videos_FileRecords_ASLVideoId", + table: "Videos", + column: "ASLVideoId", + principalTable: "FileRecords", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Videos_FileRecords_ProcessedASLVideoId", + table: "Videos", + column: "ProcessedASLVideoId", + principalTable: "FileRecords", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Videos_FileRecords_ASLVideoId", + table: "Videos"); + + migrationBuilder.DropForeignKey( + name: "FK_Videos_FileRecords_ProcessedASLVideoId", + table: "Videos"); + + migrationBuilder.DropIndex( + name: "IX_Videos_ASLVideoId", + table: "Videos"); + + migrationBuilder.DropIndex( + name: "IX_Videos_ProcessedASLVideoId", + table: "Videos"); + + migrationBuilder.DropColumn( + name: "ASLVideoId", + table: "Videos"); + + migrationBuilder.DropColumn( + name: "ProcessedASLVideoId", + table: "Videos"); + + migrationBuilder.DropColumn( + name: "ProcessingLog", + table: "Videos"); + } + } +} diff --git a/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs b/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs index bb776f0..961cc86 100644 --- a/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs +++ b/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs @@ -1356,6 +1356,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("text"); + b.Property("ASLVideoId") + .HasColumnType("text"); + b.Property("AudioId") .HasColumnType("text"); @@ -1410,12 +1413,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("PhraseHintsDataId") .HasColumnType("text"); + b.Property("ProcessedASLVideoId") + .HasColumnType("text"); + b.Property("ProcessedVideo1Id") .HasColumnType("text"); b.Property("ProcessedVideo2Id") .HasColumnType("text"); + b.Property("ProcessingLog") + .HasColumnType("text"); + b.Property("SceneData") .IsRequired() .HasColumnType("text"); @@ -1437,8 +1446,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("ASLVideoId"); + b.HasIndex("AudioId"); + b.HasIndex("ProcessedASLVideoId"); + b.HasIndex("ProcessedVideo1Id"); b.HasIndex("ProcessedVideo2Id"); @@ -1776,10 +1789,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("ClassTranscribeDatabase.Models.Video", b => { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ASLVideo") + .WithMany() + .HasForeignKey("ASLVideoId"); + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Audio") .WithMany() .HasForeignKey("AudioId"); + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedASLVideo") + .WithMany() + .HasForeignKey("ProcessedASLVideoId"); + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedVideo1") .WithMany() .HasForeignKey("ProcessedVideo1Id"); diff --git a/ClassTranscribeDatabase/Models/Models.cs b/ClassTranscribeDatabase/Models/Models.cs index 16d0aa4..fc425d9 100644 --- a/ClassTranscribeDatabase/Models/Models.cs +++ b/ClassTranscribeDatabase/Models/Models.cs @@ -319,6 +319,14 @@ public class Video : Entity public string AudioId { get; set; } public virtual FileRecord Audio { get; set; } + [ForeignKey("ASLVideo")] + public string ASLVideoId { get; set; } + public virtual FileRecord ASLVideo { get; set; } + + [ForeignKey("ProcessedASLVideo")] + public string ProcessedASLVideoId { get; set; } + public virtual FileRecord ProcessedASLVideo { get; set; } + public string ProcessingLog { get; set; } public string Description { get; set; } public virtual List Medias { get; set; } public string TranscriptionStatus { get; set; } From 9e62f9651f567ff72d1af2f4bf7d8a46dd3874cc Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Thu, 12 Oct 2023 14:57:18 -0500 Subject: [PATCH 2/3] Video work: ASL stream + Processed Videos+ Log in api DTOs and database --- .../20231012191610_TaskLogString.Designer.cs | 1887 +++++++++++++++++ .../20231012191610_TaskLogString.cs | 32 + .../Migrations/CTDbContextModelSnapshot.cs | 6 +- ClassTranscribeDatabase/Models/Models.cs | 3 +- .../Controllers/MediaController.cs | 79 +- .../Controllers/PlaylistsController.cs | 8 +- 6 files changed, 2004 insertions(+), 11 deletions(-) create mode 100644 ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.Designer.cs create mode 100644 ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.cs diff --git a/ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.Designer.cs b/ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.Designer.cs new file mode 100644 index 0000000..d19e948 --- /dev/null +++ b/ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.Designer.cs @@ -0,0 +1,1887 @@ +// +using System; +using ClassTranscribeDatabase; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +namespace ClassTranscribeDatabase.Migrations +{ + [DbContext(typeof(CTDbContext))] + [Migration("20231012191610_TaskLogString")] + partial class TaskLogString + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ASLVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("DownloadURL") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Kind") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LicenseTag") + .HasColumnType("text"); + + b.Property("Likes") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("text"); + + b.Property("Term") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.Property("UniqueASLIdentifier") + .HasColumnType("text"); + + b.Property("WebsiteURL") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ASLVideos"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ASLVideoGlossaryMap", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ASLVideoId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("GlossaryId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Published") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("ASLVideoGlossaryMaps"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Metadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("NormalizedEmail") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.Property("UserName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.HasIndex("UniversityId"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Caption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Begin") + .HasColumnType("interval"); + + b.Property("CaptionType") + .HasColumnType("integer"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("DownVote") + .HasColumnType("integer"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.Property("TranscriptionId") + .HasColumnType("text"); + + b.Property("UpVote") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TranscriptionId"); + + b.ToTable("Captions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Course", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CourseNumber") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("DepartmentId") + .HasColumnType("text"); + + b.Property("FilePath") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.ToTable("Courses"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.CourseOffering", b => + { + b.Property("CourseId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("FilePath") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("CourseId", "OfferingId"); + + b.HasIndex("OfferingId"); + + b.ToTable("CourseOfferings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Department", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Acronym") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UniversityId"); + + b.ToTable("Departments"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Dictionary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Dictionaries"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.EPub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Author") + .HasColumnType("text"); + + b.Property("Chapters") + .HasColumnType("text"); + + b.Property("Cover") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Filename") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("Publisher") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("VideoId"); + + b.ToTable("EPubs"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.FileRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("FileName") + .HasColumnType("text"); + + b.Property("Hash") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PrivatePath") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("FileRecords"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Glossary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CourseId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("Editable") + .HasColumnType("boolean"); + + b.Property("Explanation") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LicenseTag") + .HasColumnType("text"); + + b.Property("Likes") + .HasColumnType("integer"); + + b.Property("Link") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("Shared") + .HasColumnType("boolean"); + + b.Property("Source") + .HasColumnType("text"); + + b.Property("Term") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CourseId", "OfferingId"); + + b.ToTable("Glossaries"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("ImageFileId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ImageFileId"); + + b.ToTable("Images"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Log", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EventType") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Json") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Logs"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("PlaylistId") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("UniqueMediaIdentifier") + .HasColumnType("text"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PlaylistId"); + + b.HasIndex("VideoId"); + + b.ToTable("Medias"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Ack") + .HasColumnType("integer"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LogLevel") + .HasColumnType("integer"); + + b.Property("Payload") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Offering", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AccessType") + .HasColumnType("integer"); + + b.Property("CourseName") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LogEventsFlag") + .HasColumnType("boolean"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SectionName") + .HasColumnType("text"); + + b.Property("TermId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TermId"); + + b.ToTable("Offerings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Playlist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("ListCheckedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ListUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("PlaylistIdentifier") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OfferingId"); + + b.ToTable("Playlists"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Subscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("ResourceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResourceType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasAlternateKey("ResourceType", "ResourceId", "ApplicationUserId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Subscriptions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.TaskItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AncestorTaskItemId") + .HasColumnType("text"); + + b.Property("AttemptNumber") + .HasColumnType("integer"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DebugMessage") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EndedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("EstimatedCompletionAt") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OfferingId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OpaqueMessageRef") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentTaskItemId") + .HasColumnType("text"); + + b.Property("PercentComplete") + .HasColumnType("integer"); + + b.Property("PlaylistId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PreviousAttemptTaskItemId") + .HasColumnType("text"); + + b.Property("QueuedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemoteResultData") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResultData") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rule") + .IsRequired() + .HasColumnType("text"); + + b.Property("StartedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("TaskParameters") + .IsRequired() + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TaskType") + .HasColumnType("integer"); + + b.Property("UniqueId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("VideoId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasAlternateKey("MediaId"); + + b.HasAlternateKey("OfferingId"); + + b.HasAlternateKey("OpaqueMessageRef"); + + b.HasAlternateKey("PlaylistId"); + + b.HasAlternateKey("Rule"); + + b.HasAlternateKey("UserId"); + + b.HasAlternateKey("VideoId"); + + b.HasAlternateKey("UniqueId", "TaskType"); + + b.ToTable("TaskItems"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EndDate") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("timestamp without time zone"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UniversityId"); + + b.ToTable("Terms"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.TextData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TextData"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Transcription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Editable") + .HasColumnType("integer"); + + b.Property("FileId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Label") + .HasColumnType("text"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceInternalRef") + .HasColumnType("text"); + + b.Property("SourceLabel") + .HasColumnType("text"); + + b.Property("SrtFileId") + .HasColumnType("text"); + + b.Property("TranscriptionType") + .HasColumnType("integer"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("SrtFileId"); + + b.HasIndex("VideoId"); + + b.ToTable("Transcriptions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.University", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Universities"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.UserOffering", b => + { + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("IdentityRoleId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("ApplicationUserId", "OfferingId", "IdentityRoleId"); + + b.HasIndex("IdentityRoleId"); + + b.HasIndex("OfferingId"); + + b.ToTable("UserOfferings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Video", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ASLVideoId") + .HasColumnType("text"); + + b.Property("AudioId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Duration") + .HasColumnType("interval"); + + b.Property("FileMediaInfo") + .IsRequired() + .HasColumnType("text"); + + b.Property("Glossary") + .IsRequired() + .HasColumnType("text"); + + b.Property("GlossaryDataId") + .HasColumnType("text"); + + b.Property("GlossaryTimestampId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PhraseHints") + .HasColumnType("text"); + + b.Property("PhraseHintsDataId") + .HasColumnType("text"); + + b.Property("ProcessedASLVideoId") + .HasColumnType("text"); + + b.Property("ProcessedVideo1Id") + .HasColumnType("text"); + + b.Property("ProcessedVideo2Id") + .HasColumnType("text"); + + b.Property("SceneData") + .IsRequired() + .HasColumnType("text"); + + b.Property("SceneObjectDataId") + .HasColumnType("text"); + + b.Property("TaskLog") + .HasColumnType("text"); + + b.Property("TranscribingAttempts") + .HasColumnType("integer"); + + b.Property("TranscriptionStatus") + .HasColumnType("text"); + + b.Property("Video1Id") + .HasColumnType("text"); + + b.Property("Video2Id") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ASLVideoId"); + + b.HasIndex("AudioId"); + + b.HasIndex("ProcessedASLVideoId"); + + b.HasIndex("ProcessedVideo1Id"); + + b.HasIndex("ProcessedVideo2Id"); + + b.HasIndex("Video1Id"); + + b.HasIndex("Video2Id"); + + b.ToTable("Videos"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.WatchHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Json") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("MediaId"); + + b.ToTable("WatchHistories"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ApplicationUser", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany() + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Caption", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Transcription", "Transcription") + .WithMany("Captions") + .HasForeignKey("TranscriptionId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Course", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Department", "Department") + .WithMany("Courses") + .HasForeignKey("DepartmentId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.CourseOffering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Course", "Course") + .WithMany("CourseOfferings") + .HasForeignKey("CourseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("CourseOfferings") + .HasForeignKey("OfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Department", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany("Departments") + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.EPub", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Video", null) + .WithMany("EPubs") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Glossary", b => + { + b.HasOne("ClassTranscribeDatabase.Models.CourseOffering", "CourseOffering") + .WithMany("Glossaries") + .HasForeignKey("CourseId", "OfferingId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Image", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ImageFile") + .WithMany() + .HasForeignKey("ImageFileId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Media", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Playlist", "Playlist") + .WithMany("Medias") + .HasForeignKey("PlaylistId"); + + b.HasOne("ClassTranscribeDatabase.Models.Video", "Video") + .WithMany("Medias") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Message", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Offering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Term", "Term") + .WithMany("Offerings") + .HasForeignKey("TermId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Playlist", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("Playlists") + .HasForeignKey("OfferingId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Subscription", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Term", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany("Terms") + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Transcription", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "File") + .WithMany() + .HasForeignKey("FileId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "SrtFile") + .WithMany() + .HasForeignKey("SrtFileId"); + + b.HasOne("ClassTranscribeDatabase.Models.Video", "Video") + .WithMany("Transcriptions") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.UserOffering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany("UserOfferings") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", "IdentityRole") + .WithMany() + .HasForeignKey("IdentityRoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("OfferingUsers") + .HasForeignKey("OfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Video", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ASLVideo") + .WithMany() + .HasForeignKey("ASLVideoId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Audio") + .WithMany() + .HasForeignKey("AudioId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedASLVideo") + .WithMany() + .HasForeignKey("ProcessedASLVideoId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedVideo1") + .WithMany() + .HasForeignKey("ProcessedVideo1Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedVideo2") + .WithMany() + .HasForeignKey("ProcessedVideo2Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Video1") + .WithMany() + .HasForeignKey("Video1Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Video2") + .WithMany() + .HasForeignKey("Video2Id"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.WatchHistory", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + + b.HasOne("ClassTranscribeDatabase.Models.Media", "Media") + .WithMany("WatchHistories") + .HasForeignKey("MediaId"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.cs b/ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.cs new file mode 100644 index 0000000..9b661fb --- /dev/null +++ b/ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ClassTranscribeDatabase.Migrations +{ + public partial class TaskLogString : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ProcessingLog", + table: "Videos"); + + migrationBuilder.AddColumn( + name: "TaskLog", + table: "Videos", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "TaskLog", + table: "Videos"); + + migrationBuilder.AddColumn( + name: "ProcessingLog", + table: "Videos", + type: "text", + nullable: true); + } + } +} diff --git a/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs b/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs index 961cc86..c54539b 100644 --- a/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs +++ b/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs @@ -1422,9 +1422,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ProcessedVideo2Id") .HasColumnType("text"); - b.Property("ProcessingLog") - .HasColumnType("text"); - b.Property("SceneData") .IsRequired() .HasColumnType("text"); @@ -1432,6 +1429,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("SceneObjectDataId") .HasColumnType("text"); + b.Property("TaskLog") + .HasColumnType("text"); + b.Property("TranscribingAttempts") .HasColumnType("integer"); diff --git a/ClassTranscribeDatabase/Models/Models.cs b/ClassTranscribeDatabase/Models/Models.cs index fc425d9..bd63504 100644 --- a/ClassTranscribeDatabase/Models/Models.cs +++ b/ClassTranscribeDatabase/Models/Models.cs @@ -326,7 +326,8 @@ public class Video : Entity [ForeignKey("ProcessedASLVideo")] public string ProcessedASLVideoId { get; set; } public virtual FileRecord ProcessedASLVideo { get; set; } - public string ProcessingLog { get; set; } + + public string TaskLog { get; set; } public string Description { get; set; } public virtual List Medias { get; set; } public string TranscriptionStatus { get; set; } diff --git a/ClassTranscribeServer/Controllers/MediaController.cs b/ClassTranscribeServer/Controllers/MediaController.cs index f3322c4..6393264 100644 --- a/ClassTranscribeServer/Controllers/MediaController.cs +++ b/ClassTranscribeServer/Controllers/MediaController.cs @@ -58,8 +58,9 @@ public async Task> GetMedia(string id) return new ChallengeResult(); } - var v = await _context.Videos.FindAsync(media.VideoId); + //unused var v = await _context.Videos.FindAsync(media.VideoId); var user = await _userUtils.GetUser(User); + var mediaDTO = new MediaDTO { Id = media.Id, @@ -79,9 +80,11 @@ public async Task> GetMedia(string id) }).ToList(), Video = new VideoDTO { - Id = media.Video.Id, - Video1Path = media.Video.Video1?.Path, - Video2Path = media.Video.Video2?.Path + Id = media.Video.Id, + Video1Path = media.Video.ProcessedVideo1?.Path != null ? media.Video.ProcessedVideo1.Path : media.Video.Video1?.Path, + Video2Path = media.Video.ProcessedVideo2?.Path != null ? media.Video.ProcessedVideo2.Path : media.Video.Video2?.Path, + ASLPath = media.Video.ASLVideo?.Path, + TaskLog = media.Video.TaskLog }, WatchHistory = user != null ? media.WatchHistories.Where(w => w.ApplicationUserId == user.Id).FirstOrDefault() : null }; @@ -153,9 +156,75 @@ public async Task PutJsonMetaData(JObject jsonMetaData, string id return NoContent(); } + + // POST: api/ASLMedia + [DisableRequestSizeLimit] + [HttpPost("ASLVideo")] + [Authorize] + + [Consumes("multipart/form-data")] + public async Task> PostASLVideo(IFormFile aSLVideo, [FromForm] string mediaId) + { + + + + if (aSLVideo == null || aSLVideo.Length == 0) + { + return BadRequest("ASL Video is compulsory"); + } + + if (Path.GetExtension(aSLVideo.FileName) != ".mp4") + { + return BadRequest("File format not permitted"); + } + + var media = await _context.Medias.FindAsync(mediaId); + if (media == null) + { + return NotFound("No such media"); + } + var video = await _context.Videos.FindAsync(media.VideoId); + if (video == null) + { + return NotFound("No video"); + } + + var filePath = CommonUtils.GetTmpFile(); + using (var stream = new FileStream(filePath, FileMode.Create)) + { + await aSLVideo.CopyToAsync(stream); + } + + var subdir = CommonUtils.ToCourseOfferingSubDirectory(_context, media); + + var filerecord = await FileRecord.GetNewFileRecordAsync(filePath, Path.GetExtension(filePath), subdir); + video.ASLVideo = filerecord; + await _context.SaveChangesAsync(); + return Ok(); + } + + public async Task> DeleteASLVideo(string mediaId) + { + + var media = await _context.Medias.FindAsync(mediaId); + if (media == null) + { + return NotFound("No such media"); + } + var video = await _context.Videos.FindAsync(media.VideoId); + if (video == null) + { + return NotFound("No video"); + } + + video.ASLVideoId = null; ; + await _context.SaveChangesAsync(); + return Ok(); + } + // POST: api/Media [DisableRequestSizeLimit] - [HttpPost] + [HttpPost("Media")] [Authorize] [Consumes("multipart/form-data")] public async Task> PostMedia(IFormFile video1, IFormFile video2, [FromForm] string playlistId) diff --git a/ClassTranscribeServer/Controllers/PlaylistsController.cs b/ClassTranscribeServer/Controllers/PlaylistsController.cs index 82be727..27c3d1e 100644 --- a/ClassTranscribeServer/Controllers/PlaylistsController.cs +++ b/ClassTranscribeServer/Controllers/PlaylistsController.cs @@ -159,8 +159,10 @@ public async Task>> GetPlaylists2(string o Video = new VideoDTO { Id = m.Video.Id, - Video1Path = m.Video.Video1 != null ? m.Video.Video1.Path : null, - Video2Path = m.Video.Video2 != null ? m.Video.Video2.Path : null, + Video1Path = m.Video.ProcessedVideo1?.Path != null ? m.Video.ProcessedVideo1.Path : m.Video.Video1?.Path, + Video2Path = m.Video.ProcessedVideo2?.Path != null ? m.Video.ProcessedVideo2.Path : m.Video.Video2?.Path, + ASLPath = m.Video.ASLVideo?.Path, + TaskLog = m.Video.TaskLog }, Transcriptions = m.Video.Transcriptions.Select(t => new TranscriptionDTO { @@ -441,6 +443,8 @@ public class VideoDTO public string Id { get; set; } public string Video1Path { get; set; } public string Video2Path { get; set; } + public string ASLPath { get; set; } + public String TaskLog { get; set; } } public class TranscriptionDTO From 2a7b4c4193f84b53ccce467452048f019e87dbca Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Tue, 7 Nov 2023 19:32:53 -0600 Subject: [PATCH 3/3] Update Media Controller ASL endpoint --- ClassTranscribeServer/Controllers/MediaController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ClassTranscribeServer/Controllers/MediaController.cs b/ClassTranscribeServer/Controllers/MediaController.cs index 6393264..8e7002b 100644 --- a/ClassTranscribeServer/Controllers/MediaController.cs +++ b/ClassTranscribeServer/Controllers/MediaController.cs @@ -157,7 +157,7 @@ public async Task PutJsonMetaData(JObject jsonMetaData, string id } - // POST: api/ASLMedia + // POST: api/ASLVideo [DisableRequestSizeLimit] [HttpPost("ASLVideo")] [Authorize] @@ -203,6 +203,11 @@ public async Task> PostASLVideo(IFormFile aSLVideo, [FromFor return Ok(); } + // DELETE: api/Media/ASLVideo/{mediaId} + + [HttpDelete("ASLVideo/{mediaId}")] + + [Authorize] public async Task> DeleteASLVideo(string mediaId) {