basics
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Database.Model.Configuration.Media;
|
||||
|
||||
public class MediaPhotoImageBackgroundConfiguration : IEntityTypeConfiguration<MediaPhotoImageBackground>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<MediaPhotoImageBackground> builder)
|
||||
{
|
||||
builder.HasKey(x => x.Id);
|
||||
builder.HasIndex(x => x.Id)
|
||||
.IsUnique();
|
||||
builder.Property(x => x.Id)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(x => x.IsUniversalBackground)
|
||||
.IsRequired()
|
||||
.HasDefaultValue(false);
|
||||
|
||||
builder.Property(x => x.FirstGradientColor)
|
||||
.IsRequired()
|
||||
.HasMaxLength(3);
|
||||
|
||||
builder.Property(x => x.SecondGradientColor)
|
||||
.IsRequired()
|
||||
.HasMaxLength(3);
|
||||
}
|
||||
}
|
||||
@@ -33,12 +33,8 @@ public class MediaPhotoImageConfiguration : IEntityTypeConfiguration<MediaPhotoI
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("now()");
|
||||
|
||||
builder.Property(x => x.IsMediaBackground)
|
||||
.IsRequired()
|
||||
.HasDefaultValue(false);
|
||||
|
||||
builder.Property(x => x.IsUniversalBackground)
|
||||
.IsRequired()
|
||||
.HasDefaultValue(false);
|
||||
builder.HasOne(x => x.MediaPhotoImageBackground)
|
||||
.WithOne(x => x.MediaPhotoImage)
|
||||
.HasForeignKey<MediaPhotoImageBackground>();
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,8 +9,6 @@ public class MediaPhotoImage
|
||||
public required byte[] Image { get; set; }
|
||||
public required string MimeType { get; set; }
|
||||
public DateTime UploadDate { get; set; }
|
||||
public bool IsMediaBackground { get; set; }
|
||||
public bool IsUniversalBackground { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -19,6 +17,7 @@ public class MediaPhotoImage
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual Media Media { get; set; } = null!;
|
||||
public virtual MediaPhotoImageBackground? MediaPhotoImageBackground { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace WatchIt.Database.Model.Media;
|
||||
|
||||
public class MediaPhotoImageBackground
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public required Guid Id { get; set; }
|
||||
public required bool IsUniversalBackground { get; set; }
|
||||
public required byte[] FirstGradientColor { get; set; }
|
||||
public required byte[] SecondGradientColor { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region NAVIGATION
|
||||
|
||||
public virtual MediaPhotoImage MediaPhotoImage { get; set; } = null!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -51,6 +51,7 @@ public class DatabaseContext : DbContext
|
||||
public virtual DbSet<MediaSeriesEpisode> MediaSeriesEpisodes { get; set; }
|
||||
public virtual DbSet<MediaPosterImage> MediaPosterImages { get; set; }
|
||||
public virtual DbSet<MediaPhotoImage> MediaPhotoImages { get; set; }
|
||||
public virtual DbSet<MediaPhotoImageBackground> MediaPhotoImageBackgrounds { get; set; }
|
||||
public virtual DbSet<MediaGenre> MediaGenres { get; set; }
|
||||
public virtual DbSet<MediaProductionCountry> MediaProductionCountries { get; set; }
|
||||
|
||||
|
||||
1397
WatchIt.Database/WatchIt.Database/Migrations/20240603125708_Initial.Designer.cs
generated
Normal file
1397
WatchIt.Database/WatchIt.Database/Migrations/20240603125708_Initial.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
namespace WatchIt.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class _0001_Initial : Migration
|
||||
public partial class Initial : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
@@ -62,13 +62,27 @@ namespace WatchIt.Database.Migrations
|
||||
Id = table.Column<short>(type: "smallint", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: true)
|
||||
Description = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Genres", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MediaPhotoImageBackgrounds",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
IsUniversalBackground = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
||||
FirstGradientColor = table.Column<byte[]>(type: "bytea", maxLength: 3, nullable: false),
|
||||
SecondGradientColor = table.Column<byte[]>(type: "bytea", maxLength: 3, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MediaPhotoImageBackgrounds", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MediaPosterImages",
|
||||
columns: table => new
|
||||
@@ -226,12 +240,22 @@ namespace WatchIt.Database.Migrations
|
||||
Image = table.Column<byte[]>(type: "bytea", maxLength: -1, nullable: false),
|
||||
MimeType = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
|
||||
UploadDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"),
|
||||
IsMediaBackground = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
||||
IsUniversalBackground = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
|
||||
MediaPhotoImageBackgroundId = table.Column<Guid>(type: "uuid", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MediaPhotoImages", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MediaPhotoImages_MediaPhotoImageBackgrounds_Id",
|
||||
column: x => x.Id,
|
||||
principalTable: "MediaPhotoImageBackgrounds",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_MediaPhotoImages_MediaPhotoImageBackgrounds_MediaPhotoImage~",
|
||||
column: x => x.MediaPhotoImageBackgroundId,
|
||||
principalTable: "MediaPhotoImageBackgrounds",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_MediaPhotoImages_Media_MediaId",
|
||||
column: x => x.MediaId,
|
||||
@@ -241,7 +265,7 @@ namespace WatchIt.Database.Migrations
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MediaProductionCountrys",
|
||||
name: "MediaProductionCountries",
|
||||
columns: table => new
|
||||
{
|
||||
MediaId = table.Column<long>(type: "bigint", nullable: false),
|
||||
@@ -249,15 +273,15 @@ namespace WatchIt.Database.Migrations
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MediaProductionCountrys", x => new { x.CountryId, x.MediaId });
|
||||
table.PrimaryKey("PK_MediaProductionCountries", x => new { x.CountryId, x.MediaId });
|
||||
table.ForeignKey(
|
||||
name: "FK_MediaProductionCountrys_Countries_CountryId",
|
||||
name: "FK_MediaProductionCountries_Countries_CountryId",
|
||||
column: x => x.CountryId,
|
||||
principalTable: "Countries",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_MediaProductionCountrys_Media_MediaId",
|
||||
name: "FK_MediaProductionCountries_Media_MediaId",
|
||||
column: x => x.MediaId,
|
||||
principalTable: "Media",
|
||||
principalColumn: "Id",
|
||||
@@ -620,7 +644,7 @@ namespace WatchIt.Database.Migrations
|
||||
migrationBuilder.InsertData(
|
||||
table: "Accounts",
|
||||
columns: new[] { "Id", "BackgroundPictureId", "Description", "Email", "GenderId", "IsAdmin", "LeftSalt", "Password", "ProfilePictureId", "RightSalt", "Username" },
|
||||
values: new object[] { 1L, null, null, "root@watch.it", null, true, "qE]Q^g%tU\"6Uu^GfE:V:", new byte[] { 165, 250, 135, 31, 187, 161, 15, 246, 18, 232, 64, 25, 37, 173, 91, 111, 140, 177, 183, 84, 254, 177, 15, 235, 119, 219, 29, 169, 32, 108, 187, 121, 204, 51, 213, 28, 141, 89, 91, 226, 0, 23, 7, 91, 139, 230, 151, 104, 62, 91, 59, 6, 207, 26, 200, 141, 104, 5, 151, 201, 243, 163, 28, 248 }, null, "T7j)~.#%~ZtOFUZFK,K+", "root" });
|
||||
values: new object[] { 1L, null, null, "root@watch.it", null, true, "Y&%]J>6Nc3&5~UUXnNxq", new byte[] { 68, 170, 8, 113, 134, 47, 98, 43, 96, 183, 126, 130, 204, 45, 4, 113, 81, 200, 244, 26, 54, 88, 161, 246, 84, 93, 159, 219, 12, 143, 128, 160, 198, 194, 47, 133, 216, 242, 158, 184, 43, 38, 134, 132, 175, 179, 42, 40, 0, 143, 111, 252, 156, 215, 17, 185, 12, 109, 119, 214, 211, 167, 32, 121 }, null, "MV1jo~o3Oa^;NWb\\Q)t_", "root" });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Countries",
|
||||
@@ -752,6 +776,12 @@ namespace WatchIt.Database.Migrations
|
||||
column: "Id",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MediaPhotoImageBackgrounds_Id",
|
||||
table: "MediaPhotoImageBackgrounds",
|
||||
column: "Id",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MediaPhotoImages_Id",
|
||||
table: "MediaPhotoImages",
|
||||
@@ -763,6 +793,11 @@ namespace WatchIt.Database.Migrations
|
||||
table: "MediaPhotoImages",
|
||||
column: "MediaId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MediaPhotoImages_MediaPhotoImageBackgroundId",
|
||||
table: "MediaPhotoImages",
|
||||
column: "MediaPhotoImageBackgroundId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MediaPosterImages_Id",
|
||||
table: "MediaPosterImages",
|
||||
@@ -770,8 +805,8 @@ namespace WatchIt.Database.Migrations
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MediaProductionCountrys_MediaId",
|
||||
table: "MediaProductionCountrys",
|
||||
name: "IX_MediaProductionCountries_MediaId",
|
||||
table: "MediaProductionCountries",
|
||||
column: "MediaId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
@@ -995,7 +1030,7 @@ namespace WatchIt.Database.Migrations
|
||||
name: "MediaMovies");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MediaProductionCountrys");
|
||||
name: "MediaProductionCountries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RatingsMedia");
|
||||
@@ -1057,6 +1092,9 @@ namespace WatchIt.Database.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "MediaSeries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MediaPhotoImageBackgrounds");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Genders");
|
||||
|
||||
@@ -12,15 +12,15 @@ using WatchIt.Database;
|
||||
namespace WatchIt.Database.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20240418190404_0001_Initial")]
|
||||
partial class _0001_Initial
|
||||
[Migration("20240603131015_Fix")]
|
||||
partial class Fix
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.4")
|
||||
.HasAnnotation("ProductVersion", "8.0.5")
|
||||
.HasAnnotation("Proxies:ChangeTracking", false)
|
||||
.HasAnnotation("Proxies:CheckEquality", false)
|
||||
.HasAnnotation("Proxies:LazyLoading", true)
|
||||
@@ -111,9 +111,9 @@ namespace WatchIt.Database.Migrations
|
||||
Email = "root@watch.it",
|
||||
IsAdmin = true,
|
||||
LastActive = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
LeftSalt = "qE]Q^g%tU\"6Uu^GfE:V:",
|
||||
Password = new byte[] { 165, 250, 135, 31, 187, 161, 15, 246, 18, 232, 64, 25, 37, 173, 91, 111, 140, 177, 183, 84, 254, 177, 15, 235, 119, 219, 29, 169, 32, 108, 187, 121, 204, 51, 213, 28, 141, 89, 91, 226, 0, 23, 7, 91, 139, 230, 151, 104, 62, 91, 59, 6, 207, 26, 200, 141, 104, 5, 151, 201, 243, 163, 28, 248 },
|
||||
RightSalt = "T7j)~.#%~ZtOFUZFK,K+",
|
||||
LeftSalt = "@(0PF{b6Ot?HO*:yF5`L",
|
||||
Password = new byte[] { 254, 122, 19, 59, 187, 100, 174, 87, 55, 108, 14, 10, 123, 186, 129, 243, 145, 136, 152, 220, 72, 170, 196, 93, 54, 88, 192, 115, 128, 76, 133, 9, 181, 99, 181, 8, 102, 123, 197, 251, 85, 167, 146, 28, 116, 249, 118, 87, 146, 8, 194, 238, 127, 19, 33, 28, 14, 222, 218, 170, 74, 40, 223, 232 },
|
||||
RightSalt = "=pt,3T0#CfC1[}Zfp{/u",
|
||||
Username = "root"
|
||||
});
|
||||
});
|
||||
@@ -253,7 +253,8 @@ namespace WatchIt.Database.Migrations
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<short>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("character varying(1000)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
@@ -378,16 +379,6 @@ namespace WatchIt.Database.Migrations
|
||||
.HasMaxLength(-1)
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<bool>("IsMediaBackground")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<bool>("IsUniversalBackground")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -411,6 +402,34 @@ namespace WatchIt.Database.Migrations
|
||||
b.ToTable("MediaPhotoImages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<byte[]>("FirstGradientColor")
|
||||
.IsRequired()
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<bool>("IsUniversalBackground")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<byte[]>("SecondGradientColor")
|
||||
.IsRequired()
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Id")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("MediaPhotoImageBackgrounds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -452,7 +471,7 @@ namespace WatchIt.Database.Migrations
|
||||
|
||||
b.HasIndex("MediaId");
|
||||
|
||||
b.ToTable("MediaProductionCountrys");
|
||||
b.ToTable("MediaProductionCountries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b =>
|
||||
@@ -1016,6 +1035,17 @@ namespace WatchIt.Database.Migrations
|
||||
b.Navigation("Media");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b =>
|
||||
{
|
||||
b.HasOne("WatchIt.Database.Model.Media.MediaPhotoImage", "MediaPhotoImage")
|
||||
.WithOne("MediaPhotoImageBackground")
|
||||
.HasForeignKey("WatchIt.Database.Model.Media.MediaPhotoImageBackground", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MediaPhotoImage");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaProductionCountry", b =>
|
||||
{
|
||||
b.HasOne("WatchIt.Database.Model.Common.Country", "Country")
|
||||
@@ -1302,6 +1332,11 @@ namespace WatchIt.Database.Migrations
|
||||
b.Navigation("ViewCountsMedia");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b =>
|
||||
{
|
||||
b.Navigation("MediaPhotoImageBackground");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b =>
|
||||
{
|
||||
b.Navigation("Media")
|
||||
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WatchIt.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Fix : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_MediaPhotoImages_MediaPhotoImageBackgrounds_Id",
|
||||
table: "MediaPhotoImages");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_MediaPhotoImages_MediaPhotoImageBackgrounds_MediaPhotoImage~",
|
||||
table: "MediaPhotoImages");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_MediaPhotoImages_MediaPhotoImageBackgroundId",
|
||||
table: "MediaPhotoImages");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MediaPhotoImageBackgroundId",
|
||||
table: "MediaPhotoImages");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Accounts",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1L,
|
||||
columns: new[] { "LeftSalt", "Password", "RightSalt" },
|
||||
values: new object[] { "@(0PF{b6Ot?HO*:yF5`L", new byte[] { 254, 122, 19, 59, 187, 100, 174, 87, 55, 108, 14, 10, 123, 186, 129, 243, 145, 136, 152, 220, 72, 170, 196, 93, 54, 88, 192, 115, 128, 76, 133, 9, 181, 99, 181, 8, 102, 123, 197, 251, 85, 167, 146, 28, 116, 249, 118, 87, 146, 8, 194, 238, 127, 19, 33, 28, 14, 222, 218, 170, 74, 40, 223, 232 }, "=pt,3T0#CfC1[}Zfp{/u" });
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_MediaPhotoImageBackgrounds_MediaPhotoImages_Id",
|
||||
table: "MediaPhotoImageBackgrounds",
|
||||
column: "Id",
|
||||
principalTable: "MediaPhotoImages",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_MediaPhotoImageBackgrounds_MediaPhotoImages_Id",
|
||||
table: "MediaPhotoImageBackgrounds");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "MediaPhotoImageBackgroundId",
|
||||
table: "MediaPhotoImages",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Accounts",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1L,
|
||||
columns: new[] { "LeftSalt", "Password", "RightSalt" },
|
||||
values: new object[] { "Y&%]J>6Nc3&5~UUXnNxq", new byte[] { 68, 170, 8, 113, 134, 47, 98, 43, 96, 183, 126, 130, 204, 45, 4, 113, 81, 200, 244, 26, 54, 88, 161, 246, 84, 93, 159, 219, 12, 143, 128, 160, 198, 194, 47, 133, 216, 242, 158, 184, 43, 38, 134, 132, 175, 179, 42, 40, 0, 143, 111, 252, 156, 215, 17, 185, 12, 109, 119, 214, 211, 167, 32, 121 }, "MV1jo~o3Oa^;NWb\\Q)t_" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MediaPhotoImages_MediaPhotoImageBackgroundId",
|
||||
table: "MediaPhotoImages",
|
||||
column: "MediaPhotoImageBackgroundId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_MediaPhotoImages_MediaPhotoImageBackgrounds_Id",
|
||||
table: "MediaPhotoImages",
|
||||
column: "Id",
|
||||
principalTable: "MediaPhotoImageBackgrounds",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_MediaPhotoImages_MediaPhotoImageBackgrounds_MediaPhotoImage~",
|
||||
table: "MediaPhotoImages",
|
||||
column: "MediaPhotoImageBackgroundId",
|
||||
principalTable: "MediaPhotoImageBackgrounds",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace WatchIt.Database.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.4")
|
||||
.HasAnnotation("ProductVersion", "8.0.5")
|
||||
.HasAnnotation("Proxies:ChangeTracking", false)
|
||||
.HasAnnotation("Proxies:CheckEquality", false)
|
||||
.HasAnnotation("Proxies:LazyLoading", true)
|
||||
@@ -108,9 +108,9 @@ namespace WatchIt.Database.Migrations
|
||||
Email = "root@watch.it",
|
||||
IsAdmin = true,
|
||||
LastActive = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
LeftSalt = "qE]Q^g%tU\"6Uu^GfE:V:",
|
||||
Password = new byte[] { 165, 250, 135, 31, 187, 161, 15, 246, 18, 232, 64, 25, 37, 173, 91, 111, 140, 177, 183, 84, 254, 177, 15, 235, 119, 219, 29, 169, 32, 108, 187, 121, 204, 51, 213, 28, 141, 89, 91, 226, 0, 23, 7, 91, 139, 230, 151, 104, 62, 91, 59, 6, 207, 26, 200, 141, 104, 5, 151, 201, 243, 163, 28, 248 },
|
||||
RightSalt = "T7j)~.#%~ZtOFUZFK,K+",
|
||||
LeftSalt = "@(0PF{b6Ot?HO*:yF5`L",
|
||||
Password = new byte[] { 254, 122, 19, 59, 187, 100, 174, 87, 55, 108, 14, 10, 123, 186, 129, 243, 145, 136, 152, 220, 72, 170, 196, 93, 54, 88, 192, 115, 128, 76, 133, 9, 181, 99, 181, 8, 102, 123, 197, 251, 85, 167, 146, 28, 116, 249, 118, 87, 146, 8, 194, 238, 127, 19, 33, 28, 14, 222, 218, 170, 74, 40, 223, 232 },
|
||||
RightSalt = "=pt,3T0#CfC1[}Zfp{/u",
|
||||
Username = "root"
|
||||
});
|
||||
});
|
||||
@@ -250,7 +250,8 @@ namespace WatchIt.Database.Migrations
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<short>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text");
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("character varying(1000)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
@@ -375,16 +376,6 @@ namespace WatchIt.Database.Migrations
|
||||
.HasMaxLength(-1)
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<bool>("IsMediaBackground")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<bool>("IsUniversalBackground")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -408,6 +399,34 @@ namespace WatchIt.Database.Migrations
|
||||
b.ToTable("MediaPhotoImages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<byte[]>("FirstGradientColor")
|
||||
.IsRequired()
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<bool>("IsUniversalBackground")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(false);
|
||||
|
||||
b.Property<byte[]>("SecondGradientColor")
|
||||
.IsRequired()
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Id")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("MediaPhotoImageBackgrounds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -449,7 +468,7 @@ namespace WatchIt.Database.Migrations
|
||||
|
||||
b.HasIndex("MediaId");
|
||||
|
||||
b.ToTable("MediaProductionCountrys");
|
||||
b.ToTable("MediaProductionCountries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b =>
|
||||
@@ -1013,6 +1032,17 @@ namespace WatchIt.Database.Migrations
|
||||
b.Navigation("Media");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b =>
|
||||
{
|
||||
b.HasOne("WatchIt.Database.Model.Media.MediaPhotoImage", "MediaPhotoImage")
|
||||
.WithOne("MediaPhotoImageBackground")
|
||||
.HasForeignKey("WatchIt.Database.Model.Media.MediaPhotoImageBackground", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MediaPhotoImage");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaProductionCountry", b =>
|
||||
{
|
||||
b.HasOne("WatchIt.Database.Model.Common.Country", "Country")
|
||||
@@ -1299,6 +1329,11 @@ namespace WatchIt.Database.Migrations
|
||||
b.Navigation("ViewCountsMedia");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b =>
|
||||
{
|
||||
b.Navigation("MediaPhotoImageBackground");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b =>
|
||||
{
|
||||
b.Navigation("Media")
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
|
||||
<PackageReference Include="SimpleToolkit.Extensions" Version="1.7.5" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user