Add project files.
This commit is contained in:
23
DatamodelLibrary/DatamodelLibrary.csproj
Normal file
23
DatamodelLibrary/DatamodelLibrary.csproj
Normal file
@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DataDomain\DataDomain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
90
DatamodelLibrary/Migrations/20210301205458_initial.Designer.cs
generated
Normal file
90
DatamodelLibrary/Migrations/20210301205458_initial.Designer.cs
generated
Normal file
@ -0,0 +1,90 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DatamodelLibrary;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockContext))]
|
||||
[Migration("20210301205458_initial")]
|
||||
partial class initial
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("DataDomain.Person", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("Born")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("NickName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.StockMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ActAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("ActDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("ActValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("BuyDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("BuyValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("PostAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("SoldDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal?>("SoldValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockExtId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Stocks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
59
DatamodelLibrary/Migrations/20210301205458_initial.cs
Normal file
59
DatamodelLibrary/Migrations/20210301205458_initial.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
public partial class initial : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Persons",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
FirstName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LastName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
NickName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Born = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Persons", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Stocks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
StockId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
StockExtId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
BuyValue = table.Column<decimal>(type: "TEXT", nullable: false),
|
||||
BuyDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
ActValue = table.Column<decimal>(type: "TEXT", nullable: false),
|
||||
ActDate = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
ActAmount = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
SoldValue = table.Column<decimal>(type: "TEXT", nullable: true),
|
||||
SoldDate = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
Comment = table.Column<string>(type: "TEXT", nullable: true),
|
||||
PostAmount = table.Column<long>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Stocks", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Persons");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Stocks");
|
||||
}
|
||||
}
|
||||
}
|
||||
125
DatamodelLibrary/Migrations/20210306151633_completion_person_address.Designer.cs
generated
Normal file
125
DatamodelLibrary/Migrations/20210306151633_completion_person_address.Designer.cs
generated
Normal file
@ -0,0 +1,125 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DatamodelLibrary;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockContext))]
|
||||
[Migration("20210306151633_completion_person_address")]
|
||||
partial class completion_person_address
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("DataDomain.Address", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Gata")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Gata2")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Nation")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PostNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("PostOrt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.Person", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("Born")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comments")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("HomeAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("InvoiceAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("NickName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.StockMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ActAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("ActDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("ActValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("BuyDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("BuyValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("PostAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("SoldDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal?>("SoldValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockExtId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Stocks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
public partial class completion_person_address : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Comments",
|
||||
table: "Persons",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "HomeAddress",
|
||||
table: "Persons",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "InvoiceAddress",
|
||||
table: "Persons",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Addresses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Gata = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Gata2 = table.Column<string>(type: "TEXT", nullable: true),
|
||||
PostNr = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
PostOrt = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Nation = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Addresses", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Addresses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Comments",
|
||||
table: "Persons");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HomeAddress",
|
||||
table: "Persons");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "InvoiceAddress",
|
||||
table: "Persons");
|
||||
}
|
||||
}
|
||||
}
|
||||
145
DatamodelLibrary/Migrations/20210307074530_completion_person_stock.Designer.cs
generated
Normal file
145
DatamodelLibrary/Migrations/20210307074530_completion_person_stock.Designer.cs
generated
Normal file
@ -0,0 +1,145 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DatamodelLibrary;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockContext))]
|
||||
[Migration("20210307074530_completion_person_stock")]
|
||||
partial class completion_person_stock
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("DataDomain.Address", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Gata")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Gata2")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Nation")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PostNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("PostOrt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.Person", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("Born")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comments")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("HomeAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("InvoiceAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("NickName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.PersonStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PersonId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("StockId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PersonStocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.StockMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ActAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("ActDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("ActValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("BuyDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("BuyValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("PostAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("SoldDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal?>("SoldValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockExtId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Stocks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
public partial class completion_person_stock : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PersonStocks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
PersonId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
StockId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Comment = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PersonStocks", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PersonStocks");
|
||||
}
|
||||
}
|
||||
}
|
||||
151
DatamodelLibrary/Migrations/20210307212939_ChangedFormat_Person_Address.Designer.cs
generated
Normal file
151
DatamodelLibrary/Migrations/20210307212939_ChangedFormat_Person_Address.Designer.cs
generated
Normal file
@ -0,0 +1,151 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DatamodelLibrary;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockContext))]
|
||||
[Migration("20210307212939_ChangedFormat_Person_Address")]
|
||||
partial class ChangedFormat_Person_Address
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("DataDomain.Address", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Destination")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Nation")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Street")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Street2")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Zipcode")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.Person", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("AccountNo")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Born")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ClearingNo")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Comments")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("HomeAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("InvoiceAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("NickName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.PersonStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PersonId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("StockId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PersonStocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.StockMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ActAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("ActDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("ActValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("BuyDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("BuyValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("PostAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("SoldDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal?>("SoldValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockExtId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Stocks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
public partial class ChangedFormat_Person_Address : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "PostOrt",
|
||||
table: "Addresses",
|
||||
newName: "Street2");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "PostNr",
|
||||
table: "Addresses",
|
||||
newName: "Zipcode");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Gata2",
|
||||
table: "Addresses",
|
||||
newName: "Street");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Gata",
|
||||
table: "Addresses",
|
||||
newName: "Destination");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "AccountNo",
|
||||
table: "Persons",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ClearingNo",
|
||||
table: "Persons",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AccountNo",
|
||||
table: "Persons");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ClearingNo",
|
||||
table: "Persons");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Zipcode",
|
||||
table: "Addresses",
|
||||
newName: "PostNr");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Street2",
|
||||
table: "Addresses",
|
||||
newName: "PostOrt");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Street",
|
||||
table: "Addresses",
|
||||
newName: "Gata2");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Destination",
|
||||
table: "Addresses",
|
||||
newName: "Gata");
|
||||
}
|
||||
}
|
||||
}
|
||||
174
DatamodelLibrary/Migrations/20210316200448_backupregister.Designer.cs
generated
Normal file
174
DatamodelLibrary/Migrations/20210316200448_backupregister.Designer.cs
generated
Normal file
@ -0,0 +1,174 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DatamodelLibrary;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockContext))]
|
||||
[Migration("20210316200448_backupregister")]
|
||||
partial class backupregister
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("DataDomain.Address", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Destination")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Nation")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Street")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Street2")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Zipcode")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.BackupRegister", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("BackedUp")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BackupDbName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BackupPath")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DbName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BackupRegings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.Person", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("AccountNo")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Born")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ClearingNo")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Comments")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("HomeAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("InvoiceAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("NickName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.PersonStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PersonId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("StockId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PersonStocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.StockMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ActAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("ActDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("ActValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("BuyDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("BuyValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("PostAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("SoldDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal?>("SoldValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockExtId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Stocks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
33
DatamodelLibrary/Migrations/20210316200448_backupregister.cs
Normal file
33
DatamodelLibrary/Migrations/20210316200448_backupregister.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
public partial class backupregister : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BackupRegings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
BackedUp = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
DbName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
BackupDbName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
BackupPath = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BackupRegings", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "BackupRegings");
|
||||
}
|
||||
}
|
||||
}
|
||||
172
DatamodelLibrary/Migrations/StockContextModelSnapshot.cs
Normal file
172
DatamodelLibrary/Migrations/StockContextModelSnapshot.cs
Normal file
@ -0,0 +1,172 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DatamodelLibrary;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace DatamodelLibrary.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockContext))]
|
||||
partial class StockContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("DataDomain.Address", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Destination")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Nation")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Street")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Street2")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Zipcode")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.BackupRegister", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("BackedUp")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BackupDbName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("BackupPath")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DbName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("BackupRegings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.Person", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("AccountNo")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Born")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ClearingNo")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Comments")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("HomeAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("InvoiceAddress")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("NickName")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Persons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.PersonStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PersonId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("StockId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PersonStocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DataDomain.StockMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ActAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("ActDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("ActValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("BuyDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("BuyValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("PostAmount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("SoldDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal?>("SoldValue")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockExtId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("StockId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Stocks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
22
DatamodelLibrary/StockContext.cs
Normal file
22
DatamodelLibrary/StockContext.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using DataDomain;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DatamodelLibrary
|
||||
{
|
||||
public class StockContext : DbContext
|
||||
{
|
||||
public DbSet<StockMember> Stocks { get; set; }
|
||||
public DbSet<Person> Persons { get; set; }
|
||||
public DbSet<Address> Addresses { get; set; }
|
||||
public DbSet<PersonStock> PersonStocks { get; set; }
|
||||
public DbSet<BackupRegister> BackupRegings { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
=> options.UseSqlite("Data Source=Stocks.db");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user