source: iknow-api/Migrations/20251020130122_InitialCreate.cs@ c0a75ab

Last change on this file since c0a75ab was 618be76, checked in by imbrsk <boris696boris@…>, 11 months ago

Implement user management features with database integration

  • Property mode set to 100644
File size: 1.7 KB
Line 
1using System;
2using Microsoft.EntityFrameworkCore.Migrations;
3using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
4
5#nullable disable
6
7namespace iknow_api.Migrations
8{
9 /// <inheritdoc />
10 public partial class InitialCreate : Migration
11 {
12 /// <inheritdoc />
13 protected override void Up(MigrationBuilder migrationBuilder)
14 {
15 migrationBuilder.CreateTable(
16 name: "Users",
17 columns: table => new
18 {
19 Id = table.Column<int>(type: "integer", nullable: false)
20 .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
21 Name = table.Column<string>(type: "text", nullable: true),
22 Surname = table.Column<string>(type: "text", nullable: true),
23 Index = table.Column<string>(type: "text", nullable: true),
24 Email = table.Column<string>(type: "text", nullable: true),
25 Password = table.Column<string>(type: "text", nullable: true),
26 Bday = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
27 CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
28 Role = table.Column<int>(type: "integer", nullable: false)
29 },
30 constraints: table =>
31 {
32 table.PrimaryKey("PK_Users", x => x.Id);
33 });
34 }
35
36 /// <inheritdoc />
37 protected override void Down(MigrationBuilder migrationBuilder)
38 {
39 migrationBuilder.DropTable(
40 name: "Users");
41 }
42 }
43}
Note: See TracBrowser for help on using the repository browser.