diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2020-08-02 00:04:06 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2020-08-02 00:04:06 +0200 |
| commit | c7d72be2d1eed9b7fbfe719752ff800653d8c089 (patch) | |
| tree | 6c92e3e434bb49efc84a84c3c170a560728df93e /src/server/Migrations/20200801205356_INITIAL_MIGRATION.cs | |
| parent | f055808ca22d3df5e5984a1e27ef6aa49bcc5b9b (diff) | |
| download | dough-c7d72be2d1eed9b7fbfe719752ff800653d8c089.tar.xz dough-c7d72be2d1eed9b7fbfe719752ff800653d8c089.zip | |
change db, set cookie
Diffstat (limited to 'src/server/Migrations/20200801205356_INITIAL_MIGRATION.cs')
| -rw-r--r-- | src/server/Migrations/20200801205356_INITIAL_MIGRATION.cs | 97 |
1 files changed, 97 insertions, 0 deletions
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<Guid>(nullable: false), + Created = table.Column<DateTime>(nullable: false), + CreatedBy = table.Column<Guid>(nullable: true), + Hidden = table.Column<bool>(nullable: false), + Name = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Categories", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Payees", + columns: table => new + { + Id = table.Column<Guid>(nullable: false), + Created = table.Column<DateTime>(nullable: false), + CreatedBy = table.Column<Guid>(nullable: true), + Hidden = table.Column<bool>(nullable: false), + Name = table.Column<string>(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Payees", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Transactions", + columns: table => new + { + Id = table.Column<Guid>(nullable: false), + Created = table.Column<DateTime>(nullable: false), + CreatedBy = table.Column<Guid>(nullable: true), + Hidden = table.Column<bool>(nullable: false), + Tags = table.Column<string>(nullable: true), + Note = table.Column<string>(nullable: true), + Date = table.Column<DateTime>(nullable: false), + Amount = table.Column<double>(nullable: false), + PayeeId = table.Column<Guid>(nullable: false), + CategoryId = table.Column<Guid>(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Transactions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column<Guid>(nullable: false), + Created = table.Column<DateTime>(nullable: false), + CreatedBy = table.Column<Guid>(nullable: true), + Hidden = table.Column<bool>(nullable: false), + Password = table.Column<string>(nullable: true), + Username = table.Column<string>(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"); + } + } +} |
