feat(*): Add db migrations

This commit is contained in:
Josh Creek
2021-08-29 15:40:22 +01:00
parent f65701dbd9
commit 2e2d6771c0
3 changed files with 106 additions and 0 deletions
@@ -0,0 +1,39 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using YouTubeChannelDownloader.Data;
namespace YouTubeChannelDownloader.Migrations
{
[DbContext(typeof(DownloadedVideosContext))]
[Migration("20210826231651_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.9");
modelBuilder.Entity("YouTubeChannelDownloader.Models.DownloadedVideo", b =>
{
b.Property<string>("DownloadedVideoId")
.HasColumnType("TEXT");
b.Property<DateTime>("DownloadedDateTime")
.HasColumnType("TEXT");
b.Property<string>("Title")
.HasColumnType("TEXT");
b.HasKey("DownloadedVideoId");
b.ToTable("DownloadedVideos");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,30 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace YouTubeChannelDownloader.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DownloadedVideos",
columns: table => new
{
DownloadedVideoId = table.Column<string>(type: "TEXT", nullable: false),
DownloadedDateTime = table.Column<DateTime>(type: "TEXT", nullable: false),
Title = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DownloadedVideos", x => x.DownloadedVideoId);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DownloadedVideos");
}
}
}
@@ -0,0 +1,37 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using YouTubeChannelDownloader.Data;
namespace YouTubeChannelDownloader.Migrations
{
[DbContext(typeof(DownloadedVideosContext))]
partial class DownloadedVideosContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.9");
modelBuilder.Entity("YouTubeChannelDownloader.Models.DownloadedVideo", b =>
{
b.Property<string>("DownloadedVideoId")
.HasColumnType("TEXT");
b.Property<DateTime>("DownloadedDateTime")
.HasColumnType("TEXT");
b.Property<string>("Title")
.HasColumnType("TEXT");
b.HasKey("DownloadedVideoId");
b.ToTable("DownloadedVideos");
});
#pragma warning restore 612, 618
}
}
}