aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Migrations/20220319203018_UserBase.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2023-02-25 13:15:44 +0100
committerivarlovlie <git@ivarlovlie.no>2023-02-25 13:15:44 +0100
commit900bb5e845c3ad44defbd427cae3d44a4a43321f (patch)
treedf3d96a93771884add571e82336c29fc3d9c7a1c /code/api/src/Migrations/20220319203018_UserBase.cs
downloadgreatoffice-900bb5e845c3ad44defbd427cae3d44a4a43321f.tar.xz
greatoffice-900bb5e845c3ad44defbd427cae3d44a4a43321f.zip
feat: Initial commit
Diffstat (limited to 'code/api/src/Migrations/20220319203018_UserBase.cs')
-rw-r--r--code/api/src/Migrations/20220319203018_UserBase.cs140
1 files changed, 140 insertions, 0 deletions
diff --git a/code/api/src/Migrations/20220319203018_UserBase.cs b/code/api/src/Migrations/20220319203018_UserBase.cs
new file mode 100644
index 0000000..14d3f4b
--- /dev/null
+++ b/code/api/src/Migrations/20220319203018_UserBase.cs
@@ -0,0 +1,140 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace IOL.GreatOffice.Api.Migrations
+{
+ public partial class UserBase : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "modified_at",
+ table: "forgot_password_requests");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "user_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "user_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "user_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: true,
+ oldClrType: typeof(Guid),
+ oldType: "uuid");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_time_labels_user_id",
+ table: "time_labels",
+ column: "user_id");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_time_entries_user_id",
+ table: "time_entries",
+ column: "user_id");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_time_categories_user_id",
+ table: "time_categories",
+ column: "user_id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_categories_users_user_id",
+ table: "time_categories",
+ column: "user_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_entries_users_user_id",
+ table: "time_entries",
+ column: "user_id",
+ principalTable: "users",
+ principalColumn: "id");
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_time_labels_users_user_id",
+ table: "time_labels",
+ column: "user_id",
+ principalTable: "users",
+ principalColumn: "id");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_categories_users_user_id",
+ table: "time_categories");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_entries_users_user_id",
+ table: "time_entries");
+
+ migrationBuilder.DropForeignKey(
+ name: "fk_time_labels_users_user_id",
+ table: "time_labels");
+
+ migrationBuilder.DropIndex(
+ name: "ix_time_labels_user_id",
+ table: "time_labels");
+
+ migrationBuilder.DropIndex(
+ name: "ix_time_entries_user_id",
+ table: "time_entries");
+
+ migrationBuilder.DropIndex(
+ name: "ix_time_categories_user_id",
+ table: "time_categories");
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "user_id",
+ table: "time_labels",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "user_id",
+ table: "time_entries",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<Guid>(
+ name: "user_id",
+ table: "time_categories",
+ type: "uuid",
+ nullable: false,
+ defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
+ oldClrType: typeof(Guid),
+ oldType: "uuid",
+ oldNullable: true);
+
+ migrationBuilder.AddColumn<DateTime>(
+ name: "modified_at",
+ table: "forgot_password_requests",
+ type: "timestamp with time zone",
+ nullable: true);
+ }
+ }
+}