├── .dockerignore
├── .editorconfig
├── .github
└── workflows
│ ├── aspnet-platform.unused.txt
│ ├── ci.yaml
│ └── docker.yaml
├── .gitignore
├── API.Dockerfile
├── ClassTranscribeDatabase
├── CTDbContext.cs
├── CaptionQueries.cs
├── ClassTranscribeDatabase.csproj
├── CommonUtils.cs
├── Globals.cs
├── Migrations
│ ├── 20190622222105_One.Designer.cs
│ ├── 20190622222105_One.cs
│ ├── 20190624223657_two.Designer.cs
│ ├── 20190624223657_two.cs
│ ├── 20190625203938_Status.Designer.cs
│ ├── 20190625203938_Status.cs
│ ├── 20190701185347_Playlists.Designer.cs
│ ├── 20190701185347_Playlists.cs
│ ├── 20190701185525_EndDate.Designer.cs
│ ├── 20190701185525_EndDate.cs
│ ├── 20190705215327_MediaJon.Designer.cs
│ ├── 20190705215327_MediaJon.cs
│ ├── 20190707011746_Media_modification.Designer.cs
│ ├── 20190707011746_Media_modification.cs
│ ├── 20190707013307_Add_Playlist.Designer.cs
│ ├── 20190707013307_Add_Playlist.cs
│ ├── 20190709031430_AudioPath.Designer.cs
│ ├── 20190709031430_AudioPath.cs
│ ├── 20190711220930_Status2.Designer.cs
│ ├── 20190711220930_Status2.cs
│ ├── 20190716193750_Remove-Offering-Playlists.Designer.cs
│ ├── 20190716193750_Remove-Offering-Playlists.cs
│ ├── 20190717220252_FileRecords.Designer.cs
│ ├── 20190717220252_FileRecords.cs
│ ├── 20190717222124_FileRecordsForeignKey.Designer.cs
│ ├── 20190717222124_FileRecordsForeignKey.cs
│ ├── 20190719195657_FileRecord.Designer.cs
│ ├── 20190719195657_FileRecord.cs
│ ├── 20190719214917_not_mapped.Designer.cs
│ ├── 20190719214917_not_mapped.cs
│ ├── 20190722203911_Caption_Table.Designer.cs
│ ├── 20190722203911_Caption_Table.cs
│ ├── 20190722204241_Caption_Table2.Designer.cs
│ ├── 20190722204241_Caption_Table2.cs
│ ├── 20190722215432_Caption_Table3.Designer.cs
│ ├── 20190722215432_Caption_Table3.cs
│ ├── 20190809193644_TranscriptionStatus.Designer.cs
│ ├── 20190809193644_TranscriptionStatus.cs
│ ├── 20190831191804_UpVote.Designer.cs
│ ├── 20190831191804_UpVote.cs
│ ├── 20190831192420_Log.Designer.cs
│ ├── 20190831192420_Log.cs
│ ├── 20190903201631_Metadata.Designer.cs
│ ├── 20190903201631_Metadata.cs
│ ├── 20190910053352_FTS.Designer.cs
│ ├── 20190910053352_FTS.cs
│ ├── 20190918214544_Logs-RemoveFK.Designer.cs
│ ├── 20190918214544_Logs-RemoveFK.cs
│ ├── 20190922221537_Add_Processed_Video.Designer.cs
│ ├── 20190922221537_Add_Processed_Video.cs
│ ├── 20191024223759_CourseName-Desc.Designer.cs
│ ├── 20191024223759_CourseName-Desc.cs
│ ├── 20191024234713_DropCourseName-Desc-From-Courses.Designer.cs
│ ├── 20191024234713_DropCourseName-Desc-From-Courses.cs
│ ├── 20191025190603_Add_VideoId.Designer.cs
│ ├── 20191025190603_Add_VideoId.cs
│ ├── 20191025194553_Drop_MediaId_From_Video.Designer.cs
│ ├── 20191025194553_Drop_MediaId_From_Video.cs
│ ├── 20191025195048_Drop_MediaId_From_Video2.Designer.cs
│ ├── 20191025195048_Drop_MediaId_From_Video2.cs
│ ├── 20191025195537_Add_Medias_to_Video.Designer.cs
│ ├── 20191025195537_Add_Medias_to_Video.cs
│ ├── 20191025215955_Transcription_Refactor.Designer.cs
│ ├── 20191025215955_Transcription_Refactor.cs
│ ├── 20191025232219_Transcription_Refactorv2.Designer.cs
│ ├── 20191025232219_Transcription_Refactorv2.cs
│ ├── 20191026021015_SrtFile.Designer.cs
│ ├── 20191026021015_SrtFile.cs
│ ├── 20191112212156_EPub.Designer.cs
│ ├── 20191112212156_EPub.cs
│ ├── 20191112235327_Epub-Table.Designer.cs
│ ├── 20191112235327_Epub-Table.cs
│ ├── 20191121171237_TranscribingAttempts.Designer.cs
│ ├── 20191121171237_TranscribingAttempts.cs
│ ├── 20200119114020_Video.SceneData.Designer.cs
│ ├── 20200119114020_Video.SceneData.cs
│ ├── 20200127214916_CaptionType.Designer.cs
│ ├── 20200127214916_CaptionType.cs
│ ├── 20200205033251_Dictionary.Designer.cs
│ ├── 20200205033251_Dictionary.cs
│ ├── 20200205192815_Playlist_JsonMetaData.Designer.cs
│ ├── 20200205192815_Playlist_JsonMetaData.cs
│ ├── 20200212000529_Media-Name.Designer.cs
│ ├── 20200212000529_Media-Name.cs
│ ├── 20200306150525_ChangedUser.Designer.cs
│ ├── 20200306150525_ChangedUser.cs
│ ├── 20200326193756_Offering-JsonMetadata.Designer.cs
│ ├── 20200326193756_Offering-JsonMetadata.cs
│ ├── 20200326194432_Add_WatchHistory_Table.Designer.cs
│ ├── 20200326194432_Add_WatchHistory_Table.cs
│ ├── 20200331223215_Indexing.Designer.cs
│ ├── 20200331223215_Indexing.cs
│ ├── 20200414071209_Epubchapter.Designer.cs
│ ├── 20200414071209_Epubchapter.cs
│ ├── 20200415051601_Visibility.Designer.cs
│ ├── 20200415051601_Visibility.cs
│ ├── 20200612211632_TaskItems.Designer.cs
│ ├── 20200612211632_TaskItems.cs
│ ├── 20200919210948_Detailed_Task_Item.Designer.cs
│ ├── 20200919210948_Detailed_Task_Item.cs
│ ├── 20200924173817_EpubApis.Designer.cs
│ ├── 20200924173817_EpubApis.cs
│ ├── 20201005192717_EPubFix.Designer.cs
│ ├── 20201005192717_EPubFix.cs
│ ├── 20201008171703_AddDurationFileMediaInfo.Designer.cs
│ ├── 20201008171703_AddDurationFileMediaInfo.cs
│ ├── 20201113200736_Disable_Soft_Delete_UserOffering.Designer.cs
│ ├── 20201113200736_Disable_Soft_Delete_UserOffering.cs
│ ├── 20201119182946_Add_DeletedAt_DeletedBy.Designer.cs
│ ├── 20201119182946_Add_DeletedAt_DeletedBy.cs
│ ├── 20201201145853_PublishControlForOfferings.Designer.cs
│ ├── 20201201145853_PublishControlForOfferings.cs
│ ├── 20201209005506_PublishStatus.Designer.cs
│ ├── 20201209005506_PublishStatus.cs
│ ├── 20210624224308_videophrase.Designer.cs
│ ├── 20210624224308_videophrase.cs
│ ├── 20210908174659_NonnullVideoJObjects.Designer.cs
│ ├── 20210908174659_NonnullVideoJObjects.cs
│ ├── 20210916160743_NonnullAllJObjects.Designer.cs
│ ├── 20210916160743_NonnullAllJObjects.cs
│ ├── 20211013142047_TranscriptionsUpdate.Designer.cs
│ ├── 20211013142047_TranscriptionsUpdate.cs
│ ├── 20211116200810_FilePath.Designer.cs
│ ├── 20211116200810_FilePath.cs
│ ├── 20220722044401_Glossary.Designer.cs
│ ├── 20220722044401_Glossary.cs
│ ├── 20220901042623_AddGlossaryToVideo.Designer.cs
│ ├── 20220901042623_AddGlossaryToVideo.cs
│ ├── 20220930063430_ASLVideo.Designer.cs
│ ├── 20220930063430_ASLVideo.cs
│ ├── 20220930075448_ASLGlossaryMap.Designer.cs
│ ├── 20220930075448_ASLGlossaryMap.cs
│ ├── 20221116162318_PhraseHintJsonTable.Designer.cs
│ ├── 20221116162318_PhraseHintJsonTable.cs
│ ├── 20221116201353_PhraseHintTextTable.Designer.cs
│ ├── 20221116201353_PhraseHintTextTable.cs
│ ├── 20221116223342_LightweightVideo.Designer.cs
│ ├── 20221116223342_LightweightVideo.cs
│ ├── 20221116231920_LightweightVideo2.Designer.cs
│ ├── 20221116231920_LightweightVideo2.cs
│ ├── 20221122030110_PlaylistAddDateTimes.Designer.cs
│ ├── 20221122030110_PlaylistAddDateTimes.cs
│ ├── 20221129095657_GlossaryDataId.Designer.cs
│ ├── 20221129095657_GlossaryDataId.cs
│ ├── 20221207061940_UpdateASLVideo.Designer.cs
│ ├── 20221207061940_UpdateASLVideo.cs
│ ├── 20221229041355_ASLVideoGlossaryMapPublished.Designer.cs
│ ├── 20221229041355_ASLVideoGlossaryMapPublished.cs
│ ├── 20230105193204_GlossaryTimestamp.Designer.cs
│ ├── 20230105193204_GlossaryTimestamp.cs
│ ├── 20230215055550_GlossaryOneParagraphExplanation.Designer.cs
│ ├── 20230215055550_GlossaryOneParagraphExplanation.cs
│ ├── 20231011192212_aslvideo3.Designer.cs
│ ├── 20231011192212_aslvideo3.cs
│ ├── 20231012191610_TaskLogString.Designer.cs
│ ├── 20231012191610_TaskLogString.cs
│ ├── 20231211224116_PlaylistMediaOptions.Designer.cs
│ ├── 20231211224116_PlaylistMediaOptions.cs
│ └── CTDbContextModelSnapshot.cs
├── Models
│ ├── Caption.cs
│ ├── FileRecord.cs
│ ├── Models.cs
│ └── TaskItem.cs
├── Seed.cs
├── Services
│ ├── BoxAPI.cs
│ ├── Grpc.cs
│ ├── MSTranscription
│ │ ├── KeyProvider.cs
│ │ ├── MSTWord.cs
│ │ ├── MSTranscriptionService.cs
│ │ └── WavHelper.cs
│ ├── Notification.cs
│ ├── RabbitMQConnection.cs
│ └── Slack.cs
├── global.json
└── migration_instruction.md
├── ClassTranscribeServer.sln
├── ClassTranscribeServer
├── ClassTranscribeServer.csproj
├── Connected Services
│ └── Application Insights
│ │ └── ConnectedService.json
├── Controllers
│ ├── ASLVideoController.cs
│ ├── ASLVideoGlossaryMapController.cs
│ ├── AccountController.cs
│ ├── AdminController.cs
│ ├── BaseController.cs
│ ├── CaptionsController.cs
│ ├── CaptionsSearchController.cs
│ ├── CourseOfferingsController.cs
│ ├── CoursesController.cs
│ ├── DepartmentsController.cs
│ ├── EPubsController.cs
│ ├── GlossaryController.cs
│ ├── ImagesController.cs
│ ├── LogsController.cs
│ ├── MediaController.cs
│ ├── OfferingsController.cs
│ ├── PlaylistsController.cs
│ ├── RolesController.cs
│ ├── StaticFileController.cs
│ ├── TaskController.cs
│ ├── TermsController.cs
│ ├── UniversitiesController.cs
│ ├── UserOfferingsController.cs
│ └── WatchHistoriesController.cs
├── Program.cs
├── Startup.cs
├── Utils
│ ├── Authorization.cs
│ ├── SwaggerSchemaFilter.cs
│ ├── UIUCSeed.cs
│ ├── UserUtils.cs
│ └── WakeDownloader.cs
├── appsettings.Development.json
├── global.json
└── launchscript.sh
├── DevExperiments
├── DevExperiments.csproj
├── Program.cs
└── TempCode.cs
├── LICENSE
├── LocalEnvironmentVariables.txt
├── PythonRpcServer
├── .gitignore
├── Kaltura.ipynb
├── cs440_transcription.txt
├── echo.py
├── ffmpeg.py
├── hasher.py
├── kaltura.py
├── kaltura_test.py
├── kalturaclient_sanitytest.py
├── mediaprovider.py
├── requirements.txt
├── server.py
├── titledetector.py
├── titledetector_test.py
├── transcribe.py
├── transcribe_example_result.json
├── transcribe_hellohellohello.wav
├── unused
│ ├── phrasehinter.py
│ ├── phrasehinter_test.py
│ ├── scenedetector.py
│ ├── scenedetector_test.py
│ ├── tesseract_test.py
│ └── youtube-api
├── utils.py
├── youtube.py
└── youtube_test.py
├── README.md
├── TaskEngine.Dockerfile
├── TaskEngine
├── Program.cs
├── TaskEngine.csproj
├── TaskEngine.sln
├── Tasks
│ ├── AzureTranscriptionTask.cs
│ ├── BuildElasticIndexTask.cs
│ ├── CleanUpElasticIndexTask.cs
│ ├── ConvertVideoToWavTask.cs
│ ├── CreateBoxTokenTask.cs
│ ├── DescribeImageTask.cs
│ ├── DescribeVideoTask.cs
│ ├── DownloadMediaTask.cs
│ ├── DownloadPlaylistInfoTask.cs
│ ├── ExampleTask.cs
│ ├── GenerateVTTFileTask.cs
│ ├── LocalTranscriptionTask.cs
│ ├── ProcessVideoTask.cs
│ ├── PythonCrawlerTask.cs
│ ├── QueueAwakerTask.cs
│ ├── RabbitMQTask.cs
│ ├── SceneDetectionTask.cs
│ └── UpdateBoxTokenTask.cs
├── TempCode.cs
└── global.json
├── TestAzureCognitiveServices
├── .dockerignore
├── Program.cs
├── TestAzure.Dockerfile
├── TestAzureCognitiveServices.csproj
├── install-libssl1.sh
├── shortvideo.mp4
└── shortwav.wav
├── TestRemoteLLM
├── ClassTranscribeStudentsUse2020.png
├── Program.cs
├── RemoteAPI.txt
├── TestRemoteLLM.csproj
└── dieselsubmarine.jpg
├── UnitTests
├── Assets
│ ├── example.srt
│ ├── no-captions.vtt
│ ├── subtitles.xml
│ ├── test.mov
│ ├── test.mp4
│ ├── test.png
│ └── test.txt
├── ClassTranscribeDatabase
│ ├── CommonUtilsTest.cs
│ ├── FileRecordTest.cs
│ └── ModelsTest.cs
├── ClassTranscribeServer
│ └── ControllerTests
│ │ ├── AccountControllerTest.cs
│ │ ├── AdminControllerTest.cs
│ │ ├── BaseControllerTest.cs
│ │ ├── CaptionsControllerTest.cs
│ │ ├── CourseOfferingsControllerTest.cs
│ │ ├── CoursesControllerTest.cs
│ │ ├── DepartmentsControllerTest.cs
│ │ ├── EPubsControllerTest.cs
│ │ ├── ImagesControllerTest.cs
│ │ ├── LogsControllerTest.cs
│ │ ├── MediaControllerTest.cs
│ │ ├── OfferingsControllerTest.cs
│ │ ├── PlaylistsControllerTest.cs
│ │ ├── RolesControllerTest.cs
│ │ ├── StaticFileConrollerTest.cs
│ │ ├── TermsControllerTest.cs
│ │ ├── UniversitiesControllerTest.cs
│ │ ├── UserOfferingsControllerTest.cs
│ │ └── WatchHistoriesControllerTest.cs
├── GlobalFixture.cs
├── README.md
├── UnitTests.csproj
└── Utils
│ ├── Common.cs
│ ├── MockServices.cs
│ └── TestGlobals.cs
├── ct.proto
├── gotchas.md
├── install-speech-hack-libssl1.sh
├── pythonrpcserver.Dockerfile
├── randomvoice_16kHz.json
├── vs_appsettings-example.txt
└── world_universities_and_domains.json
/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.dockerignore
2 | **/.env
3 | **/.git
4 | **/.gitignore
5 | **/.vs
6 | **/.vscode
7 | **/*.*proj.user
8 | **/azds.yaml
9 | **/charts
10 | **/bin
11 | **/obj
12 | **/Dockerfile
13 | **/Dockerfile.develop
14 | **/docker-compose.yml
15 | **/docker-compose.*.yml
16 | **/*.dbmdl
17 | **/*.jfm
18 | **/secrets.dev.yaml
19 | **/values.dev.yaml
20 | **/.toolstarget
21 | **/node_modules
22 | whisper.cpp
23 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # CA2007: Consider calling ConfigureAwait on the awaited task
4 | dotnet_diagnostic.CA2007.severity = none
5 |
6 | # CA1303: Do not pass literals as localized parameters
7 | dotnet_diagnostic.CA1303.severity = none
8 |
9 | # CA1307: Specify StringComparison
10 | dotnet_diagnostic.CA1307.severity = none
11 |
12 | # CA1034: Nested types should not be visible
13 | dotnet_diagnostic.CA1034.severity = none
14 |
15 | # CA2227: Collection properties should be read only
16 | dotnet_diagnostic.CA2227.severity = none
17 |
18 | # CA1305: Specify IFormatProvider
19 | dotnet_diagnostic.CA1305.severity = none
20 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | - staging
8 | - expt
9 | pull_request:
10 |
11 | jobs:
12 | build:
13 | name: Build
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/checkout@v3
17 |
18 | - uses: actions/setup-dotnet@v1
19 | with:
20 | dotnet-version: '8.0.x' # SDK Version to use; x will use the latest version of the channel
21 |
22 | - uses: actions/cache@v4
23 | with:
24 | path: ~/.nuget/packages
25 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
26 | restore-keys: |
27 | ${{ runner.os }}-nuget-
28 |
29 | - name: Compile application
30 | run: |
31 | dotnet build ClassTranscribeServer.sln --configuration Release
32 |
33 | - name: Run unit tests
34 | run: |
35 | dotnet test UnitTests --configuration Release -v n
36 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Manually added -
2 | vs_appsettings.json
3 | *vs_appsettings.json
4 |
5 |
6 | ## Ignore Visual Studio temporary files, build results, and
7 | ## files generated by popular Visual Studio add-ons.
8 |
9 | #personal vs setting
10 | vs_appsettings.json
11 |
12 | #ENV Variable files
13 | *.list
14 |
15 | # VS Things
16 | app/
17 |
18 |
19 | # User-specific files
20 | *.suo
21 | *.user
22 | *.userosscache
23 | *.sln.docstates
24 |
25 | # User-specific files (MonoDevelop/Xamarin Studio)
26 | *.userprefs
27 |
28 | # Build results
29 | [Dd]ebug/
30 | [Dd]ebugPublic/
31 | [Rr]elease/
32 | [Rr]eleases/
33 | x64/
34 | x86/
35 | build/
36 | bld/
37 | [Bb]in/
38 | [Oo]bj/
39 |
40 | # Visual Studio 2015 cache/options directory
41 | .vs/
42 | .vscode/
43 | # Uncomment if you have tasks that create the project's static files in wwwroot
44 | #wwwroot/
45 |
46 | # MSTest test Results
47 | [Tt]est[Rr]esult*/
48 | [Bb]uild[Ll]og.*
49 |
50 | # NodeThings
51 | # Logs
52 | logs
53 | *.log
54 | npm-debug.log*
55 | yarn-debug.log*
56 | yarn-error.log*
57 | lerna-debug.log*
58 |
59 | # Diagnostic reports (https://nodejs.org/api/report.html)
60 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
61 |
62 | # Runtime data
63 | pids
64 | *.pid
65 | *.seed
66 | *.pid.lock
67 |
68 | # Directory for instrumented libs generated by jscoverage/JSCover
69 | lib-cov
70 |
71 | # Coverage directory used by tools like istanbul
72 | coverage
73 | *.lcov
74 |
75 | # nyc test coverage
76 | .nyc_output
77 |
78 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
79 | .grunt
80 |
81 | # Bower dependency directory (https://bower.io/)
82 | bower_components
83 |
84 | # node-waf configuration
85 | .lock-wscript
86 |
87 | # Compiled binary addons (https://nodejs.org/api/addons.html)
88 | build/Release
89 |
90 | # Dependency directories
91 | node_modules/
92 | jspm_packages/
93 |
94 | # TypeScript v1 declaration files
95 | typings/
96 |
97 | # TypeScript cache
98 | *.tsbuildinfo
99 |
100 | # Optional npm cache directory
101 | .npm
102 |
103 | # NUNIT
104 | *.VisualState.xml
105 | TestResult.xml
106 | Data/
107 | data/
108 | /NodeRpcServer/cookies.txt
109 | nginx/app.conf
110 | NodeRpcServer/ct.proto
111 | /NodeRpcServer
112 | /ClassTranscribeServer/Properties
113 | __pycache__/
114 | PythonRpcServer/ct_pb2_grpc.py
115 | PythonRpcServer/ct_pb2.py
116 |
117 | *.pyc
118 | .ipynb_checkpoints/
119 | /old--dot.env
120 | /docker-compose.yml
121 | /PythonRpcServer/corpus_count.json
122 | DevExperiments/LocalEnvironmentVariables.txt
123 |
--------------------------------------------------------------------------------
/API.Dockerfile:
--------------------------------------------------------------------------------
1 | # Also remove platform from docker-compose.override.yml for api and taskengine
2 | # Uncomment build context in docker-compose.override.yml for api and taskengine
3 |
4 | # e.g.,
5 | # taskengine:
6 | # image: classtranscribe/taskengine:staging
7 | # #xx platform: linux/amd64 # Nope - Causes SDK "dotnet restore" to hang on M1 Mac
8 | # build:
9 | # context: ../../WebAPI
10 | # target: publish
11 | # dockerfile: ./TaskEngine.Dockerfile
12 | #
13 |
14 |
15 | #FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-amd64 as build
16 | FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim as build
17 | # See https://mcr.microsoft.com/en-us/product/dotnet/sdk/tags
18 |
19 | # Running the AMD64 version is of the SDK is broken
20 | # https://github.com/dotnet/dotnet-docker/discussions/4285
21 | # https://github.com/NuGet/Home/issues/13062
22 |
23 | RUN apt-get -q update && apt-get -qy install git
24 | WORKDIR /
25 | RUN git clone https://github.com/eficode/wait-for.git
26 |
27 | WORKDIR /src
28 | COPY ./ClassTranscribeDatabase/ClassTranscribeDatabase.csproj ./ClassTranscribeDatabase/ClassTranscribeDatabase.csproj
29 | # Did not help ENV DOTNET_NUGET_SIGNATURE_VERIFICATION=false
30 | # Add --verbosity normal|diagnostic
31 | RUN dotnet --list-sdks
32 | RUN dotnet restore --verbosity diagnostic ./ClassTranscribeDatabase/ClassTranscribeDatabase.csproj
33 |
34 | COPY ./ClassTranscribeServer/ClassTranscribeServer.csproj ./ClassTranscribeServer/ClassTranscribeServer.csproj
35 | RUN dotnet restore ./ClassTranscribeServer/ClassTranscribeServer.csproj
36 |
37 | COPY ./world_universities_and_domains.json ./world_universities_and_domains.json
38 | COPY ./ct.proto ./ct.proto
39 | COPY ./ClassTranscribeServer ./ClassTranscribeServer
40 | COPY ./ClassTranscribeDatabase ./ClassTranscribeDatabase
41 | WORKDIR /src/ClassTranscribeServer
42 | RUN dotnet publish ClassTranscribeServer.csproj -c Release -o /app --no-restore
43 |
44 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim as publish_base
45 | # FROM mcr.microsoft.com/dotnet/aspnet:7.0.14-bookworm-slim as publish_base
46 |
47 | # FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.3-bionic as publish_base
48 | RUN apt-get -q update && apt-get -qy install netcat-traditional
49 |
50 | FROM publish_base as publish
51 | WORKDIR /
52 | COPY --from=build /wait-for .
53 | WORKDIR /app
54 | COPY --from=build /app .
55 | EXPOSE 80
56 | EXPOSE 443
57 |
58 | ARG GITSHA1=unspecified
59 | ENV GITSHA1=$GITSHA1
60 |
61 | ARG BUILDNUMBER=unspecified
62 | ENV BUILDNUMBER=$BUILDNUMBER
63 |
64 | LABEL git_commit_hash=$GITSHA1
65 |
66 | CMD ["dotnet", "/app/ClassTranscribeServer.dll"]
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/CaptionQueries.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase.Models;
2 | using Microsoft.EntityFrameworkCore;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 |
7 | namespace ClassTranscribeDatabase
8 | {
9 | ///
10 | /// Some commonly used queries to get the captions for a given videoId.
11 | ///
12 | public class CaptionQueries
13 | {
14 | private readonly CTDbContext _context;
15 | public CaptionQueries(CTDbContext context)
16 | {
17 | _context = context;
18 | }
19 |
20 | ///
21 | /// Get the captions for a given videoId
22 | ///
23 | /// Language of the captions to fetch.
24 | public async Task> GetCaptionsAsync(string videoId, string sourceInternalRef, string language) // = "en-US"
25 | {
26 | try
27 | {
28 | var transcriptionId = _context.Transcriptions.Where(t => t.Language == language && t.VideoId == videoId && t.SourceInternalRef == sourceInternalRef
29 | && t.TranscriptionType == TranscriptionType.Caption).First().Id;
30 | return await GetCaptionsAsync(transcriptionId);
31 | }
32 | catch (System.InvalidOperationException)
33 | {
34 | // If Transcriptions do not exist then First() will throw InvalidOperationException
35 |
36 | return new List();
37 | }
38 | }
39 |
40 | ///
41 | /// Get the text descriptions for a given videoId
42 | ///
43 | /// Language of the captions to fetch.
44 | public async Task> GetDescriptionsAsync(string videoId, string language) // = "en-US"
45 | {
46 | try
47 | {
48 | var transcriptionId = _context.Transcriptions.Where(t => t.Language == language && t.VideoId == videoId
49 | && t.TranscriptionType == TranscriptionType.TextDescription).First().Id;
50 | return await GetCaptionsAsync(transcriptionId);
51 | }
52 | catch (System.InvalidOperationException)
53 | {
54 | // If Transcriptions do not exist then First() will throw InvalidOperationException
55 |
56 | return new List();
57 | }
58 | }
59 |
60 | ///
61 | /// Get the captions for a given transcriptionId
62 | ///
63 | public async Task> GetCaptionsAsync(string transcriptionId)
64 | {
65 | // This has to be split in two because of https://docs.microsoft.com/en-us/ef/core/querying/client-eval
66 | var allCaptions = await _context.Captions.Where(c => c.TranscriptionId == transcriptionId).ToListAsync();
67 | var captions = allCaptions.GroupBy(c => c.Index).Select(g => g.OrderByDescending(c => c.CreatedAt).First())
68 | .OrderBy(c => c.Index).ToList();
69 | return captions;
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/ClassTranscribeDatabase.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 |
6 |
7 |
8 | ../ClassTranscribeDatabaseDebug/bin
9 | ../ClassTranscribeDatabaseDebug/obj
10 |
11 |
12 |
13 | ../ClassTranscribeDatabaseRelease/bin
14 | ../ClassTranscribeDatabaseRelease/obj
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | Always
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | all
36 | runtime; build; native; contentfiles; analyzers; buildtransitive
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | runtime; build; native; contentfiles; analyzers; buildtransitive
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190624223657_two.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class two : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "CourseName",
11 | table: "Courses",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "CourseName",
19 | table: "Courses");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190701185525_EndDate.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 | using System;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class EndDate : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.AddColumn(
11 | name: "EndDate",
12 | table: "Terms",
13 | nullable: false,
14 | defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
15 | }
16 |
17 | protected override void Down(MigrationBuilder migrationBuilder)
18 | {
19 | migrationBuilder.DropColumn(
20 | name: "EndDate",
21 | table: "Terms");
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190705215327_MediaJon.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class MediaJon : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.RenameColumn(
10 | name: "Path",
11 | table: "Videos",
12 | newName: "Video2Path");
13 |
14 | migrationBuilder.AddColumn(
15 | name: "Video1Path",
16 | table: "Videos",
17 | nullable: true);
18 |
19 | migrationBuilder.AddColumn(
20 | name: "SourceType",
21 | table: "Medias",
22 | nullable: false,
23 | defaultValue: 0);
24 | }
25 |
26 | protected override void Down(MigrationBuilder migrationBuilder)
27 | {
28 | migrationBuilder.DropColumn(
29 | name: "Video1Path",
30 | table: "Videos");
31 |
32 | migrationBuilder.DropColumn(
33 | name: "SourceType",
34 | table: "Medias");
35 |
36 | migrationBuilder.RenameColumn(
37 | name: "Video2Path",
38 | table: "Videos",
39 | newName: "Path");
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190707011746_Media_modification.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Media_modification : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropColumn(
10 | name: "MediaSource",
11 | table: "Medias");
12 |
13 | migrationBuilder.RenameColumn(
14 | name: "MediaUrl",
15 | table: "Medias",
16 | newName: "UniqueMediaIdentifier");
17 | }
18 |
19 | protected override void Down(MigrationBuilder migrationBuilder)
20 | {
21 | migrationBuilder.RenameColumn(
22 | name: "UniqueMediaIdentifier",
23 | table: "Medias",
24 | newName: "MediaUrl");
25 |
26 | migrationBuilder.AddColumn(
27 | name: "MediaSource",
28 | table: "Medias",
29 | nullable: true);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190707013307_Add_Playlist.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Add_Playlist : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropForeignKey(
10 | name: "FK_Medias_Playlist_PlaylistId",
11 | table: "Medias");
12 |
13 | migrationBuilder.DropForeignKey(
14 | name: "FK_OfferingPlaylists_Playlist_PlaylistId",
15 | table: "OfferingPlaylists");
16 |
17 | migrationBuilder.DropPrimaryKey(
18 | name: "PK_Playlist",
19 | table: "Playlist");
20 |
21 | migrationBuilder.RenameTable(
22 | name: "Playlist",
23 | newName: "Playlists");
24 |
25 | migrationBuilder.AddPrimaryKey(
26 | name: "PK_Playlists",
27 | table: "Playlists",
28 | column: "Id");
29 |
30 | migrationBuilder.AddForeignKey(
31 | name: "FK_Medias_Playlists_PlaylistId",
32 | table: "Medias",
33 | column: "PlaylistId",
34 | principalTable: "Playlists",
35 | principalColumn: "Id",
36 | onDelete: ReferentialAction.Restrict);
37 |
38 | migrationBuilder.AddForeignKey(
39 | name: "FK_OfferingPlaylists_Playlists_PlaylistId",
40 | table: "OfferingPlaylists",
41 | column: "PlaylistId",
42 | principalTable: "Playlists",
43 | principalColumn: "Id",
44 | onDelete: ReferentialAction.Cascade);
45 | }
46 |
47 | protected override void Down(MigrationBuilder migrationBuilder)
48 | {
49 | migrationBuilder.DropForeignKey(
50 | name: "FK_Medias_Playlists_PlaylistId",
51 | table: "Medias");
52 |
53 | migrationBuilder.DropForeignKey(
54 | name: "FK_OfferingPlaylists_Playlists_PlaylistId",
55 | table: "OfferingPlaylists");
56 |
57 | migrationBuilder.DropPrimaryKey(
58 | name: "PK_Playlists",
59 | table: "Playlists");
60 |
61 | migrationBuilder.RenameTable(
62 | name: "Playlists",
63 | newName: "Playlist");
64 |
65 | migrationBuilder.AddPrimaryKey(
66 | name: "PK_Playlist",
67 | table: "Playlist",
68 | column: "Id");
69 |
70 | migrationBuilder.AddForeignKey(
71 | name: "FK_Medias_Playlist_PlaylistId",
72 | table: "Medias",
73 | column: "PlaylistId",
74 | principalTable: "Playlist",
75 | principalColumn: "Id",
76 | onDelete: ReferentialAction.Restrict);
77 |
78 | migrationBuilder.AddForeignKey(
79 | name: "FK_OfferingPlaylists_Playlist_PlaylistId",
80 | table: "OfferingPlaylists",
81 | column: "PlaylistId",
82 | principalTable: "Playlist",
83 | principalColumn: "Id",
84 | onDelete: ReferentialAction.Cascade);
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190709031430_AudioPath.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class AudioPath : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "AudioPath",
11 | table: "Videos",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "AudioPath",
19 | table: "Videos");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190711220930_Status2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Status2 : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Status",
11 | table: "AspNetUsers",
12 | nullable: false,
13 | defaultValue: 0);
14 | }
15 |
16 | protected override void Down(MigrationBuilder migrationBuilder)
17 | {
18 | migrationBuilder.DropColumn(
19 | name: "Status",
20 | table: "AspNetUsers");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190717220252_FileRecords.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 | using System;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class FileRecords : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.CreateTable(
11 | name: "FileRecords",
12 | columns: table => new
13 | {
14 | Id = table.Column(nullable: false),
15 | CreatedAt = table.Column(nullable: false),
16 | CreatedBy = table.Column(nullable: true),
17 | LastUpdatedAt = table.Column(nullable: false),
18 | LastUpdatedBy = table.Column(nullable: true),
19 | IsDeletedStatus = table.Column(nullable: false),
20 | FileName = table.Column(nullable: true),
21 | Path = table.Column(nullable: true),
22 | Hash = table.Column(nullable: true)
23 | },
24 | constraints: table =>
25 | {
26 | table.PrimaryKey("PK_FileRecords", x => x.Id);
27 | });
28 | }
29 |
30 | protected override void Down(MigrationBuilder migrationBuilder)
31 | {
32 | migrationBuilder.DropTable(
33 | name: "FileRecords");
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190717222124_FileRecordsForeignKey.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class FileRecordsForeignKey : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Video1Id",
11 | table: "Videos",
12 | nullable: true);
13 |
14 | migrationBuilder.AddColumn(
15 | name: "Video2Id",
16 | table: "Videos",
17 | nullable: true);
18 |
19 | migrationBuilder.CreateIndex(
20 | name: "IX_Videos_Video1Id",
21 | table: "Videos",
22 | column: "Video1Id");
23 |
24 | migrationBuilder.CreateIndex(
25 | name: "IX_Videos_Video2Id",
26 | table: "Videos",
27 | column: "Video2Id");
28 |
29 | migrationBuilder.AddForeignKey(
30 | name: "FK_Videos_FileRecords_Video1Id",
31 | table: "Videos",
32 | column: "Video1Id",
33 | principalTable: "FileRecords",
34 | principalColumn: "Id",
35 | onDelete: ReferentialAction.Restrict);
36 |
37 | migrationBuilder.AddForeignKey(
38 | name: "FK_Videos_FileRecords_Video2Id",
39 | table: "Videos",
40 | column: "Video2Id",
41 | principalTable: "FileRecords",
42 | principalColumn: "Id",
43 | onDelete: ReferentialAction.Restrict);
44 | }
45 |
46 | protected override void Down(MigrationBuilder migrationBuilder)
47 | {
48 | migrationBuilder.DropForeignKey(
49 | name: "FK_Videos_FileRecords_Video1Id",
50 | table: "Videos");
51 |
52 | migrationBuilder.DropForeignKey(
53 | name: "FK_Videos_FileRecords_Video2Id",
54 | table: "Videos");
55 |
56 | migrationBuilder.DropIndex(
57 | name: "IX_Videos_Video1Id",
58 | table: "Videos");
59 |
60 | migrationBuilder.DropIndex(
61 | name: "IX_Videos_Video2Id",
62 | table: "Videos");
63 |
64 | migrationBuilder.DropColumn(
65 | name: "Video1Id",
66 | table: "Videos");
67 |
68 | migrationBuilder.DropColumn(
69 | name: "Video2Id",
70 | table: "Videos");
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190719214917_not_mapped.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class not_mapped : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.RenameColumn(
10 | name: "Path",
11 | table: "FileRecords",
12 | newName: "PrivatePath");
13 |
14 | migrationBuilder.AddColumn(
15 | name: "FileName",
16 | table: "FileRecords",
17 | nullable: true);
18 | }
19 |
20 | protected override void Down(MigrationBuilder migrationBuilder)
21 | {
22 | migrationBuilder.DropColumn(
23 | name: "FileName",
24 | table: "FileRecords");
25 |
26 | migrationBuilder.RenameColumn(
27 | name: "PrivatePath",
28 | table: "FileRecords",
29 | newName: "Path");
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190722203911_Caption_Table.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 | using System;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class Caption_Table : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.AddColumn(
11 | name: "Description",
12 | table: "Transcriptions",
13 | nullable: true);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "Language",
17 | table: "Transcriptions",
18 | nullable: true);
19 |
20 | migrationBuilder.CreateTable(
21 | name: "Caption",
22 | columns: table => new
23 | {
24 | Id = table.Column(nullable: false),
25 | CreatedAt = table.Column(nullable: false),
26 | CreatedBy = table.Column(nullable: true),
27 | LastUpdatedAt = table.Column(nullable: false),
28 | LastUpdatedBy = table.Column(nullable: true),
29 | IsDeletedStatus = table.Column(nullable: false),
30 | Begin = table.Column(nullable: false),
31 | End = table.Column(nullable: false),
32 | Text = table.Column(nullable: true),
33 | TranscriptionId = table.Column(nullable: true)
34 | },
35 | constraints: table =>
36 | {
37 | table.PrimaryKey("PK_Caption", x => x.Id);
38 | table.ForeignKey(
39 | name: "FK_Caption_Transcriptions_TranscriptionId",
40 | column: x => x.TranscriptionId,
41 | principalTable: "Transcriptions",
42 | principalColumn: "Id",
43 | onDelete: ReferentialAction.Restrict);
44 | });
45 |
46 | migrationBuilder.CreateIndex(
47 | name: "IX_Caption_TranscriptionId",
48 | table: "Caption",
49 | column: "TranscriptionId");
50 | }
51 |
52 | protected override void Down(MigrationBuilder migrationBuilder)
53 | {
54 | migrationBuilder.DropTable(
55 | name: "Caption");
56 |
57 | migrationBuilder.DropColumn(
58 | name: "Description",
59 | table: "Transcriptions");
60 |
61 | migrationBuilder.DropColumn(
62 | name: "Language",
63 | table: "Transcriptions");
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190722204241_Caption_Table2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Caption_Table2 : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropForeignKey(
10 | name: "FK_Caption_Transcriptions_TranscriptionId",
11 | table: "Caption");
12 |
13 | migrationBuilder.DropPrimaryKey(
14 | name: "PK_Caption",
15 | table: "Caption");
16 |
17 | migrationBuilder.RenameTable(
18 | name: "Caption",
19 | newName: "Captions");
20 |
21 | migrationBuilder.RenameIndex(
22 | name: "IX_Caption_TranscriptionId",
23 | table: "Captions",
24 | newName: "IX_Captions_TranscriptionId");
25 |
26 | migrationBuilder.AddPrimaryKey(
27 | name: "PK_Captions",
28 | table: "Captions",
29 | column: "Id");
30 |
31 | migrationBuilder.AddForeignKey(
32 | name: "FK_Captions_Transcriptions_TranscriptionId",
33 | table: "Captions",
34 | column: "TranscriptionId",
35 | principalTable: "Transcriptions",
36 | principalColumn: "Id",
37 | onDelete: ReferentialAction.Restrict);
38 | }
39 |
40 | protected override void Down(MigrationBuilder migrationBuilder)
41 | {
42 | migrationBuilder.DropForeignKey(
43 | name: "FK_Captions_Transcriptions_TranscriptionId",
44 | table: "Captions");
45 |
46 | migrationBuilder.DropPrimaryKey(
47 | name: "PK_Captions",
48 | table: "Captions");
49 |
50 | migrationBuilder.RenameTable(
51 | name: "Captions",
52 | newName: "Caption");
53 |
54 | migrationBuilder.RenameIndex(
55 | name: "IX_Captions_TranscriptionId",
56 | table: "Caption",
57 | newName: "IX_Caption_TranscriptionId");
58 |
59 | migrationBuilder.AddPrimaryKey(
60 | name: "PK_Caption",
61 | table: "Caption",
62 | column: "Id");
63 |
64 | migrationBuilder.AddForeignKey(
65 | name: "FK_Caption_Transcriptions_TranscriptionId",
66 | table: "Caption",
67 | column: "TranscriptionId",
68 | principalTable: "Transcriptions",
69 | principalColumn: "Id",
70 | onDelete: ReferentialAction.Restrict);
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190722215432_Caption_Table3.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Caption_Table3 : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Index",
11 | table: "Captions",
12 | nullable: false,
13 | defaultValue: 0);
14 | }
15 |
16 | protected override void Down(MigrationBuilder migrationBuilder)
17 | {
18 | migrationBuilder.DropColumn(
19 | name: "Index",
20 | table: "Captions");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190809193644_TranscriptionStatus.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class TranscriptionStatus : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "TranscriptionStatus",
11 | table: "Videos",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "TranscriptionStatus",
19 | table: "Videos");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190831191804_UpVote.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class UpVote : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "DownVote",
11 | table: "Captions",
12 | nullable: false,
13 | defaultValue: 0);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "UpVote",
17 | table: "Captions",
18 | nullable: false,
19 | defaultValue: 0);
20 | }
21 |
22 | protected override void Down(MigrationBuilder migrationBuilder)
23 | {
24 | migrationBuilder.DropColumn(
25 | name: "DownVote",
26 | table: "Captions");
27 |
28 | migrationBuilder.DropColumn(
29 | name: "UpVote",
30 | table: "Captions");
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190831192420_Log.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 | using System;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class Log : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.CreateTable(
11 | name: "Logs",
12 | columns: table => new
13 | {
14 | Id = table.Column(nullable: false),
15 | CreatedAt = table.Column(nullable: false),
16 | CreatedBy = table.Column(nullable: true),
17 | LastUpdatedAt = table.Column(nullable: false),
18 | LastUpdatedBy = table.Column(nullable: true),
19 | IsDeletedStatus = table.Column(nullable: false),
20 | UserId = table.Column(nullable: true),
21 | OfferingId = table.Column(nullable: true),
22 | MediaId = table.Column(nullable: true),
23 | EventType = table.Column(nullable: true),
24 | Json = table.Column(nullable: true)
25 | },
26 | constraints: table =>
27 | {
28 | table.PrimaryKey("PK_Logs", x => x.Id);
29 | table.ForeignKey(
30 | name: "FK_Logs_Medias_MediaId",
31 | column: x => x.MediaId,
32 | principalTable: "Medias",
33 | principalColumn: "Id",
34 | onDelete: ReferentialAction.Restrict);
35 | table.ForeignKey(
36 | name: "FK_Logs_Offerings_OfferingId",
37 | column: x => x.OfferingId,
38 | principalTable: "Offerings",
39 | principalColumn: "Id",
40 | onDelete: ReferentialAction.Restrict);
41 | table.ForeignKey(
42 | name: "FK_Logs_AspNetUsers_UserId",
43 | column: x => x.UserId,
44 | principalTable: "AspNetUsers",
45 | principalColumn: "Id",
46 | onDelete: ReferentialAction.Restrict);
47 | });
48 |
49 | migrationBuilder.CreateIndex(
50 | name: "IX_Logs_MediaId",
51 | table: "Logs",
52 | column: "MediaId");
53 |
54 | migrationBuilder.CreateIndex(
55 | name: "IX_Logs_OfferingId",
56 | table: "Logs",
57 | column: "OfferingId");
58 |
59 | migrationBuilder.CreateIndex(
60 | name: "IX_Logs_UserId",
61 | table: "Logs",
62 | column: "UserId");
63 | }
64 |
65 | protected override void Down(MigrationBuilder migrationBuilder)
66 | {
67 | migrationBuilder.DropTable(
68 | name: "Logs");
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190903201631_Metadata.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Metadata : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "LogEventsFlag",
11 | table: "Offerings",
12 | nullable: false,
13 | defaultValue: false);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "Metadata",
17 | table: "AspNetUsers",
18 | nullable: true);
19 | }
20 |
21 | protected override void Down(MigrationBuilder migrationBuilder)
22 | {
23 | migrationBuilder.DropColumn(
24 | name: "LogEventsFlag",
25 | table: "Offerings");
26 |
27 | migrationBuilder.DropColumn(
28 | name: "Metadata",
29 | table: "AspNetUsers");
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190910053352_FTS.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class FTS : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.Sql(@"CREATE INDEX fts_idx ON ""Captions"" USING GIN (to_tsvector('english', ""Text""));");
10 | }
11 |
12 | protected override void Down(MigrationBuilder migrationBuilder)
13 | {
14 | migrationBuilder.Sql(@"DROP INDEX fts_idx;");
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190918214544_Logs-RemoveFK.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class LogsRemoveFK : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropForeignKey(
10 | name: "FK_Logs_Medias_MediaId",
11 | table: "Logs");
12 |
13 | migrationBuilder.DropForeignKey(
14 | name: "FK_Logs_Offerings_OfferingId",
15 | table: "Logs");
16 |
17 | migrationBuilder.DropForeignKey(
18 | name: "FK_Logs_AspNetUsers_UserId",
19 | table: "Logs");
20 |
21 | migrationBuilder.DropIndex(
22 | name: "IX_Logs_MediaId",
23 | table: "Logs");
24 |
25 | migrationBuilder.DropIndex(
26 | name: "IX_Logs_OfferingId",
27 | table: "Logs");
28 |
29 | migrationBuilder.DropIndex(
30 | name: "IX_Logs_UserId",
31 | table: "Logs");
32 | }
33 |
34 | protected override void Down(MigrationBuilder migrationBuilder)
35 | {
36 | migrationBuilder.CreateIndex(
37 | name: "IX_Logs_MediaId",
38 | table: "Logs",
39 | column: "MediaId");
40 |
41 | migrationBuilder.CreateIndex(
42 | name: "IX_Logs_OfferingId",
43 | table: "Logs",
44 | column: "OfferingId");
45 |
46 | migrationBuilder.CreateIndex(
47 | name: "IX_Logs_UserId",
48 | table: "Logs",
49 | column: "UserId");
50 |
51 | migrationBuilder.AddForeignKey(
52 | name: "FK_Logs_Medias_MediaId",
53 | table: "Logs",
54 | column: "MediaId",
55 | principalTable: "Medias",
56 | principalColumn: "Id",
57 | onDelete: ReferentialAction.Restrict);
58 |
59 | migrationBuilder.AddForeignKey(
60 | name: "FK_Logs_Offerings_OfferingId",
61 | table: "Logs",
62 | column: "OfferingId",
63 | principalTable: "Offerings",
64 | principalColumn: "Id",
65 | onDelete: ReferentialAction.Restrict);
66 |
67 | migrationBuilder.AddForeignKey(
68 | name: "FK_Logs_AspNetUsers_UserId",
69 | table: "Logs",
70 | column: "UserId",
71 | principalTable: "AspNetUsers",
72 | principalColumn: "Id",
73 | onDelete: ReferentialAction.Restrict);
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20190922221537_Add_Processed_Video.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Add_Processed_Video : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "ProcessedVideo1Id",
11 | table: "Videos",
12 | nullable: true);
13 |
14 | migrationBuilder.AddColumn(
15 | name: "ProcessedVideo2Id",
16 | table: "Videos",
17 | nullable: true);
18 |
19 | migrationBuilder.CreateIndex(
20 | name: "IX_Videos_ProcessedVideo1Id",
21 | table: "Videos",
22 | column: "ProcessedVideo1Id");
23 |
24 | migrationBuilder.CreateIndex(
25 | name: "IX_Videos_ProcessedVideo2Id",
26 | table: "Videos",
27 | column: "ProcessedVideo2Id");
28 |
29 | migrationBuilder.AddForeignKey(
30 | name: "FK_Videos_FileRecords_ProcessedVideo1Id",
31 | table: "Videos",
32 | column: "ProcessedVideo1Id",
33 | principalTable: "FileRecords",
34 | principalColumn: "Id",
35 | onDelete: ReferentialAction.Restrict);
36 |
37 | migrationBuilder.AddForeignKey(
38 | name: "FK_Videos_FileRecords_ProcessedVideo2Id",
39 | table: "Videos",
40 | column: "ProcessedVideo2Id",
41 | principalTable: "FileRecords",
42 | principalColumn: "Id",
43 | onDelete: ReferentialAction.Restrict);
44 | }
45 |
46 | protected override void Down(MigrationBuilder migrationBuilder)
47 | {
48 | migrationBuilder.DropForeignKey(
49 | name: "FK_Videos_FileRecords_ProcessedVideo1Id",
50 | table: "Videos");
51 |
52 | migrationBuilder.DropForeignKey(
53 | name: "FK_Videos_FileRecords_ProcessedVideo2Id",
54 | table: "Videos");
55 |
56 | migrationBuilder.DropIndex(
57 | name: "IX_Videos_ProcessedVideo1Id",
58 | table: "Videos");
59 |
60 | migrationBuilder.DropIndex(
61 | name: "IX_Videos_ProcessedVideo2Id",
62 | table: "Videos");
63 |
64 | migrationBuilder.DropColumn(
65 | name: "ProcessedVideo1Id",
66 | table: "Videos");
67 |
68 | migrationBuilder.DropColumn(
69 | name: "ProcessedVideo2Id",
70 | table: "Videos");
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191024223759_CourseName-Desc.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class CourseNameDesc : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "CourseName",
11 | table: "Offerings",
12 | nullable: true);
13 |
14 | migrationBuilder.AddColumn(
15 | name: "Description",
16 | table: "Offerings",
17 | nullable: true);
18 | }
19 |
20 | protected override void Down(MigrationBuilder migrationBuilder)
21 | {
22 | migrationBuilder.DropColumn(
23 | name: "CourseName",
24 | table: "Offerings");
25 |
26 | migrationBuilder.DropColumn(
27 | name: "Description",
28 | table: "Offerings");
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191024234713_DropCourseName-Desc-From-Courses.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class DropCourseNameDescFromCourses : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropColumn(
10 | name: "CourseName",
11 | table: "Courses");
12 |
13 | migrationBuilder.DropColumn(
14 | name: "Description",
15 | table: "Courses");
16 | }
17 |
18 | protected override void Down(MigrationBuilder migrationBuilder)
19 | {
20 | migrationBuilder.AddColumn(
21 | name: "CourseName",
22 | table: "Courses",
23 | nullable: true);
24 |
25 | migrationBuilder.AddColumn(
26 | name: "Description",
27 | table: "Courses",
28 | nullable: true);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191025190603_Add_VideoId.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Add_VideoId : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "VideoId",
11 | table: "Medias",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "VideoId",
19 | table: "Medias");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191025194553_Drop_MediaId_From_Video.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Drop_MediaId_From_Video : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 |
10 | }
11 |
12 | protected override void Down(MigrationBuilder migrationBuilder)
13 | {
14 |
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191025195048_Drop_MediaId_From_Video2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Drop_MediaId_From_Video2 : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropForeignKey(
10 | name: "FK_Videos_Medias_MediaId",
11 | table: "Videos");
12 |
13 | migrationBuilder.DropIndex(
14 | name: "IX_Videos_MediaId",
15 | table: "Videos");
16 |
17 | migrationBuilder.DropColumn(
18 | name: "MediaId",
19 | table: "Videos");
20 | }
21 |
22 | protected override void Down(MigrationBuilder migrationBuilder)
23 | {
24 | migrationBuilder.AddColumn(
25 | name: "MediaId",
26 | table: "Videos",
27 | nullable: true);
28 |
29 | migrationBuilder.CreateIndex(
30 | name: "IX_Videos_MediaId",
31 | table: "Videos",
32 | column: "MediaId");
33 |
34 | migrationBuilder.AddForeignKey(
35 | name: "FK_Videos_Medias_MediaId",
36 | table: "Videos",
37 | column: "MediaId",
38 | principalTable: "Medias",
39 | principalColumn: "Id",
40 | onDelete: ReferentialAction.Restrict);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191025195537_Add_Medias_to_Video.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Add_Medias_to_Video : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.CreateIndex(
10 | name: "IX_Medias_VideoId",
11 | table: "Medias",
12 | column: "VideoId");
13 |
14 | migrationBuilder.AddForeignKey(
15 | name: "FK_Medias_Videos_VideoId",
16 | table: "Medias",
17 | column: "VideoId",
18 | principalTable: "Videos",
19 | principalColumn: "Id",
20 | onDelete: ReferentialAction.Restrict);
21 | }
22 |
23 | protected override void Down(MigrationBuilder migrationBuilder)
24 | {
25 | migrationBuilder.DropForeignKey(
26 | name: "FK_Medias_Videos_VideoId",
27 | table: "Medias");
28 |
29 | migrationBuilder.DropIndex(
30 | name: "IX_Medias_VideoId",
31 | table: "Medias");
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191025215955_Transcription_Refactor.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Transcription_Refactor : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "VideoId",
11 | table: "Transcriptions",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "VideoId",
19 | table: "Transcriptions");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191025232219_Transcription_Refactorv2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Transcription_Refactorv2 : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropForeignKey(
10 | name: "FK_Transcriptions_Medias_MediaId",
11 | table: "Transcriptions");
12 |
13 | migrationBuilder.DropIndex(
14 | name: "IX_Transcriptions_MediaId",
15 | table: "Transcriptions");
16 |
17 | migrationBuilder.DropColumn(
18 | name: "MediaId",
19 | table: "Transcriptions");
20 |
21 | migrationBuilder.CreateIndex(
22 | name: "IX_Transcriptions_VideoId",
23 | table: "Transcriptions",
24 | column: "VideoId");
25 |
26 | migrationBuilder.AddForeignKey(
27 | name: "FK_Transcriptions_Videos_VideoId",
28 | table: "Transcriptions",
29 | column: "VideoId",
30 | principalTable: "Videos",
31 | principalColumn: "Id",
32 | onDelete: ReferentialAction.Restrict);
33 | }
34 |
35 | protected override void Down(MigrationBuilder migrationBuilder)
36 | {
37 | migrationBuilder.DropForeignKey(
38 | name: "FK_Transcriptions_Videos_VideoId",
39 | table: "Transcriptions");
40 |
41 | migrationBuilder.DropIndex(
42 | name: "IX_Transcriptions_VideoId",
43 | table: "Transcriptions");
44 |
45 | migrationBuilder.AddColumn(
46 | name: "MediaId",
47 | table: "Transcriptions",
48 | nullable: true);
49 |
50 | migrationBuilder.CreateIndex(
51 | name: "IX_Transcriptions_MediaId",
52 | table: "Transcriptions",
53 | column: "MediaId");
54 |
55 | migrationBuilder.AddForeignKey(
56 | name: "FK_Transcriptions_Medias_MediaId",
57 | table: "Transcriptions",
58 | column: "MediaId",
59 | principalTable: "Medias",
60 | principalColumn: "Id",
61 | onDelete: ReferentialAction.Restrict);
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191026021015_SrtFile.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class SrtFile : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "SrtFileId",
11 | table: "Transcriptions",
12 | nullable: true);
13 |
14 | migrationBuilder.CreateIndex(
15 | name: "IX_Transcriptions_SrtFileId",
16 | table: "Transcriptions",
17 | column: "SrtFileId");
18 |
19 | migrationBuilder.AddForeignKey(
20 | name: "FK_Transcriptions_FileRecords_SrtFileId",
21 | table: "Transcriptions",
22 | column: "SrtFileId",
23 | principalTable: "FileRecords",
24 | principalColumn: "Id",
25 | onDelete: ReferentialAction.Restrict);
26 | }
27 |
28 | protected override void Down(MigrationBuilder migrationBuilder)
29 | {
30 | migrationBuilder.DropForeignKey(
31 | name: "FK_Transcriptions_FileRecords_SrtFileId",
32 | table: "Transcriptions");
33 |
34 | migrationBuilder.DropIndex(
35 | name: "IX_Transcriptions_SrtFileId",
36 | table: "Transcriptions");
37 |
38 | migrationBuilder.DropColumn(
39 | name: "SrtFileId",
40 | table: "Transcriptions");
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191112212156_EPub.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 | using System;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class EPub : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.CreateTable(
11 | name: "EPub",
12 | columns: table => new
13 | {
14 | Id = table.Column(nullable: false),
15 | CreatedAt = table.Column(nullable: false),
16 | CreatedBy = table.Column(nullable: true),
17 | LastUpdatedAt = table.Column(nullable: false),
18 | LastUpdatedBy = table.Column(nullable: true),
19 | IsDeletedStatus = table.Column(nullable: false),
20 | Language = table.Column(nullable: true),
21 | FileId = table.Column(nullable: true),
22 | VideoId = table.Column(nullable: true)
23 | },
24 | constraints: table =>
25 | {
26 | table.PrimaryKey("PK_EPub", x => x.Id);
27 | table.ForeignKey(
28 | name: "FK_EPub_FileRecords_FileId",
29 | column: x => x.FileId,
30 | principalTable: "FileRecords",
31 | principalColumn: "Id",
32 | onDelete: ReferentialAction.Restrict);
33 | table.ForeignKey(
34 | name: "FK_EPub_Videos_VideoId",
35 | column: x => x.VideoId,
36 | principalTable: "Videos",
37 | principalColumn: "Id",
38 | onDelete: ReferentialAction.Restrict);
39 | });
40 |
41 | migrationBuilder.CreateIndex(
42 | name: "IX_EPub_FileId",
43 | table: "EPub",
44 | column: "FileId");
45 |
46 | migrationBuilder.CreateIndex(
47 | name: "IX_EPub_VideoId",
48 | table: "EPub",
49 | column: "VideoId");
50 | }
51 |
52 | protected override void Down(MigrationBuilder migrationBuilder)
53 | {
54 | migrationBuilder.DropTable(
55 | name: "EPub");
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20191121171237_TranscribingAttempts.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class TranscribingAttempts : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "TranscribingAttempts",
11 | table: "Videos",
12 | nullable: false,
13 | defaultValue: 0);
14 | }
15 |
16 | protected override void Down(MigrationBuilder migrationBuilder)
17 | {
18 | migrationBuilder.DropColumn(
19 | name: "TranscribingAttempts",
20 | table: "Videos");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200119114020_Video.SceneData.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class VideoSceneData : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "JsonMetadata",
11 | table: "Videos",
12 | nullable: true);
13 |
14 | migrationBuilder.AddColumn(
15 | name: "SceneData",
16 | table: "Videos",
17 | nullable: true);
18 | }
19 |
20 | protected override void Down(MigrationBuilder migrationBuilder)
21 | {
22 | migrationBuilder.DropColumn(
23 | name: "JsonMetadata",
24 | table: "Videos");
25 |
26 | migrationBuilder.DropColumn(
27 | name: "SceneData",
28 | table: "Videos");
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200127214916_CaptionType.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class CaptionType : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "CaptionType",
11 | table: "Captions",
12 | nullable: false,
13 | defaultValue: 0);
14 | }
15 |
16 | protected override void Down(MigrationBuilder migrationBuilder)
17 | {
18 | migrationBuilder.DropColumn(
19 | name: "CaptionType",
20 | table: "Captions");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200205033251_Dictionary.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
3 | using System;
4 |
5 | namespace ClassTranscribeDatabase.Migrations
6 | {
7 | public partial class Dictionary : Migration
8 | {
9 | protected override void Up(MigrationBuilder migrationBuilder)
10 | {
11 | migrationBuilder.AlterColumn(
12 | name: "Id",
13 | table: "AspNetUserClaims",
14 | nullable: false,
15 | oldClrType: typeof(int))
16 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
17 | .OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn);
18 |
19 | migrationBuilder.AlterColumn(
20 | name: "Id",
21 | table: "AspNetRoleClaims",
22 | nullable: false,
23 | oldClrType: typeof(int))
24 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
25 | .OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn);
26 |
27 | migrationBuilder.CreateTable(
28 | name: "Dictionaries",
29 | columns: table => new
30 | {
31 | Id = table.Column(nullable: false),
32 | CreatedAt = table.Column(nullable: false),
33 | CreatedBy = table.Column(nullable: true),
34 | LastUpdatedAt = table.Column(nullable: false),
35 | LastUpdatedBy = table.Column(nullable: true),
36 | IsDeletedStatus = table.Column(nullable: false),
37 | Key = table.Column(nullable: true),
38 | Value = table.Column(nullable: true)
39 | },
40 | constraints: table =>
41 | {
42 | table.PrimaryKey("PK_Dictionaries", x => x.Id);
43 | });
44 | }
45 |
46 | protected override void Down(MigrationBuilder migrationBuilder)
47 | {
48 | migrationBuilder.DropTable(
49 | name: "Dictionaries");
50 |
51 | migrationBuilder.AlterColumn(
52 | name: "Id",
53 | table: "AspNetUserClaims",
54 | nullable: false,
55 | oldClrType: typeof(int))
56 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
57 | .OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
58 |
59 | migrationBuilder.AlterColumn(
60 | name: "Id",
61 | table: "AspNetRoleClaims",
62 | nullable: false,
63 | oldClrType: typeof(int))
64 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
65 | .OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200205192815_Playlist_JsonMetaData.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Playlist_JsonMetaData : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "JsonMetadata",
11 | table: "Playlists",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "JsonMetadata",
19 | table: "Playlists");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200212000529_Media-Name.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class MediaName : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Name",
11 | table: "Medias",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "Name",
19 | table: "Medias");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200306150525_ChangedUser.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class ChangedUser : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 |
10 | }
11 |
12 | protected override void Down(MigrationBuilder migrationBuilder)
13 | {
14 |
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200326193756_Offering-JsonMetadata.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class OfferingJsonMetadata : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "JsonMetadata",
11 | table: "Offerings",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "JsonMetadata",
19 | table: "Offerings");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200326194432_Add_WatchHistory_Table.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class Add_WatchHistory_Table : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.CreateTable(
11 | name: "WatchHistories",
12 | columns: table => new
13 | {
14 | Id = table.Column(nullable: false),
15 | CreatedAt = table.Column(nullable: false),
16 | CreatedBy = table.Column(nullable: true),
17 | LastUpdatedAt = table.Column(nullable: false),
18 | LastUpdatedBy = table.Column(nullable: true),
19 | IsDeletedStatus = table.Column(nullable: false),
20 | MediaId = table.Column(nullable: true),
21 | ApplicationUserId = table.Column(nullable: true),
22 | Json = table.Column(nullable: true)
23 | },
24 | constraints: table =>
25 | {
26 | table.PrimaryKey("PK_WatchHistories", x => x.Id);
27 | table.ForeignKey(
28 | name: "FK_WatchHistories_AspNetUsers_ApplicationUserId",
29 | column: x => x.ApplicationUserId,
30 | principalTable: "AspNetUsers",
31 | principalColumn: "Id",
32 | onDelete: ReferentialAction.Restrict);
33 | table.ForeignKey(
34 | name: "FK_WatchHistories_Medias_MediaId",
35 | column: x => x.MediaId,
36 | principalTable: "Medias",
37 | principalColumn: "Id",
38 | onDelete: ReferentialAction.Restrict);
39 | });
40 |
41 | migrationBuilder.CreateIndex(
42 | name: "IX_WatchHistories_ApplicationUserId",
43 | table: "WatchHistories",
44 | column: "ApplicationUserId");
45 |
46 | migrationBuilder.CreateIndex(
47 | name: "IX_WatchHistories_MediaId",
48 | table: "WatchHistories",
49 | column: "MediaId");
50 | }
51 |
52 | protected override void Down(MigrationBuilder migrationBuilder)
53 | {
54 | migrationBuilder.DropTable(
55 | name: "WatchHistories");
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200331223215_Indexing.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Indexing : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Index",
11 | table: "Playlists",
12 | nullable: false,
13 | defaultValue: 0);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "Index",
17 | table: "Medias",
18 | nullable: false,
19 | defaultValue: 0);
20 | }
21 |
22 | protected override void Down(MigrationBuilder migrationBuilder)
23 | {
24 | migrationBuilder.DropColumn(
25 | name: "Index",
26 | table: "Playlists");
27 |
28 | migrationBuilder.DropColumn(
29 | name: "Index",
30 | table: "Medias");
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200414071209_Epubchapter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class Epubchapter : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.AddColumn(
11 | name: "Json",
12 | table: "EPubs",
13 | nullable: true);
14 |
15 | migrationBuilder.CreateTable(
16 | name: "EPubChapters",
17 | columns: table => new
18 | {
19 | Id = table.Column(nullable: false),
20 | CreatedAt = table.Column(nullable: false),
21 | CreatedBy = table.Column(nullable: true),
22 | LastUpdatedAt = table.Column(nullable: false),
23 | LastUpdatedBy = table.Column(nullable: true),
24 | IsDeletedStatus = table.Column(nullable: false),
25 | EPubId = table.Column(nullable: true),
26 | Data = table.Column(nullable: true)
27 | },
28 | constraints: table =>
29 | {
30 | table.PrimaryKey("PK_EPubChapters", x => x.Id);
31 | table.ForeignKey(
32 | name: "FK_EPubChapters_EPubs_EPubId",
33 | column: x => x.EPubId,
34 | principalTable: "EPubs",
35 | principalColumn: "Id",
36 | onDelete: ReferentialAction.Restrict);
37 | });
38 |
39 | migrationBuilder.CreateIndex(
40 | name: "IX_EPubChapters_EPubId",
41 | table: "EPubChapters",
42 | column: "EPubId");
43 | }
44 |
45 | protected override void Down(MigrationBuilder migrationBuilder)
46 | {
47 | migrationBuilder.DropTable(
48 | name: "EPubChapters");
49 |
50 | migrationBuilder.DropColumn(
51 | name: "Json",
52 | table: "EPubs");
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20200612211632_TaskItems.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class TaskItems : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.CreateTable(
11 | name: "TaskItems",
12 | columns: table => new
13 | {
14 | Id = table.Column(nullable: false),
15 | CreatedAt = table.Column(nullable: false),
16 | CreatedBy = table.Column(nullable: true),
17 | LastUpdatedAt = table.Column(nullable: false),
18 | LastUpdatedBy = table.Column(nullable: true),
19 | IsDeletedStatus = table.Column(nullable: false),
20 | UniqueId = table.Column(nullable: false),
21 | TaskType = table.Column(nullable: false),
22 | Attempts = table.Column(nullable: false),
23 | TaskParameters = table.Column(nullable: true),
24 | Result = table.Column(nullable: false),
25 | Retry = table.Column(nullable: false),
26 | ResultData = table.Column(nullable: true)
27 | },
28 | constraints: table =>
29 | {
30 | table.PrimaryKey("PK_TaskItems", x => x.Id);
31 | table.UniqueConstraint("AK_TaskItems_UniqueId_TaskType", x => new { x.UniqueId, x.TaskType });
32 | });
33 | }
34 |
35 | protected override void Down(MigrationBuilder migrationBuilder)
36 | {
37 | migrationBuilder.DropTable(
38 | name: "TaskItems");
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20201005192717_EPubFix.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class EPubFix : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 |
10 | }
11 |
12 | protected override void Down(MigrationBuilder migrationBuilder)
13 | {
14 |
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20201008171703_AddDurationFileMediaInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class AddDurationFileMediaInfo : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.AddColumn(
11 | name: "Duration",
12 | table: "Videos",
13 | nullable: true);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "FileMediaInfo",
17 | table: "Videos",
18 | nullable: true);
19 | }
20 |
21 | protected override void Down(MigrationBuilder migrationBuilder)
22 | {
23 | migrationBuilder.DropColumn(
24 | name: "Duration",
25 | table: "Videos");
26 |
27 | migrationBuilder.DropColumn(
28 | name: "FileMediaInfo",
29 | table: "Videos");
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20201113200736_Disable_Soft_Delete_UserOffering.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class Disable_Soft_Delete_UserOffering : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DeleteData(
10 | table: "UserOfferings",
11 | keyColumn: "IsDeletedStatus",
12 | keyValue: 1
13 | );
14 |
15 | migrationBuilder.DropForeignKey(
16 | name: "FK_UserOfferings_AspNetRoles_IdentityRoleId",
17 | table: "UserOfferings");
18 |
19 | migrationBuilder.DropPrimaryKey(
20 | name: "PK_UserOfferings",
21 | table: "UserOfferings");
22 |
23 | migrationBuilder.AlterColumn(
24 | name: "IdentityRoleId",
25 | table: "UserOfferings",
26 | nullable: false,
27 | oldClrType: typeof(string),
28 | oldType: "text",
29 | oldNullable: true);
30 |
31 | migrationBuilder.AddPrimaryKey(
32 | name: "PK_UserOfferings",
33 | table: "UserOfferings",
34 | columns: new[] { "ApplicationUserId", "OfferingId", "IdentityRoleId" });
35 |
36 | migrationBuilder.AddForeignKey(
37 | name: "FK_UserOfferings_AspNetRoles_IdentityRoleId",
38 | table: "UserOfferings",
39 | column: "IdentityRoleId",
40 | principalTable: "AspNetRoles",
41 | principalColumn: "Id",
42 | onDelete: ReferentialAction.Cascade);
43 | }
44 |
45 | protected override void Down(MigrationBuilder migrationBuilder)
46 | {
47 | migrationBuilder.DropForeignKey(
48 | name: "FK_UserOfferings_AspNetRoles_IdentityRoleId",
49 | table: "UserOfferings");
50 |
51 | migrationBuilder.DropPrimaryKey(
52 | name: "PK_UserOfferings",
53 | table: "UserOfferings");
54 |
55 | migrationBuilder.AlterColumn(
56 | name: "IdentityRoleId",
57 | table: "UserOfferings",
58 | type: "text",
59 | nullable: true,
60 | oldClrType: typeof(string));
61 |
62 | migrationBuilder.AddPrimaryKey(
63 | name: "PK_UserOfferings",
64 | table: "UserOfferings",
65 | columns: new[] { "ApplicationUserId", "OfferingId" });
66 |
67 | migrationBuilder.AddForeignKey(
68 | name: "FK_UserOfferings_AspNetRoles_IdentityRoleId",
69 | table: "UserOfferings",
70 | column: "IdentityRoleId",
71 | principalTable: "AspNetRoles",
72 | principalColumn: "Id",
73 | onDelete: ReferentialAction.Restrict);
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20201201145853_PublishControlForOfferings.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class PublishControlForOfferings : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "IsPublished",
11 | table: "Playlists",
12 | nullable: false,
13 | defaultValue: true);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "IsPublished",
17 | table: "Offerings",
18 | nullable: false,
19 | defaultValue: true);
20 |
21 | migrationBuilder.AddColumn(
22 | name: "IsPublished",
23 | table: "Medias",
24 | nullable: false,
25 | defaultValue: true);
26 | }
27 |
28 | protected override void Down(MigrationBuilder migrationBuilder)
29 | {
30 | migrationBuilder.DropColumn(
31 | name: "IsPublished",
32 | table: "Playlists");
33 |
34 | migrationBuilder.DropColumn(
35 | name: "IsPublished",
36 | table: "Offerings");
37 |
38 | migrationBuilder.DropColumn(
39 | name: "IsPublished",
40 | table: "Medias");
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20210908174659_NonnullVideoJObjects.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class NonnullVideoJObjects : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.Sql("UPDATE \"Videos\" SET \"SceneData\" = '{}' WHERE \"SceneData\" IS NULL");
10 | migrationBuilder.Sql("UPDATE \"Videos\" SET \"JsonMetadata\" = '{}' WHERE \"JsonMetadata\" IS NULL");
11 | migrationBuilder.Sql("UPDATE \"Videos\" SET \"FileMediaInfo\" = '{}' WHERE \"FileMediaInfo\" IS NULL");
12 |
13 | migrationBuilder.AlterColumn(
14 | name: "SceneData",
15 | table: "Videos",
16 | nullable: false,
17 | oldClrType: typeof(string),
18 | oldType: "text",
19 | oldNullable: true);
20 |
21 | migrationBuilder.AlterColumn(
22 | name: "JsonMetadata",
23 | table: "Videos",
24 | nullable: false,
25 | oldClrType: typeof(string),
26 | oldType: "text",
27 | oldNullable: true);
28 |
29 | migrationBuilder.AlterColumn(
30 | name: "FileMediaInfo",
31 | table: "Videos",
32 | nullable: false,
33 | oldClrType: typeof(string),
34 | oldType: "text",
35 | oldNullable: true);
36 | }
37 |
38 | protected override void Down(MigrationBuilder migrationBuilder)
39 | {
40 | migrationBuilder.AlterColumn(
41 | name: "SceneData",
42 | table: "Videos",
43 | type: "text",
44 | nullable: true,
45 | oldClrType: typeof(string));
46 |
47 | migrationBuilder.AlterColumn(
48 | name: "JsonMetadata",
49 | table: "Videos",
50 | type: "text",
51 | nullable: true,
52 | oldClrType: typeof(string));
53 |
54 | migrationBuilder.AlterColumn(
55 | name: "FileMediaInfo",
56 | table: "Videos",
57 | type: "text",
58 | nullable: true,
59 | oldClrType: typeof(string));
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20211013142047_TranscriptionsUpdate.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class TranscriptionsUpdate : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Editable",
11 | table: "Transcriptions",
12 | nullable: false,
13 | defaultValue: 0);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "Label",
17 | table: "Transcriptions",
18 | nullable: true);
19 |
20 | migrationBuilder.AddColumn(
21 | name: "PublishStatus",
22 | table: "Transcriptions",
23 | nullable: false,
24 | defaultValue: 0);
25 |
26 | migrationBuilder.AddColumn(
27 | name: "SourceInternalRef",
28 | table: "Transcriptions",
29 | nullable: true);
30 |
31 | migrationBuilder.AddColumn(
32 | name: "SourceLabel",
33 | table: "Transcriptions",
34 | nullable: true);
35 |
36 | migrationBuilder.AddColumn(
37 | name: "TranscriptionType",
38 | table: "Transcriptions",
39 | nullable: false,
40 | defaultValue: 0);
41 | }
42 |
43 | protected override void Down(MigrationBuilder migrationBuilder)
44 | {
45 | migrationBuilder.DropColumn(
46 | name: "Editable",
47 | table: "Transcriptions");
48 |
49 | migrationBuilder.DropColumn(
50 | name: "Label",
51 | table: "Transcriptions");
52 |
53 | migrationBuilder.DropColumn(
54 | name: "PublishStatus",
55 | table: "Transcriptions");
56 |
57 | migrationBuilder.DropColumn(
58 | name: "SourceInternalRef",
59 | table: "Transcriptions");
60 |
61 | migrationBuilder.DropColumn(
62 | name: "SourceLabel",
63 | table: "Transcriptions");
64 |
65 | migrationBuilder.DropColumn(
66 | name: "TranscriptionType",
67 | table: "Transcriptions");
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20211116200810_FilePath.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class FilePath : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "FilePath",
11 | table: "Courses",
12 | nullable: true);
13 |
14 | migrationBuilder.AddColumn(
15 | name: "FilePath",
16 | table: "CourseOfferings",
17 | nullable: true);
18 | }
19 |
20 | protected override void Down(MigrationBuilder migrationBuilder)
21 | {
22 | migrationBuilder.DropColumn(
23 | name: "FilePath",
24 | table: "Courses");
25 |
26 | migrationBuilder.DropColumn(
27 | name: "FilePath",
28 | table: "CourseOfferings");
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20220722044401_Glossary.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
4 |
5 | namespace ClassTranscribeDatabase.Migrations
6 | {
7 | public partial class Glossary : Migration
8 | {
9 | protected override void Up(MigrationBuilder migrationBuilder)
10 | {
11 | migrationBuilder.CreateTable(
12 | name: "Glossaries",
13 | columns: table => new
14 | {
15 | Id = table.Column(nullable: false),
16 | CreatedAt = table.Column(nullable: false),
17 | CreatedBy = table.Column(nullable: true),
18 | LastUpdatedAt = table.Column(nullable: false),
19 | LastUpdatedBy = table.Column(nullable: true),
20 | IsDeletedStatus = table.Column(nullable: false),
21 | DeletedAt = table.Column(nullable: true),
22 | DeletedBy = table.Column(nullable: true),
23 | Term = table.Column(nullable: true),
24 | Link = table.Column(nullable: true),
25 | Description = table.Column(nullable: true),
26 | Source = table.Column(nullable: true),
27 | LicenseTag = table.Column(nullable: true),
28 | Domain = table.Column(nullable: true),
29 | Likes = table.Column(nullable: true),
30 | Shared = table.Column(nullable: false),
31 | Editable = table.Column(nullable: false),
32 | CourseId = table.Column(nullable: true),
33 | OfferingId = table.Column(nullable: true)
34 | },
35 | constraints: table =>
36 | {
37 | table.PrimaryKey("PK_Glossaries", x => x.Id);
38 | table.ForeignKey(
39 | name: "FK_Glossaries_CourseOfferings_CourseId_OfferingId",
40 | columns: x => new { x.CourseId, x.OfferingId },
41 | principalTable: "CourseOfferings",
42 | principalColumns: new[] { "CourseId", "OfferingId" },
43 | onDelete: ReferentialAction.Restrict);
44 | });
45 |
46 | migrationBuilder.CreateIndex(
47 | name: "IX_Glossaries_CourseId_OfferingId",
48 | table: "Glossaries",
49 | columns: new[] { "CourseId", "OfferingId" });
50 | }
51 |
52 | protected override void Down(MigrationBuilder migrationBuilder)
53 | {
54 | migrationBuilder.DropTable(
55 | name: "Glossaries");
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20220901042623_AddGlossaryToVideo.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class AddGlossaryToVideo : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Glossary",
11 | table: "Videos",
12 | nullable: false,
13 | defaultValue: "");
14 |
15 | }
16 |
17 | protected override void Down(MigrationBuilder migrationBuilder)
18 | {
19 | migrationBuilder.DropColumn(
20 | name: "Glossary",
21 | table: "Videos");
22 |
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20220930063430_ASLVideo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
4 |
5 | namespace ClassTranscribeDatabase.Migrations
6 | {
7 | public partial class ASLVideo : Migration
8 | {
9 | protected override void Up(MigrationBuilder migrationBuilder)
10 | {
11 | migrationBuilder.CreateTable(
12 | name: "ASLVideos",
13 | columns: table => new
14 | {
15 | Id = table.Column(nullable: false),
16 | CreatedAt = table.Column(nullable: false),
17 | CreatedBy = table.Column(nullable: true),
18 | LastUpdatedAt = table.Column(nullable: false),
19 | LastUpdatedBy = table.Column(nullable: true),
20 | IsDeletedStatus = table.Column(nullable: false),
21 | DeletedAt = table.Column(nullable: true),
22 | DeletedBy = table.Column(nullable: true),
23 | Term = table.Column(nullable: true),
24 | Kind = table.Column(nullable: false),
25 | Text = table.Column(nullable: true),
26 | Link = table.Column(nullable: true),
27 | Source = table.Column(nullable: true),
28 | LicenseTag = table.Column(nullable: true),
29 | Shared = table.Column(nullable: false),
30 | Editable = table.Column(nullable: false),
31 | Domain = table.Column(nullable: true),
32 | Likes = table.Column(nullable: false),
33 | CourseId = table.Column(nullable: true),
34 | OfferingId = table.Column(nullable: true)
35 | },
36 | constraints: table =>
37 | {
38 | table.PrimaryKey("PK_ASLVideos", x => x.Id);
39 | table.ForeignKey(
40 | name: "FK_ASLVideos_CourseOfferings_CourseId_OfferingId",
41 | columns: x => new { x.CourseId, x.OfferingId },
42 | principalTable: "CourseOfferings",
43 | principalColumns: new[] { "CourseId", "OfferingId" },
44 | onDelete: ReferentialAction.Restrict);
45 | });
46 |
47 | migrationBuilder.CreateIndex(
48 | name: "IX_ASLVideos_CourseId_OfferingId",
49 | table: "ASLVideos",
50 | columns: new[] { "CourseId", "OfferingId" });
51 | }
52 |
53 | protected override void Down(MigrationBuilder migrationBuilder)
54 | {
55 |
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20220930075448_ASLGlossaryMap.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class ASLGlossaryMap : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.CreateTable(
11 | name: "ASLVideoGlossaryMaps",
12 | columns: table => new
13 | {
14 | Id = table.Column(nullable: false),
15 | CreatedAt = table.Column(nullable: false),
16 | CreatedBy = table.Column(nullable: true),
17 | LastUpdatedAt = table.Column(nullable: false),
18 | LastUpdatedBy = table.Column(nullable: true),
19 | IsDeletedStatus = table.Column(nullable: false),
20 | DeletedAt = table.Column(nullable: true),
21 | DeletedBy = table.Column(nullable: true),
22 | GlossaryId = table.Column(nullable: true),
23 | ASLVideoId = table.Column(nullable: true)
24 | },
25 | constraints: table =>
26 | {
27 | table.PrimaryKey("PK_ASLVideoGlossaryMaps", x => x.Id);
28 | });
29 | }
30 |
31 | protected override void Down(MigrationBuilder migrationBuilder)
32 | {
33 | migrationBuilder.DropTable(
34 | name: "ASLVideoGlossaryMaps");
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20221116162318_PhraseHintJsonTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class PhraseHintJsonTable : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | // migrationBuilder.DropColumn(
11 | // name: "ASLVideo",
12 | // table: "Videos");
13 |
14 | migrationBuilder.AddColumn(
15 | name: "PhraseHintDataId",
16 | table: "Videos",
17 | nullable: true);
18 |
19 | migrationBuilder.CreateTable(
20 | name: "JsonData",
21 | columns: table => new
22 | {
23 | Id = table.Column(nullable: false),
24 | CreatedAt = table.Column(nullable: false),
25 | CreatedBy = table.Column(nullable: true),
26 | LastUpdatedAt = table.Column(nullable: false),
27 | LastUpdatedBy = table.Column(nullable: true),
28 | IsDeletedStatus = table.Column(nullable: false),
29 | DeletedAt = table.Column(nullable: true),
30 | DeletedBy = table.Column(nullable: true),
31 | Json = table.Column(nullable: true)
32 | },
33 | constraints: table =>
34 | {
35 | table.PrimaryKey("PK_JsonData", x => x.Id);
36 | });
37 |
38 | migrationBuilder.CreateIndex(
39 | name: "IX_Videos_PhraseHintDataId",
40 | table: "Videos",
41 | column: "PhraseHintDataId");
42 |
43 | migrationBuilder.AddForeignKey(
44 | name: "FK_Videos_JsonData_PhraseHintDataId",
45 | table: "Videos",
46 | column: "PhraseHintDataId",
47 | principalTable: "JsonData",
48 | principalColumn: "Id",
49 | onDelete: ReferentialAction.Restrict);
50 | }
51 |
52 | protected override void Down(MigrationBuilder migrationBuilder)
53 | {
54 | migrationBuilder.DropForeignKey(
55 | name: "FK_Videos_JsonData_PhraseHintDataId",
56 | table: "Videos");
57 |
58 | migrationBuilder.DropTable(
59 | name: "JsonData");
60 |
61 | // migrationBuilder.DropIndex(
62 | // name: "IX_Videos_PhraseHintDataId",
63 | // table: "Videos");
64 |
65 | migrationBuilder.DropColumn(
66 | name: "PhraseHintDataId",
67 | table: "Videos");
68 |
69 | // migrationBuilder.AddColumn(
70 | // name: "ASLVideo",
71 | // table: "Videos",
72 | // type: "text",
73 | // nullable: false,
74 | // defaultValue: "");
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20221116223342_LightweightVideo.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class LightweightVideo : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 |
10 | }
11 |
12 | protected override void Down(MigrationBuilder migrationBuilder)
13 | {
14 |
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20221116231920_LightweightVideo2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class LightweightVideo2 : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropForeignKey(
10 | name: "FK_Videos_TextData_PhraseHintsDataId",
11 | table: "Videos");
12 |
13 | migrationBuilder.DropIndex(
14 | name: "IX_Videos_PhraseHintsDataId",
15 | table: "Videos");
16 |
17 | migrationBuilder.AddColumn(
18 | name: "SceneObjectDataId",
19 | table: "Videos",
20 | nullable: true);
21 | }
22 |
23 | protected override void Down(MigrationBuilder migrationBuilder)
24 | {
25 | migrationBuilder.DropColumn(
26 | name: "SceneObjectDataId",
27 | table: "Videos");
28 |
29 | migrationBuilder.CreateIndex(
30 | name: "IX_Videos_PhraseHintsDataId",
31 | table: "Videos",
32 | column: "PhraseHintsDataId");
33 |
34 | migrationBuilder.AddForeignKey(
35 | name: "FK_Videos_TextData_PhraseHintsDataId",
36 | table: "Videos",
37 | column: "PhraseHintsDataId",
38 | principalTable: "TextData",
39 | principalColumn: "Id",
40 | onDelete: ReferentialAction.Restrict);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20221122030110_PlaylistAddDateTimes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore.Migrations;
3 |
4 | namespace ClassTranscribeDatabase.Migrations
5 | {
6 | public partial class PlaylistAddDateTimes : Migration
7 | {
8 | protected override void Up(MigrationBuilder migrationBuilder)
9 | {
10 | migrationBuilder.AddColumn(
11 | name: "ListCheckedAt",
12 | table: "Playlists",
13 | nullable: true);
14 |
15 | migrationBuilder.AddColumn(
16 | name: "ListUpdatedAt",
17 | table: "Playlists",
18 | nullable: true);
19 | }
20 |
21 | protected override void Down(MigrationBuilder migrationBuilder)
22 | {
23 | migrationBuilder.DropColumn(
24 | name: "ListCheckedAt",
25 | table: "Playlists");
26 |
27 | migrationBuilder.DropColumn(
28 | name: "ListUpdatedAt",
29 | table: "Playlists");
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20221129095657_GlossaryDataId.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class GlossaryDataId : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "GlossaryDataId",
11 | table: "Videos",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "GlossaryDataId",
19 | table: "Videos");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20221229041355_ASLVideoGlossaryMapPublished.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class ASLVideoGlossaryMapPublished : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Published",
11 | table: "ASLVideoGlossaryMaps",
12 | nullable: false,
13 | defaultValue: false);
14 | }
15 |
16 | protected override void Down(MigrationBuilder migrationBuilder)
17 | {
18 | migrationBuilder.DropColumn(
19 | name: "Published",
20 | table: "ASLVideoGlossaryMaps");
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20230105193204_GlossaryTimestamp.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class GlossaryTimestamp : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "GlossaryTimestampId",
11 | table: "Videos",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "GlossaryTimestampId",
19 | table: "Videos");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20230215055550_GlossaryOneParagraphExplanation.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class GlossaryOneParagraphExplanation : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Explanation",
11 | table: "Glossaries",
12 | nullable: true);
13 | }
14 |
15 | protected override void Down(MigrationBuilder migrationBuilder)
16 | {
17 | migrationBuilder.DropColumn(
18 | name: "Explanation",
19 | table: "Glossaries");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20231011192212_aslvideo3.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class aslvideo3 : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "ASLVideoId",
11 | table: "Videos",
12 | nullable: true);
13 |
14 | migrationBuilder.AddColumn(
15 | name: "ProcessedASLVideoId",
16 | table: "Videos",
17 | nullable: true);
18 |
19 | migrationBuilder.AddColumn(
20 | name: "ProcessingLog",
21 | table: "Videos",
22 | nullable: true);
23 |
24 | migrationBuilder.CreateIndex(
25 | name: "IX_Videos_ASLVideoId",
26 | table: "Videos",
27 | column: "ASLVideoId");
28 |
29 | migrationBuilder.CreateIndex(
30 | name: "IX_Videos_ProcessedASLVideoId",
31 | table: "Videos",
32 | column: "ProcessedASLVideoId");
33 |
34 | migrationBuilder.AddForeignKey(
35 | name: "FK_Videos_FileRecords_ASLVideoId",
36 | table: "Videos",
37 | column: "ASLVideoId",
38 | principalTable: "FileRecords",
39 | principalColumn: "Id",
40 | onDelete: ReferentialAction.Restrict);
41 |
42 | migrationBuilder.AddForeignKey(
43 | name: "FK_Videos_FileRecords_ProcessedASLVideoId",
44 | table: "Videos",
45 | column: "ProcessedASLVideoId",
46 | principalTable: "FileRecords",
47 | principalColumn: "Id",
48 | onDelete: ReferentialAction.Restrict);
49 | }
50 |
51 | protected override void Down(MigrationBuilder migrationBuilder)
52 | {
53 | migrationBuilder.DropForeignKey(
54 | name: "FK_Videos_FileRecords_ASLVideoId",
55 | table: "Videos");
56 |
57 | migrationBuilder.DropForeignKey(
58 | name: "FK_Videos_FileRecords_ProcessedASLVideoId",
59 | table: "Videos");
60 |
61 | migrationBuilder.DropIndex(
62 | name: "IX_Videos_ASLVideoId",
63 | table: "Videos");
64 |
65 | migrationBuilder.DropIndex(
66 | name: "IX_Videos_ProcessedASLVideoId",
67 | table: "Videos");
68 |
69 | migrationBuilder.DropColumn(
70 | name: "ASLVideoId",
71 | table: "Videos");
72 |
73 | migrationBuilder.DropColumn(
74 | name: "ProcessedASLVideoId",
75 | table: "Videos");
76 |
77 | migrationBuilder.DropColumn(
78 | name: "ProcessingLog",
79 | table: "Videos");
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20231012191610_TaskLogString.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class TaskLogString : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.DropColumn(
10 | name: "ProcessingLog",
11 | table: "Videos");
12 |
13 | migrationBuilder.AddColumn(
14 | name: "TaskLog",
15 | table: "Videos",
16 | nullable: true);
17 | }
18 |
19 | protected override void Down(MigrationBuilder migrationBuilder)
20 | {
21 | migrationBuilder.DropColumn(
22 | name: "TaskLog",
23 | table: "Videos");
24 |
25 | migrationBuilder.AddColumn(
26 | name: "ProcessingLog",
27 | table: "Videos",
28 | type: "text",
29 | nullable: true);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Migrations/20231211224116_PlaylistMediaOptions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | namespace ClassTranscribeDatabase.Migrations
4 | {
5 | public partial class PlaylistMediaOptions : Migration
6 | {
7 | protected override void Up(MigrationBuilder migrationBuilder)
8 | {
9 | migrationBuilder.AddColumn(
10 | name: "Options",
11 | table: "Playlists",
12 | nullable: true);
13 |
14 | migrationBuilder.AddColumn(
15 | name: "Options",
16 | table: "Medias",
17 | nullable: true);
18 | }
19 |
20 | protected override void Down(MigrationBuilder migrationBuilder)
21 | {
22 | migrationBuilder.DropColumn(
23 | name: "Options",
24 | table: "Playlists");
25 |
26 | migrationBuilder.DropColumn(
27 | name: "Options",
28 | table: "Medias");
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Services/Grpc.cs:
--------------------------------------------------------------------------------
1 | using CTGrpc;
2 | using Grpc.Core;
3 | using System;
4 |
5 | namespace ClassTranscribeDatabase.Services
6 | {
7 | public class RpcClient
8 | {
9 | AppSettings _appSettings;
10 | public PythonServer.PythonServerClient PythonServerClient;
11 | public RpcClient()
12 | {
13 | _appSettings = Globals.appSettings;
14 | AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
15 | var channel = new Channel(_appSettings.PYTHON_RPC_SERVER, ChannelCredentials.Insecure, new[]{
16 | new ChannelOption(ChannelOptions.MaxSendMessageLength , 2*1024*1024),
17 | new ChannelOption(ChannelOptions.MaxReceiveMessageLength , 5 *1024*1024)
18 | });
19 | PythonServerClient = new PythonServer.PythonServerClient(channel);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Services/MSTranscription/KeyProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace ClassTranscribeDatabase.Services.MSTranscription
6 | {
7 | ///
8 | /// Each object of this class represents an azure subscription key.
9 | ///
10 | public class Key
11 | {
12 | public string ApiKey { get; set; }
13 | public string Region { get; set; }
14 | ///
15 | /// This value indicates the number of tasks that are already using this key currently.
16 | ///
17 | public int Load { get; set; }
18 | }
19 |
20 | ///
21 | /// This class "provides" azure subscription keys for transcription tasks.
22 | /// It reads its key values from configuration variable "AZURE_SUBSCRIPTION_KEYS"
23 | ///
24 | public class KeyProvider
25 | {
26 | private readonly AppSettings _appSettings;
27 | private readonly List Keys;
28 | private readonly HashSet CurrentVideoIds;
29 |
30 | public KeyProvider(AppSettings appSettings)
31 | {
32 | _appSettings = appSettings;
33 | string subscriptionKeys = _appSettings.AZURE_SUBSCRIPTION_KEYS ?? "";
34 | Keys = new List();
35 | CurrentVideoIds = new HashSet();
36 |
37 | foreach (string subscriptionKey in subscriptionKeys.Split(';'))
38 | {
39 | if (!subscriptionKeys.Contains(","))
40 | {
41 | continue;
42 | }
43 | string[] keyregion = subscriptionKey.Split(',');
44 | if (keyregion.Length != 2)
45 | {
46 | throw new Exception("AZURE_SUBSCRIPTION_KEYS should be in the form key,region;key,region");
47 | }
48 | Keys.Add(new Key
49 | {
50 | ApiKey = keyregion[0].Trim(),
51 | Region = keyregion[1].Trim(),
52 | Load = 0
53 | });
54 | }
55 |
56 | }
57 |
58 | ///
59 | /// To obtain a new key for a task
60 | ///
61 | public Key GetKey(string videoId)
62 | {
63 | if (!CurrentVideoIds.Contains(videoId))
64 | {
65 | Key key = Keys.OrderBy(k => k.Load).First();
66 | key.Load += 1;
67 | CurrentVideoIds.Add(videoId);
68 | return key;
69 | }
70 | else
71 | {
72 | throw new Exception("Video already being transcribed");
73 | }
74 | }
75 |
76 | ///
77 | /// To release a key that was being used.
78 | ///
79 | public void ReleaseKey(Key key, string videoId)
80 | {
81 | Keys.Find(k => k.ApiKey == key.ApiKey).Load -= 1;
82 | CurrentVideoIds.Remove(videoId);
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/Services/Notification.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase.Models;
2 | using Microsoft.EntityFrameworkCore;
3 | using Microsoft.Extensions.Logging;
4 | using Newtonsoft.Json.Linq;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Threading.Tasks;
8 |
9 | namespace ClassTranscribeDatabase.Services
10 | {
11 | public class SubscriptionManager
12 | {
13 | private readonly CTDbContext _context;
14 |
15 | public SubscriptionManager(CTDbContext context)
16 | {
17 | _context = context;
18 | }
19 |
20 | public async Task Subscribe(Entity entity, ApplicationUser user)
21 | {
22 | Subscription subscription = new Subscription
23 | { ApplicationUserId = user.Id,
24 | ResourceType = entity.GetResourceType(),
25 | ResourceId = entity.Id
26 | };
27 | if(!(await _context.Subscriptions.AnyAsync(s => s.ResourceType == subscription.ResourceType &&
28 | s.ResourceId == subscription.ResourceId &&
29 | s.ApplicationUserId == subscription.ApplicationUserId)))
30 | {
31 | _context.Subscriptions.Add(subscription);
32 | }
33 | await _context.SaveChangesAsync();
34 | }
35 |
36 | public async Task Unsubscribe(Entity entity, ApplicationUser user)
37 | {
38 | Subscription subscription = new Subscription
39 | {
40 | ApplicationUserId = user.Id,
41 | ResourceType = entity.GetResourceType(),
42 | ResourceId = entity.Id
43 | };
44 | if (await _context.Subscriptions.AnyAsync(s => s.ResourceType == subscription.ResourceType &&
45 | s.ResourceId == subscription.ResourceId &&
46 | s.ApplicationUserId == subscription.ApplicationUserId))
47 | {
48 | _context.Subscriptions.Remove(subscription);
49 | }
50 | await _context.SaveChangesAsync();
51 | }
52 |
53 | public async Task AddMessageToSubscription(Entity entity, JObject payload, LogLevel logLevel)
54 | {
55 | var userIds = await _context.Subscriptions
56 | .Where(s => s.ResourceType == entity.GetResourceType() && s.Id == entity.Id)
57 | .Select(s => s.ApplicationUserId)
58 | .ToListAsync();
59 |
60 | var messages = userIds.Select(uId => new Message
61 | {
62 | LogLevel = logLevel,
63 | ApplicationUserId = uId,
64 | Payload = payload ?? new JObject()
65 | }).ToList();
66 |
67 | await _context.Messages.AddRangeAsync(messages);
68 | }
69 |
70 | public async Task> GetNotifications(ApplicationUser user)
71 | {
72 | return await _context.Messages
73 | .Where(m => m.Ack == Ack.Pending && m.ApplicationUserId == user.Id)
74 | .ToListAsync();
75 | }
76 |
77 | public async Task AcknowledgeMessage(string messageId)
78 | {
79 | Message m = await _context.Messages.Where(m => m.Id == messageId).FirstOrDefaultAsync();
80 | m.Ack = Ack.Seen;
81 | await _context.SaveChangesAsync();
82 | }
83 |
84 | public async Task AcknowledgeMessages(List messageIds)
85 | {
86 | List messages = await _context.Messages.Where(m => messageIds.Contains(m.Id)).ToListAsync();
87 | messages.ForEach(m =>
88 | {
89 | m.Ack = Ack.Seen;
90 | });
91 | await _context.SaveChangesAsync();
92 | }
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "8.0"
4 | }
5 | }
--------------------------------------------------------------------------------
/ClassTranscribeDatabase/migration_instruction.md:
--------------------------------------------------------------------------------
1 | ## How to create migrations in EF Core
2 | 1. Install dotnet with version 3.1.201. Please be advised that ClassTranscribe Database may not run properly on newer version. Install instruction can be found at https://github.com/dotnet/core/blob/main/release-notes/3.1/3.1.3/3.1.201-download.md
3 |
4 | 2. Install dotnet-ef 3.1.4 by running
5 | ```
6 | dotnet tool install --global dotnet-ef --version 3.1.4
7 | ```
8 |
9 | 3. Go to the ClassTranscribeDatabase directory
10 | ```
11 | cd WebAPI/ClassTranscribeDatabase
12 | ```
13 |
14 | 4. Create a new migration by running
15 | ```
16 | (also try dotnet ef may work for you)
17 | dotnet-ef migrations add
18 | ```
19 |
20 | ## How to apply migration in the local database
21 | ```
22 | dotnet-ef database update
23 | ```
24 |
25 | To remove,
26 | ```
27 | dotnet-ef migrations remove
28 | ```
29 |
30 | ## How to apply migration in Docker container
31 | 1. Rebuild the solution
32 | ```
33 | dotnet build --no-restore
34 | ```
35 |
36 | 2. Rebuild API image
37 | ```
38 | docker build -t api -f API.Dockerfile .
39 | ```
40 |
41 | 3. Run Docker compose to see the changes
42 | ```
43 | docker compose up api
44 | ```
--------------------------------------------------------------------------------
/ClassTranscribeServer/Connected Services/Application Insights/ConnectedService.json:
--------------------------------------------------------------------------------
1 | {
2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider",
3 | "Version": "16.0.0.0",
4 | "GettingStartedDocument": {
5 | "Uri": "https://go.microsoft.com/fwlink/?LinkID=798432"
6 | }
7 | }
--------------------------------------------------------------------------------
/ClassTranscribeServer/Controllers/BaseController.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase;
2 | using Microsoft.AspNetCore.Mvc;
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace ClassTranscribeServer.Controllers
6 | {
7 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1051:Do not declare visible instance fields")]
8 | public class BaseController : ControllerBase
9 | {
10 | protected readonly CTDbContext _context;
11 | protected readonly ILogger _logger;
12 |
13 | public BaseController(CTDbContext context, ILogger logger)
14 | {
15 | _context = context;
16 | _logger = logger;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/ClassTranscribeServer/Controllers/CaptionsSearchController.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase;
2 | using ClassTranscribeDatabase.Models;
3 | using Microsoft.AspNetCore.Mvc;
4 | using Microsoft.Extensions.Logging;
5 | using Nest;
6 | using Elasticsearch.Net;
7 | using System.Collections.Generic;
8 | using System.Threading.Tasks;
9 |
10 | namespace ClassTranscribeServer.Controllers
11 | {
12 | [Route("api/[controller]")]
13 | [ApiController]
14 | public class CaptionsSearchController : BaseController
15 | {
16 | private readonly IElasticClient _elasticClient;
17 |
18 | public CaptionsSearchController(CTDbContext context,
19 | IElasticClient client,
20 | ILogger logger) : base(context, logger)
21 | {
22 | _elasticClient = client;
23 | }
24 |
25 | [HttpPost]
26 | public async Task>> Search([FromBody] string[] ids, string query, int page = 1, int pageSize = 10)
27 | {
28 | // TODO: add authentication
29 | if (ids == null || ids.Length == 0)
30 | {
31 |
32 | return NotFound();
33 | }
34 | var result = await _elasticClient.SearchAsync(s => s
35 | .SearchType(SearchType.DfsQueryThenFetch)
36 | .Index(ids)
37 | .From((page - 1)*pageSize)
38 | .Size(pageSize)
39 | .Query(q => q
40 | .Bool(b => b
41 | .Must(m => m
42 | .Match(m1 => m1
43 | .Field(f => f.Text)
44 | .Query(query)
45 | .Fuzziness(Fuzziness.Auto)
46 | )
47 | )
48 | )
49 | )
50 | );
51 |
52 | if (result.Total == 0)
53 | {
54 | return NotFound();
55 | }
56 | return Ok(new SearchResult
57 | {
58 | Total = result.Total,
59 | Page = page,
60 | Results = result.Documents,
61 | ElapsedMilliseconds = result.Took
62 | });
63 | }
64 | }
65 |
66 | public class SearchResult
67 | {
68 | public long Total { get; set; }
69 |
70 | public int Page { get; set; }
71 |
72 | public IEnumerable Results { get; set; }
73 |
74 | public long ElapsedMilliseconds { get; set; }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/ClassTranscribeServer/Controllers/RolesController.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase;
2 | using ClassTranscribeDatabase.Models;
3 | using ClassTranscribeServer.Utils;
4 | using Microsoft.AspNetCore.Authorization;
5 | using Microsoft.AspNetCore.Identity;
6 | using Microsoft.AspNetCore.Mvc;
7 | using Microsoft.Extensions.Logging;
8 | using System.Collections.Generic;
9 | using System.Linq;
10 | using System.Threading.Tasks;
11 |
12 | namespace ClassTranscribeServer.Controllers
13 | {
14 | [Route("api/[controller]")]
15 | [ApiController]
16 | public class RolesController : BaseController
17 | {
18 | private readonly RoleManager _roleManager;
19 | private readonly UserManager _userManager;
20 | private readonly UserUtils _userutils;
21 |
22 | public RolesController(RoleManager roleManager, UserManager userManager,
23 | CTDbContext context, ILogger logger, UserUtils userUtils) : base(context, logger)
24 | {
25 | _roleManager = roleManager;
26 | _userManager = userManager;
27 | _userutils = userUtils;
28 | }
29 |
30 | // POST: api/Roles
31 | [HttpPost]
32 | [Authorize(Roles = Globals.ROLE_ADMIN)]
33 | public async Task AddUserToRole(string mailId, string role)
34 | {
35 | ApplicationUser user = await _userManager.FindByEmailAsync(mailId);
36 | if (user == null)
37 | {
38 | user = await _userutils.CreateNonExistentUser(mailId);
39 | }
40 | if (await _roleManager.RoleExistsAsync(role) && !(await _userManager.IsInRoleAsync(user, role)))
41 | {
42 | await _userManager.AddToRoleAsync(user, role);
43 | }
44 | return Ok();
45 | }
46 |
47 | // POST: api/Roles
48 | [HttpDelete]
49 | [Authorize(Roles = Globals.ROLE_ADMIN)]
50 | public async Task RemoveInstructor(string mailId)
51 | {
52 | ApplicationUser user = await _userManager.FindByEmailAsync(mailId);
53 | await _userManager.RemoveFromRoleAsync(user, Globals.ROLE_INSTRUCTOR);
54 | return Ok();
55 | }
56 |
57 | // POST: api/Roles
58 | [HttpGet]
59 | [Authorize(Roles = Globals.ROLE_ADMIN)]
60 | public List GetInstructors(string universityId)
61 | {
62 | var instructorRoleId = _context.Roles.Where(r => r.Name == Globals.ROLE_INSTRUCTOR).First().Id;
63 |
64 | var userIds = (from user in _context.Users
65 | join ur in _context.UserRoles on user.Id equals ur.UserId
66 | where user.UniversityId == universityId && ur.RoleId == instructorRoleId
67 | select new ApplicationUser { Id = user.Id, Email = user.Email, FirstName = user.FirstName, LastName = user.LastName }).ToList();
68 | return userIds;
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/ClassTranscribeServer/Controllers/TermsController.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase;
2 | using ClassTranscribeDatabase.Models;
3 | using Microsoft.AspNetCore.Authorization;
4 | using Microsoft.AspNetCore.Mvc;
5 | using Microsoft.EntityFrameworkCore;
6 | using Microsoft.Extensions.Logging;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Threading.Tasks;
10 |
11 | namespace ClassTranscribeServer.Controllers
12 | {
13 | [Route("api/[controller]")]
14 | [ApiController]
15 | public class TermsController : BaseController
16 | {
17 | public TermsController(CTDbContext context, ILogger logger) : base(context, logger) { }
18 |
19 | ///
20 | /// Gets all Terms for universityId
21 | ///
22 | [HttpGet("ByUniversity/{universityId}")]
23 | public async Task>> GetTerms(string universityId)
24 | {
25 | return await _context.Terms.Where(t => t.UniversityId == universityId).OrderBy(t => t.StartDate).ToListAsync();
26 | }
27 |
28 | // GET: api/Terms/5
29 | [HttpGet("{id}")]
30 | public async Task> GetTerm(string id)
31 | {
32 | var term = await _context.Terms.FindAsync(id);
33 |
34 | if (term == null)
35 | {
36 | return NotFound();
37 | }
38 |
39 | return term;
40 | }
41 |
42 | // PUT: api/Terms/5
43 | [HttpPut("{id}")]
44 | [Authorize(Roles = Globals.ROLE_ADMIN)]
45 | public async Task PutTerm(string id, Term term)
46 | {
47 | if (term == null || id == null || id != term.Id)
48 | {
49 | return BadRequest();
50 | }
51 |
52 | _context.Entry(term).State = EntityState.Modified;
53 |
54 | try
55 | {
56 | await _context.SaveChangesAsync();
57 | }
58 | catch (DbUpdateConcurrencyException)
59 | {
60 | if (!TermExists(id))
61 | {
62 | return NotFound();
63 | }
64 | else
65 | {
66 | throw;
67 | }
68 | }
69 |
70 | return NoContent();
71 | }
72 |
73 | // POST: api/Terms
74 | [HttpPost]
75 | [Authorize(Roles = Globals.ROLE_ADMIN)]
76 | public async Task> PostTerm(Term term)
77 | {
78 | if (term == null)
79 | {
80 | return BadRequest();
81 | }
82 |
83 | _context.Terms.Add(term);
84 | await _context.SaveChangesAsync();
85 |
86 | return CreatedAtAction("GetTerm", new { id = term.Id }, term);
87 | }
88 |
89 | // DELETE: api/Terms/5
90 | [HttpDelete("{id}")]
91 | [Authorize(Roles = Globals.ROLE_ADMIN)]
92 | public async Task> DeleteTerm(string id)
93 | {
94 | var term = await _context.Terms.FindAsync(id);
95 | if (term == null)
96 | {
97 | return NotFound();
98 | }
99 |
100 | _context.Terms.Remove(term);
101 | await _context.SaveChangesAsync();
102 |
103 | return term;
104 | }
105 |
106 | private bool TermExists(string id)
107 | {
108 | return _context.Terms.Any(e => e.Id == id);
109 | }
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/ClassTranscribeServer/Program.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase;
2 | using Microsoft.AspNetCore;
3 | using Microsoft.AspNetCore.Hosting;
4 | using Microsoft.Extensions.DependencyInjection;
5 | using Microsoft.Extensions.Logging;
6 | using System;
7 |
8 | namespace ClassTranscribeServer
9 | {
10 | public static class Program
11 | {
12 | public static void Main(string[] args)
13 | {
14 | CreateWebHostBuilder(args).Build().Run();
15 | }
16 |
17 | public static IWebHostBuilder CreateWebHostBuilder(string[] args)
18 | {
19 | var v = WebHost.CreateDefaultBuilder(args)
20 | .ConfigureServices(c => c.AddOptions().Configure(CTDbContext.GetConfigurations()));
21 |
22 | // TTODO better code would use AppSettings
23 |
24 | string viewSQL = Environment.GetEnvironmentVariable("LogEntityFrameworkSQL") ?? "false";
25 |
26 | if( viewSQL.Trim().ToUpperInvariant() != "TRUE") {
27 |
28 | v.ConfigureLogging((context, logging) => {
29 | logging.AddFilter("Microsoft.EntityFrameworkCore.Database.Command", LogLevel.Warning);
30 | });
31 | }
32 | return v.UseStartup();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ClassTranscribeServer/Utils/SwaggerSchemaFilter.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase.Models;
2 | using Microsoft.OpenApi.Models;
3 | using Newtonsoft.Json;
4 | using Swashbuckle.AspNetCore.SwaggerGen;
5 | using System.Linq;
6 | using System.Reflection;
7 |
8 | namespace ClassTranscribeServer.Utils
9 | {
10 |
11 |
12 | internal static class StringExtensions
13 | {
14 | internal static string ToCamelCase(this string value)
15 | {
16 | if (string.IsNullOrEmpty(value)) return value;
17 | return char.ToLowerInvariant(value[0]) + value.Substring(1);
18 | }
19 | }
20 |
21 | public class SwaggerSchemaFilter : ISchemaFilter
22 | {
23 | public void Apply(OpenApiSchema schema, SchemaFilterContext context)
24 | {
25 |
26 | if (schema == null || context == null || schema.Properties.Count == 0)
27 | {
28 | return;
29 | }
30 |
31 | const BindingFlags bindingFlags = BindingFlags.Public |
32 | BindingFlags.NonPublic |
33 | BindingFlags.Instance;
34 |
35 | var memberList = context.Type
36 | .GetFields(bindingFlags).Cast()
37 | .Concat(context.Type
38 | .GetProperties(bindingFlags));
39 |
40 | var excludedList = memberList.Where(m =>
41 | m.GetCustomAttribute()
42 | != null)
43 | .Select(m =>
44 | (m.GetCustomAttribute()
45 | ?.PropertyName
46 | ?? m.Name.ToCamelCase()));
47 |
48 | foreach (var excludedName in excludedList)
49 | {
50 | if (schema.Properties.ContainsKey(excludedName))
51 | {
52 | System.Diagnostics.Debug.WriteLine("????");
53 | System.Diagnostics.Debug.WriteLine(excludedName);
54 | schema.Properties.Remove(excludedName);
55 | }
56 |
57 | }
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/ClassTranscribeServer/Utils/UIUCSeed.cs:
--------------------------------------------------------------------------------
1 | using ClassTranscribeDatabase;
2 | using ClassTranscribeDatabase.Models;
3 | using CsvHelper;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 |
8 | namespace TaskEngine.Utils
9 | {
10 | public static class UIUCSeed
11 | {
12 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")]
13 | public class CSVCourse
14 | {
15 | public string TERM_DESC { get; set; }
16 | public string CRN { get; set; }
17 |
18 | public string SUBJ { get; set; }
19 | public string NBR { get; set; }
20 |
21 | public string SEC { get; set; }
22 | public string CRS_TITLE { get; set; }
23 | public string SCHED_TYPE { get; set; }
24 | }
25 |
26 | public static void SeedCourses()
27 | {
28 | // Dry run code before using it on Production.
29 | string file = Path.Combine(Globals.appSettings.DATA_DIRECTORY, "seed", "Fall2019InstructorList.csv");
30 | TextReader reader = new StreamReader(file);
31 | var csvReader = new CsvReader(reader, System.Globalization.CultureInfo.CurrentCulture);
32 | var records = csvReader.GetRecords