Updated deps (hangfire, dotnet core, aspnet core, etc) and squashed migrations
This commit is contained in:
72
Migrations/20190127210534_initial.cs
Normal file
72
Migrations/20190127210534_initial.cs
Normal file
@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace YTManager.Migrations
|
||||
{
|
||||
public partial class initial : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Channels",
|
||||
columns: table => new
|
||||
{
|
||||
PrimaryKey = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
|
||||
Title = table.Column<string>(nullable: false),
|
||||
Description = table.Column<string>(nullable: false),
|
||||
ThumbnailURL = table.Column<string>(nullable: false),
|
||||
YoutubeID = table.Column<string>(nullable: false),
|
||||
AddedtoDB = table.Column<DateTime>(nullable: false),
|
||||
Refreshed = table.Column<DateTime>(nullable: false),
|
||||
UserTags = table.Column<string[]>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Channels", x => x.PrimaryKey);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Videos",
|
||||
columns: table => new
|
||||
{
|
||||
PrimaryKey = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
|
||||
Title = table.Column<string>(nullable: false),
|
||||
Description = table.Column<string>(nullable: false),
|
||||
YoutubeID = table.Column<string>(nullable: false),
|
||||
ThumbnailURL = table.Column<string>(nullable: false),
|
||||
AddedToYT = table.Column<DateTime>(nullable: false),
|
||||
AddedtoDB = table.Column<DateTime>(nullable: false),
|
||||
Duration = table.Column<TimeSpan>(nullable: false),
|
||||
ChannelPrimaryKey = table.Column<long>(nullable: false),
|
||||
Tags = table.Column<string[]>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Videos", x => x.PrimaryKey);
|
||||
table.ForeignKey(
|
||||
name: "FK_Videos_Channels_ChannelPrimaryKey",
|
||||
column: x => x.ChannelPrimaryKey,
|
||||
principalTable: "Channels",
|
||||
principalColumn: "PrimaryKey",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Videos_ChannelPrimaryKey",
|
||||
table: "Videos",
|
||||
column: "ChannelPrimaryKey");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Videos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Channels");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user