using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace MyOffice.Migrations.Sqlite.Migrations { /// public partial class init : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), UserName = table.Column(type: "TEXT", nullable: false, collation: "NOCASE"), Email = table.Column(type: "TEXT", nullable: false, collation: "NOCASE"), PasswordHash = table.Column(type: "TEXT", nullable: false), FirstName = table.Column(type: "TEXT", nullable: true), LastName = table.Column(type: "TEXT", nullable: true), FullName = table.Column(type: "TEXT", nullable: true), IsEmailConfirmed = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); migrationBuilder.CreateTable( name: "UserClaims", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), CreatedOn = table.Column(type: "TEXT", nullable: false), UserId = table.Column(type: "TEXT", nullable: false), ExternalId = table.Column(type: "TEXT", nullable: false), Email = table.Column(type: "TEXT", nullable: false, collation: "NOCASE"), Provider = table.Column(type: "TEXT", nullable: false, collation: "NOCASE") }, constraints: table => { table.PrimaryKey("PK_UserClaims", x => x.Id); table.ForeignKey( name: "FK_UserClaims_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_UserClaims_UserId", table: "UserClaims", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "UserClaims"); migrationBuilder.DropTable( name: "Users"); } } }