60 lines
2.6 KiB
C#
60 lines
2.6 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|