From c7d72be2d1eed9b7fbfe719752ff800653d8c089 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 2 Aug 2020 00:04:06 +0200 Subject: change db, set cookie --- .../Migrations/20200729090558_Initial.Designer.cs | 143 -------------------- src/server/Migrations/20200729090558_Initial.cs | 97 -------------- .../20200801205356_INITIAL_MIGRATION.Designer.cs | 144 +++++++++++++++++++++ .../Migrations/20200801205356_INITIAL_MIGRATION.cs | 97 ++++++++++++++ .../Migrations/MainDbContextModelSnapshot.cs | 71 +++++----- 5 files changed, 277 insertions(+), 275 deletions(-) delete mode 100644 src/server/Migrations/20200729090558_Initial.Designer.cs delete mode 100644 src/server/Migrations/20200729090558_Initial.cs create mode 100644 src/server/Migrations/20200801205356_INITIAL_MIGRATION.Designer.cs create mode 100644 src/server/Migrations/20200801205356_INITIAL_MIGRATION.cs (limited to 'src/server/Migrations') diff --git a/src/server/Migrations/20200729090558_Initial.Designer.cs b/src/server/Migrations/20200729090558_Initial.Designer.cs deleted file mode 100644 index 9657f66..0000000 --- a/src/server/Migrations/20200729090558_Initial.Designer.cs +++ /dev/null @@ -1,143 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Dough.Models.Database; - -namespace Dough.Migrations -{ - [DbContext(typeof(MainDbContext))] - [Migration("20200729090558_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.6"); - - modelBuilder.Entity("MoneyManager.Models.Database.Category", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("Created") - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasColumnType("TEXT"); - - b.Property("Hidden") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Categories"); - }); - - modelBuilder.Entity("MoneyManager.Models.Database.Payee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("Created") - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasColumnType("TEXT"); - - b.Property("Hidden") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Payees"); - }); - - modelBuilder.Entity("MoneyManager.Models.Database.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("Amount") - .HasColumnType("REAL"); - - b.Property("CategoryId") - .HasColumnType("TEXT"); - - b.Property("Created") - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasColumnType("TEXT"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("Hidden") - .HasColumnType("INTEGER"); - - b.Property("Note") - .HasColumnType("TEXT"); - - b.Property("PayeeId") - .HasColumnType("TEXT"); - - b.Property("Tags") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("MoneyManager.Models.Database.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("Created") - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasColumnType("TEXT"); - - b.Property("Hidden") - .HasColumnType("INTEGER"); - - b.Property("Password") - .HasColumnType("TEXT"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = new Guid("193053d0-4292-4dc5-baae-59a920b64891"), - Created = new DateTime(2020, 7, 29, 9, 5, 57, 914, DateTimeKind.Utc).AddTicks(3427), - Hidden = false, - Password = "$2b$10$RFdcYLeqporq94pUIOoJGOPnhUbpV7R4e.2Iz8ot02N2PqeCpDCA6", - Username = "ivar" - }); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/server/Migrations/20200729090558_Initial.cs b/src/server/Migrations/20200729090558_Initial.cs deleted file mode 100644 index 5dc0b40..0000000 --- a/src/server/Migrations/20200729090558_Initial.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Dough.Migrations -{ - public partial class Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Categories", - columns: table => new - { - Id = table.Column(nullable: false), - Created = table.Column(nullable: false), - CreatedBy = table.Column(nullable: true), - Hidden = table.Column(nullable: false), - Name = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Categories", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Payees", - columns: table => new - { - Id = table.Column(nullable: false), - Created = table.Column(nullable: false), - CreatedBy = table.Column(nullable: true), - Hidden = table.Column(nullable: false), - Name = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Payees", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Transactions", - columns: table => new - { - Id = table.Column(nullable: false), - Created = table.Column(nullable: false), - CreatedBy = table.Column(nullable: true), - Hidden = table.Column(nullable: false), - Tags = table.Column(nullable: true), - Note = table.Column(nullable: true), - Date = table.Column(nullable: false), - Amount = table.Column(nullable: false), - PayeeId = table.Column(nullable: false), - CategoryId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Transactions", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(nullable: false), - Created = table.Column(nullable: false), - CreatedBy = table.Column(nullable: true), - Hidden = table.Column(nullable: false), - Password = table.Column(nullable: true), - Username = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.InsertData( - table: "Users", - columns: new[] { "Id", "Created", "CreatedBy", "Hidden", "Password", "Username" }, - values: new object[] { new Guid("193053d0-4292-4dc5-baae-59a920b64891"), new DateTime(2020, 7, 29, 9, 5, 57, 914, DateTimeKind.Utc).AddTicks(3427), null, false, "$2b$10$RFdcYLeqporq94pUIOoJGOPnhUbpV7R4e.2Iz8ot02N2PqeCpDCA6", "ivar" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Categories"); - - migrationBuilder.DropTable( - name: "Payees"); - - migrationBuilder.DropTable( - name: "Transactions"); - - migrationBuilder.DropTable( - name: "Users"); - } - } -} diff --git a/src/server/Migrations/20200801205356_INITIAL_MIGRATION.Designer.cs b/src/server/Migrations/20200801205356_INITIAL_MIGRATION.Designer.cs new file mode 100644 index 0000000..b693783 --- /dev/null +++ b/src/server/Migrations/20200801205356_INITIAL_MIGRATION.Designer.cs @@ -0,0 +1,144 @@ +// +using System; +using Dough.Models.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Dough.Migrations +{ + [DbContext(typeof(MainDbContext))] + [Migration("20200801205356_INITIAL_MIGRATION")] + partial class INITIAL_MIGRATION + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.6") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Dough.Models.Database.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("CreatedBy") + .HasColumnType("char(36)"); + + b.Property("Hidden") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("Dough.Models.Database.Payee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("CreatedBy") + .HasColumnType("char(36)"); + + b.Property("Hidden") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Payees"); + }); + + modelBuilder.Entity("Dough.Models.Database.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Amount") + .HasColumnType("double"); + + b.Property("CategoryId") + .HasColumnType("char(36)"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("CreatedBy") + .HasColumnType("char(36)"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Hidden") + .HasColumnType("tinyint(1)"); + + b.Property("Note") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PayeeId") + .HasColumnType("char(36)"); + + b.Property("Tags") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Transactions"); + }); + + modelBuilder.Entity("Dough.Models.Database.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("CreatedBy") + .HasColumnType("char(36)"); + + b.Property("Hidden") + .HasColumnType("tinyint(1)"); + + b.Property("Password") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Username") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Users"); + + b.HasData( + new + { + Id = new Guid("4fb39ecf-9619-42be-8852-81c48a9a9f72"), + Created = new DateTime(2020, 8, 1, 20, 53, 56, 576, DateTimeKind.Utc).AddTicks(931), + Hidden = false, + Password = "$2b$10$v7e7AJc0atQvyvvwkvXAnuin0m75qRZSxcSAHdDiKcSHuByJpc0zy", + Username = "ivar" + }); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/server/Migrations/20200801205356_INITIAL_MIGRATION.cs b/src/server/Migrations/20200801205356_INITIAL_MIGRATION.cs new file mode 100644 index 0000000..f6495ae --- /dev/null +++ b/src/server/Migrations/20200801205356_INITIAL_MIGRATION.cs @@ -0,0 +1,97 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Dough.Migrations +{ + public partial class INITIAL_MIGRATION : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Categories", + columns: table => new + { + Id = table.Column(nullable: false), + Created = table.Column(nullable: false), + CreatedBy = table.Column(nullable: true), + Hidden = table.Column(nullable: false), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Categories", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Payees", + columns: table => new + { + Id = table.Column(nullable: false), + Created = table.Column(nullable: false), + CreatedBy = table.Column(nullable: true), + Hidden = table.Column(nullable: false), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Payees", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Transactions", + columns: table => new + { + Id = table.Column(nullable: false), + Created = table.Column(nullable: false), + CreatedBy = table.Column(nullable: true), + Hidden = table.Column(nullable: false), + Tags = table.Column(nullable: true), + Note = table.Column(nullable: true), + Date = table.Column(nullable: false), + Amount = table.Column(nullable: false), + PayeeId = table.Column(nullable: false), + CategoryId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Transactions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(nullable: false), + Created = table.Column(nullable: false), + CreatedBy = table.Column(nullable: true), + Hidden = table.Column(nullable: false), + Password = table.Column(nullable: true), + Username = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + }); + + migrationBuilder.InsertData( + table: "Users", + columns: new[] { "Id", "Created", "CreatedBy", "Hidden", "Password", "Username" }, + values: new object[] { new Guid("4fb39ecf-9619-42be-8852-81c48a9a9f72"), new DateTime(2020, 8, 1, 20, 53, 56, 576, DateTimeKind.Utc).AddTicks(931), null, false, "$2b$10$v7e7AJc0atQvyvvwkvXAnuin0m75qRZSxcSAHdDiKcSHuByJpc0zy", "ivar" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Categories"); + + migrationBuilder.DropTable( + name: "Payees"); + + migrationBuilder.DropTable( + name: "Transactions"); + + migrationBuilder.DropTable( + name: "Users"); + } + } +} diff --git a/src/server/Migrations/MainDbContextModelSnapshot.cs b/src/server/Migrations/MainDbContextModelSnapshot.cs index ad883c5..d4c6e7e 100644 --- a/src/server/Migrations/MainDbContextModelSnapshot.cs +++ b/src/server/Migrations/MainDbContextModelSnapshot.cs @@ -1,9 +1,9 @@ // using System; +using Dough.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Dough.Models.Database; namespace Dough.Migrations { @@ -14,112 +14,113 @@ namespace Dough.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.1.6"); + .HasAnnotation("ProductVersion", "3.1.6") + .HasAnnotation("Relational:MaxIdentifierLength", 64); - modelBuilder.Entity("MoneyManager.Models.Database.Category", b => + modelBuilder.Entity("Dough.Models.Database.Category", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Created") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("CreatedBy") - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Hidden") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.Property("Name") - .HasColumnType("TEXT"); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); b.ToTable("Categories"); }); - modelBuilder.Entity("MoneyManager.Models.Database.Payee", b => + modelBuilder.Entity("Dough.Models.Database.Payee", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Created") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("CreatedBy") - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Hidden") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.Property("Name") - .HasColumnType("TEXT"); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); b.ToTable("Payees"); }); - modelBuilder.Entity("MoneyManager.Models.Database.Transaction", b => + modelBuilder.Entity("Dough.Models.Database.Transaction", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Amount") - .HasColumnType("REAL"); + .HasColumnType("double"); b.Property("CategoryId") - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Created") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("CreatedBy") - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Date") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("Hidden") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.Property("Note") - .HasColumnType("TEXT"); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("PayeeId") - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Tags") - .HasColumnType("TEXT"); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); b.ToTable("Transactions"); }); - modelBuilder.Entity("MoneyManager.Models.Database.User", b => + modelBuilder.Entity("Dough.Models.Database.User", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Created") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("CreatedBy") - .HasColumnType("TEXT"); + .HasColumnType("char(36)"); b.Property("Hidden") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.Property("Password") - .HasColumnType("TEXT"); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("Username") - .HasColumnType("TEXT"); + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.HasKey("Id"); @@ -128,10 +129,10 @@ namespace Dough.Migrations b.HasData( new { - Id = new Guid("193053d0-4292-4dc5-baae-59a920b64891"), - Created = new DateTime(2020, 7, 29, 9, 5, 57, 914, DateTimeKind.Utc).AddTicks(3427), + Id = new Guid("4fb39ecf-9619-42be-8852-81c48a9a9f72"), + Created = new DateTime(2020, 8, 1, 20, 53, 56, 576, DateTimeKind.Utc).AddTicks(931), Hidden = false, - Password = "$2b$10$RFdcYLeqporq94pUIOoJGOPnhUbpV7R4e.2Iz8ot02N2PqeCpDCA6", + Password = "$2b$10$v7e7AJc0atQvyvvwkvXAnuin0m75qRZSxcSAHdDiKcSHuByJpc0zy", Username = "ivar" }); }); -- cgit v1.3