Added initial migration

This commit is contained in:
Thorsten Sommer 2022-06-12 17:16:11 +02:00
parent c0ffd58268
commit 1f23f88051
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
4 changed files with 195 additions and 0 deletions

View File

@ -0,0 +1,65 @@
// <auto-generated />
using System;
using DataModel.Database.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DataModel.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20220612151133_202206AddSettings")]
partial class _202206AddSettings
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.5");
modelBuilder.Entity("DataModel.Database.Setting", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<bool>("BoolValue")
.HasColumnType("INTEGER");
b.Property<Guid>("GuidValue")
.HasColumnType("TEXT");
b.Property<int>("IntegerValue")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("TextValue")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("BoolValue");
b.HasIndex("GuidValue");
b.HasIndex("Id");
b.HasIndex("IntegerValue");
b.HasIndex("Name")
.IsUnique();
b.HasIndex("TextValue");
b.ToTable("Settings");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,67 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DataModel.Migrations
{
public partial class _202206AddSettings : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Settings",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
TextValue = table.Column<string>(type: "TEXT", nullable: false),
BoolValue = table.Column<bool>(type: "INTEGER", nullable: false),
IntegerValue = table.Column<int>(type: "INTEGER", nullable: false),
GuidValue = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Settings", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Settings_BoolValue",
table: "Settings",
column: "BoolValue");
migrationBuilder.CreateIndex(
name: "IX_Settings_GuidValue",
table: "Settings",
column: "GuidValue");
migrationBuilder.CreateIndex(
name: "IX_Settings_Id",
table: "Settings",
column: "Id");
migrationBuilder.CreateIndex(
name: "IX_Settings_IntegerValue",
table: "Settings",
column: "IntegerValue");
migrationBuilder.CreateIndex(
name: "IX_Settings_Name",
table: "Settings",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Settings_TextValue",
table: "Settings",
column: "TextValue");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Settings");
}
}
}

View File

@ -0,0 +1,63 @@
// <auto-generated />
using System;
using DataModel.Database.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DataModel.Migrations
{
[DbContext(typeof(DataContext))]
partial class DataContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.5");
modelBuilder.Entity("DataModel.Database.Setting", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<bool>("BoolValue")
.HasColumnType("INTEGER");
b.Property<Guid>("GuidValue")
.HasColumnType("TEXT");
b.Property<int>("IntegerValue")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("TextValue")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("BoolValue");
b.HasIndex("GuidValue");
b.HasIndex("Id");
b.HasIndex("IntegerValue");
b.HasIndex("Name")
.IsUnique();
b.HasIndex("TextValue");
b.ToTable("Settings");
});
#pragma warning restore 612, 618
}
}
}

View File