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 { PrimaryKey = table.Column(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), AddedtoDB = table.Column(nullable: false), Description = table.Column(nullable: false), Refreshed = table.Column(nullable: false), ThumbnailURL = table.Column(nullable: false), Title = table.Column(nullable: false), UserTags = table.Column>(nullable: true), YoutubeID = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Channels", x => x.PrimaryKey); }); migrationBuilder.CreateTable( name: "Videos", columns: table => new { PrimaryKey = table.Column(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), AddedToYT = table.Column(nullable: false), AddedtoDB = table.Column(nullable: false), ChannelPrimaryKey = table.Column(nullable: false), Description = table.Column(nullable: false), Duration = table.Column(nullable: false), Tags = table.Column>(nullable: false), ThumbnailURL = table.Column(nullable: false), Title = table.Column(nullable: false), YoutubeID = table.Column(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"); } } }