using System; using Microsoft.EntityFrameworkCore.Migrations; using NodaTime; #nullable disable namespace FictionArchive.Service.UserService.Migrations { /// public partial class Initial : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Username = table.Column(type: "text", nullable: false), Email = table.Column(type: "text", nullable: false), OAuthProviderId = table.Column(type: "text", nullable: false), Disabled = table.Column(type: "boolean", nullable: false), InviterId = table.Column(type: "uuid", nullable: true), CreatedTime = table.Column(type: "timestamp with time zone", nullable: false), LastUpdatedTime = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); table.ForeignKey( name: "FK_Users_Users_InviterId", column: x => x.InviterId, principalTable: "Users", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_Users_InviterId", table: "Users", column: "InviterId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Users"); } } }