added initial migration
This commit is contained in:
41
Tv7Playlist.Data/Migrations/20181209233600_InitialCreate.Designer.cs
generated
Normal file
41
Tv7Playlist.Data/Migrations/20181209233600_InitialCreate.Designer.cs
generated
Normal file
@@ -0,0 +1,41 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Tv7Playlist.Data;
|
||||
|
||||
namespace Tv7Playlist.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlaylistContext))]
|
||||
[Migration("20181209233600_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687");
|
||||
|
||||
modelBuilder.Entity("Tv7Playlist.Data.PlaylistEntry", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<int>("TrackNumber");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAlternateKey("TrackNumber");
|
||||
|
||||
b.ToTable("PlaylistEntries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
32
Tv7Playlist.Data/Migrations/20181209233600_InitialCreate.cs
Normal file
32
Tv7Playlist.Data/Migrations/20181209233600_InitialCreate.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Tv7Playlist.Data.Migrations
|
||||
{
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlaylistEntries",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(nullable: false),
|
||||
TrackNumber = table.Column<int>(nullable: false),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Url = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlaylistEntries", x => x.Id);
|
||||
table.UniqueConstraint("AK_PlaylistEntries_TrackNumber", x => x.TrackNumber);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlaylistEntries");
|
||||
}
|
||||
}
|
||||
}
|
39
Tv7Playlist.Data/Migrations/PlaylistContextModelSnapshot.cs
Normal file
39
Tv7Playlist.Data/Migrations/PlaylistContextModelSnapshot.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Tv7Playlist.Data;
|
||||
|
||||
namespace Tv7Playlist.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlaylistContext))]
|
||||
partial class PlaylistContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687");
|
||||
|
||||
modelBuilder.Entity("Tv7Playlist.Data.PlaylistEntry", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<int>("TrackNumber");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAlternateKey("TrackNumber");
|
||||
|
||||
b.ToTable("PlaylistEntries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
16
Tv7Playlist.Data/PlaylistContextFactory.cs
Normal file
16
Tv7Playlist.Data/PlaylistContextFactory.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
|
||||
namespace Tv7Playlist.Data
|
||||
{
|
||||
public class PlaylistContextFactory : IDesignTimeDbContextFactory<PlaylistContext>
|
||||
{
|
||||
public PlaylistContext CreateDbContext(string[] args)
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<PlaylistContext>();
|
||||
optionsBuilder.UseSqlite("Data Source=designPlaylist.db");
|
||||
|
||||
return new PlaylistContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,12 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user