Ignore:
Timestamp:
10/29/25 15:41:48 (11 months ago)
Author:
stefansaveski <stefansaveski19@…>
Branches:
master
Children:
3592476
Parents:
4708118
Message:

Add EMBG property and consolidate migrations

Added EMBG property to User and RegisterDto classes to store unique user identifiers. Removed outdated migration files and introduced a new consolidated migration (20251029131316_InitialCreate) to define the database schema, including User, ContactInfo, EnrollmentInfo, HighSchool, and RefreshToken tables with appropriate relationships. Updated AppDbContextModelSnapshot to reflect the new schema. Changed the development database connection string in appsettings.Development.json for improved configuration.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • iknow-api/Migrations/20251029131316_InitialCreate.cs

    r4708118 rf8af32b  
    9999                });
    100100
     101            migrationBuilder.CreateTable(
     102                name: "RefreshToken",
     103                columns: table => new
     104                {
     105                    Id = table.Column<int>(type: "integer", nullable: false)
     106                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
     107                    UserId = table.Column<int>(type: "integer", nullable: false),
     108                    Token = table.Column<string>(type: "text", nullable: true),
     109                    ExpiresAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
     110                    IsValid = table.Column<bool>(type: "boolean", nullable: false)
     111                },
     112                constraints: table =>
     113                {
     114                    table.PrimaryKey("PK_RefreshToken", x => x.Id);
     115                    table.ForeignKey(
     116                        name: "FK_RefreshToken_User_UserId",
     117                        column: x => x.UserId,
     118                        principalTable: "User",
     119                        principalColumn: "Id",
     120                        onDelete: ReferentialAction.Cascade);
     121                });
     122
    101123            migrationBuilder.CreateIndex(
    102124                name: "IX_ContactInfo_UserId",
    103125                table: "ContactInfo",
    104                 column: "UserId");
     126                column: "UserId",
     127                unique: true);
    105128
    106129            migrationBuilder.CreateIndex(
    107130                name: "IX_EnrollmentInfo_UserId",
    108131                table: "EnrollmentInfo",
    109                 column: "UserId");
     132                column: "UserId",
     133                unique: true);
    110134
    111135            migrationBuilder.CreateIndex(
    112136                name: "IX_HighSchool_UserId",
    113137                table: "HighSchool",
     138                column: "UserId",
     139                unique: true);
     140
     141            migrationBuilder.CreateIndex(
     142                name: "IX_RefreshToken_UserId",
     143                table: "RefreshToken",
    114144                column: "UserId");
    115145        }
     
    128158
    129159            migrationBuilder.DropTable(
     160                name: "RefreshToken");
     161
     162            migrationBuilder.DropTable(
    130163                name: "User");
    131164        }
Note: See TracChangeset for help on using the changeset viewer.