#1 adding audio files corresponding migrations

This commit is contained in:
Hamid Reza Mohammadi 2020-08-30 10:22:24 +04:30
parent 6ff3e55068
commit c000cb3fec
5 changed files with 1420 additions and 0 deletions

View File

@ -2,6 +2,7 @@
using Microsoft.Extensions.Configuration;
using RMuseum.Models.Artifact;
using RMuseum.Models.Bookmark;
using RMuseum.Models.GanjoorAudio;
using RMuseum.Models.GanjoorIntegration;
using RMuseum.Models.ImportJob;
using RMuseum.Models.Note;
@ -126,5 +127,10 @@ namespace RMuseum.DbContext
/// </summary>
public DbSet<PinterestLink> PinterestLinks { get; set; }
/// <summary>
/// Ganjoor Audio Files
/// </summary>
public DbSet<PoemNarration> AudioFiles { get; set; }
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace RMuseum.Migrations
{
public partial class AudioFiles : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AudioFiles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
OwnerId = table.Column<Guid>(nullable: false),
GanjoorAudioId = table.Column<int>(nullable: false),
GanjoorPostId = table.Column<int>(nullable: false),
AudioOrder = table.Column<int>(nullable: false),
FileNameWithoutExtension = table.Column<string>(nullable: true),
SoundFilesFolder = table.Column<string>(nullable: true),
AudioTitle = table.Column<string>(nullable: true),
AudioArtist = table.Column<string>(nullable: true),
AudioArtistUrl = table.Column<string>(nullable: true),
AudioSrc = table.Column<string>(nullable: true),
AudioSrcUrl = table.Column<string>(nullable: true),
LegacyAudioGuid = table.Column<Guid>(nullable: false),
Mp3FileCheckSum = table.Column<string>(nullable: true),
Mp3SizeInBytes = table.Column<int>(nullable: false),
OggSizeInBytes = table.Column<int>(nullable: false),
UploadDate = table.Column<DateTime>(nullable: false),
ReviewDate = table.Column<DateTime>(nullable: false),
LocalMp3FilePath = table.Column<string>(nullable: true),
LocalXmlFilePath = table.Column<string>(nullable: true),
AudioSyncStatus = table.Column<int>(nullable: false),
ReviewStatus = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AudioFiles", x => x.Id);
table.ForeignKey(
name: "FK_AudioFiles_AspNetUsers_OwnerId",
column: x => x.OwnerId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AudioFiles_OwnerId",
table: "AudioFiles",
column: "OwnerId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AudioFiles");
}
}
}

View File

@ -336,6 +336,82 @@ namespace RMuseum.Migrations
b.ToTable("UserBookmarks");
});
modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("AudioArtist")
.HasColumnType("nvarchar(max)");
b.Property<string>("AudioArtistUrl")
.HasColumnType("nvarchar(max)");
b.Property<int>("AudioOrder")
.HasColumnType("int");
b.Property<string>("AudioSrc")
.HasColumnType("nvarchar(max)");
b.Property<string>("AudioSrcUrl")
.HasColumnType("nvarchar(max)");
b.Property<int>("AudioSyncStatus")
.HasColumnType("int");
b.Property<string>("AudioTitle")
.HasColumnType("nvarchar(max)");
b.Property<string>("FileNameWithoutExtension")
.HasColumnType("nvarchar(max)");
b.Property<int>("GanjoorAudioId")
.HasColumnType("int");
b.Property<int>("GanjoorPostId")
.HasColumnType("int");
b.Property<Guid>("LegacyAudioGuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("LocalMp3FilePath")
.HasColumnType("nvarchar(max)");
b.Property<string>("LocalXmlFilePath")
.HasColumnType("nvarchar(max)");
b.Property<string>("Mp3FileCheckSum")
.HasColumnType("nvarchar(max)");
b.Property<int>("Mp3SizeInBytes")
.HasColumnType("int");
b.Property<int>("OggSizeInBytes")
.HasColumnType("int");
b.Property<Guid>("OwnerId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("ReviewDate")
.HasColumnType("datetime2");
b.Property<int>("ReviewStatus")
.HasColumnType("int");
b.Property<string>("SoundFilesFolder")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("UploadDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.ToTable("AudioFiles");
});
modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b =>
{
b.Property<Guid>("Id")
@ -1054,6 +1130,15 @@ namespace RMuseum.Migrations
.HasForeignKey("RArtifactMasterRecordId");
});
modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b =>
{
b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Owner")
.WithMany()
.HasForeignKey("OwnerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b =>
{
b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact")

View File

@ -776,6 +776,11 @@
Pinterest Links
</summary>
</member>
<member name="P:RMuseum.DbContext.RMuseumDbContext.AudioFiles">
<summary>
Ganjoor Audio Files
</summary>
</member>
<member name="T:RMuseum.Models.Artifact.PublishStatus">
<summary>
Items or pictures status