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(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Street = table.Column(type: "TEXT", nullable: true), Street2 = table.Column(type: "TEXT", nullable: true), Zipcode = table.Column(type: "INTEGER", nullable: false), Destination = table.Column(type: "TEXT", nullable: true), Nation = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Addresses", x => x.Id); }); migrationBuilder.CreateTable( name: "BackupRegings", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), BackedUp = table.Column(type: "TEXT", nullable: false), DbName = table.Column(type: "TEXT", nullable: true), BackupDbName = table.Column(type: "TEXT", nullable: true), BackupPath = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_BackupRegings", x => x.Id); }); migrationBuilder.CreateTable( name: "Persons", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), FirstName = table.Column(type: "TEXT", nullable: true), LastName = table.Column(type: "TEXT", nullable: true), NickName = table.Column(type: "TEXT", nullable: false), Born = table.Column(type: "TEXT", nullable: true), Comments = table.Column(type: "TEXT", nullable: true), HomeAddress = table.Column(type: "INTEGER", nullable: false), InvoiceAddress = table.Column(type: "INTEGER", nullable: false), ClearingNo = table.Column(type: "INTEGER", nullable: false), AccountNo = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Persons", x => x.Id); }); migrationBuilder.CreateTable( name: "PersonStocks", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), PersonId = table.Column(type: "INTEGER", nullable: false), StockId = table.Column(type: "INTEGER", nullable: false), Comment = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_PersonStocks", x => x.Id); }); migrationBuilder.CreateTable( name: "StockGroups", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), StockGroup = table.Column(type: "TEXT", nullable: true), StockName = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_StockGroups", x => x.Id); }); migrationBuilder.CreateTable( name: "Stocks", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), StockId = table.Column(type: "TEXT", nullable: true), StockExtId = table.Column(type: "TEXT", nullable: true), BuyValue = table.Column(type: "TEXT", nullable: false), BuyDate = table.Column(type: "TEXT", nullable: false), ActValue = table.Column(type: "TEXT", nullable: false), ActDate = table.Column(type: "TEXT", nullable: true), ActAmount = table.Column(type: "INTEGER", nullable: false), SoldValue = table.Column(type: "TEXT", nullable: true), SoldDate = table.Column(type: "TEXT", nullable: true), Comment = table.Column(type: "TEXT", nullable: true), PostAmount = table.Column(type: "INTEGER", nullable: false), SoldStockPrice = table.Column(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"); } } }