Files
StockInfoCoreApp/DatamodelLibrary/Migrations/20220212144423_InitialCreate.cs
2022-02-13 22:39:02 +01:00

142 lines
6.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DatamodelLibrary.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Addresses",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Street = table.Column<string>(type: "TEXT", nullable: true),
Street2 = table.Column<string>(type: "TEXT", nullable: true),
Zipcode = table.Column<int>(type: "INTEGER", nullable: false),
Destination = table.Column<string>(type: "TEXT", nullable: true),
Nation = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Addresses", x => x.Id);
});
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);
});
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: false),
Born = table.Column<string>(type: "TEXT", nullable: true),
Comments = table.Column<string>(type: "TEXT", nullable: true),
HomeAddress = table.Column<int>(type: "INTEGER", nullable: false),
InvoiceAddress = table.Column<int>(type: "INTEGER", nullable: false),
ClearingNo = table.Column<int>(type: "INTEGER", nullable: false),
AccountNo = table.Column<long>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Persons", x => x.Id);
});
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);
});
migrationBuilder.CreateTable(
name: "StockGroups",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
StockGroup = table.Column<string>(type: "TEXT", nullable: true),
StockName = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_StockGroups", 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),
SoldStockPrice = table.Column<decimal>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Stocks", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Addresses");
migrationBuilder.DropTable(
name: "BackupRegings");
migrationBuilder.DropTable(
name: "Persons");
migrationBuilder.DropTable(
name: "PersonStocks");
migrationBuilder.DropTable(
name: "StockGroups");
migrationBuilder.DropTable(
name: "Stocks");
}
}
}