mirror of
https://github.com/jcreek/YouTubeChannelDownloader.git
synced 2026-07-13 03:03:46 +00:00
feat(*): Add db migrations
This commit is contained in:
+39
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user