Add project files.

This commit is contained in:
2017-09-01 04:55:02 -04:00
parent 70d055282c
commit ae782025f6
22 changed files with 1244 additions and 0 deletions

View File

@ -0,0 +1,86 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
using YTManager;
namespace YTManager.Migrations
{
[DbContext(typeof(MediaDB))]
[Migration("20170901083156_initial")]
partial class initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452");
modelBuilder.Entity("YTManager.Models.Channel", b =>
{
b.Property<long>("ChannelId")
.ValueGeneratedOnAdd();
b.Property<string>("Description")
.IsRequired();
b.Property<string>("ThumbnailURL")
.IsRequired();
b.Property<string>("Title")
.IsRequired();
b.Property<string>("YTChannelID")
.IsRequired();
b.HasKey("ChannelId");
b.ToTable("Channels");
});
modelBuilder.Entity("YTManager.Models.Video", b =>
{
b.Property<long>("VideoId")
.ValueGeneratedOnAdd();
b.Property<DateTime>("AddedtoDB");
b.Property<long>("ChannelId");
b.Property<string>("Description")
.IsRequired();
b.Property<string>("ThumbnailURL")
.IsRequired();
b.Property<string>("Title")
.IsRequired();
b.Property<DateTime>("Uploaded");
b.Property<string>("YTVideoID")
.IsRequired();
b.HasKey("VideoId");
b.HasIndex("ChannelId");
b.ToTable("Videos");
});
modelBuilder.Entity("YTManager.Models.Video", b =>
{
b.HasOne("YTManager.Models.Channel", "Channel")
.WithMany("Videos")
.HasForeignKey("ChannelId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,68 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace YTManager.Migrations
{
public partial class initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Channels",
columns: table => new
{
ChannelId = table.Column<long>(type: "int8", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
Description = table.Column<string>(type: "text", nullable: false),
ThumbnailURL = table.Column<string>(type: "text", nullable: false),
Title = table.Column<string>(type: "text", nullable: false),
YTChannelID = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Channels", x => x.ChannelId);
});
migrationBuilder.CreateTable(
name: "Videos",
columns: table => new
{
VideoId = table.Column<long>(type: "int8", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
AddedtoDB = table.Column<DateTime>(type: "timestamp", nullable: false),
ChannelId = table.Column<long>(type: "int8", nullable: false),
Description = table.Column<string>(type: "text", nullable: false),
ThumbnailURL = table.Column<string>(type: "text", nullable: false),
Title = table.Column<string>(type: "text", nullable: false),
Uploaded = table.Column<DateTime>(type: "timestamp", nullable: false),
YTVideoID = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Videos", x => x.VideoId);
table.ForeignKey(
name: "FK_Videos_Channels_ChannelId",
column: x => x.ChannelId,
principalTable: "Channels",
principalColumn: "ChannelId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Videos_ChannelId",
table: "Videos",
column: "ChannelId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Videos");
migrationBuilder.DropTable(
name: "Channels");
}
}
}

View File

@ -0,0 +1,85 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
using YTManager;
namespace YTManager.Migrations
{
[DbContext(typeof(MediaDB))]
partial class MediaDBModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452");
modelBuilder.Entity("YTManager.Models.Channel", b =>
{
b.Property<long>("ChannelId")
.ValueGeneratedOnAdd();
b.Property<string>("Description")
.IsRequired();
b.Property<string>("ThumbnailURL")
.IsRequired();
b.Property<string>("Title")
.IsRequired();
b.Property<string>("YTChannelID")
.IsRequired();
b.HasKey("ChannelId");
b.ToTable("Channels");
});
modelBuilder.Entity("YTManager.Models.Video", b =>
{
b.Property<long>("VideoId")
.ValueGeneratedOnAdd();
b.Property<DateTime>("AddedtoDB");
b.Property<long>("ChannelId");
b.Property<string>("Description")
.IsRequired();
b.Property<string>("ThumbnailURL")
.IsRequired();
b.Property<string>("Title")
.IsRequired();
b.Property<DateTime>("Uploaded");
b.Property<string>("YTVideoID")
.IsRequired();
b.HasKey("VideoId");
b.HasIndex("ChannelId");
b.ToTable("Videos");
});
modelBuilder.Entity("YTManager.Models.Video", b =>
{
b.HasOne("YTManager.Models.Channel", "Channel")
.WithMany("Videos")
.HasForeignKey("ChannelId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}