mirror of
https://github.com/XFox111/MuiCharts.git
synced 2026-04-22 06:51:05 +03:00
Added ASP.NET backend with SQLite
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MuiCharts.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20240221200319_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.2");
|
||||
|
||||
modelBuilder.Entity("MuiCharts.Domain.Models.Point", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Height")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Points");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MuiCharts.Domain.Models.Track", b =>
|
||||
{
|
||||
b.Property<int>("FirstId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("SecondId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Distance")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MaxSpeed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Surface")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("FirstId", "SecondId");
|
||||
|
||||
b.ToTable("Tracks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MuiCharts.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Points",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Height = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Points", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tracks",
|
||||
columns: table => new
|
||||
{
|
||||
FirstId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
SecondId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Distance = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Surface = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
MaxSpeed = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tracks", x => new { x.FirstId, x.SecondId });
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Points");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tracks");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MuiCharts.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
partial class DataContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.2");
|
||||
|
||||
modelBuilder.Entity("MuiCharts.Domain.Models.Point", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Height")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Points");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MuiCharts.Domain.Models.Track", b =>
|
||||
{
|
||||
b.Property<int>("FirstId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("SecondId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Distance")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MaxSpeed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Surface")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("FirstId", "SecondId");
|
||||
|
||||
b.ToTable("Tracks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user