using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SharpbinV3.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Users", columns: table => new { UID = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), UUID = table.Column(type: "TEXT", nullable: false), Username = table.Column(type: "TEXT", nullable: false), PasswordHash = table.Column(type: "TEXT", nullable: false), Email = table.Column(type: "TEXT", nullable: true), DisplayName = table.Column(type: "TEXT", nullable: true), LastLogin = table.Column(type: "INTEGER", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.UID); }); migrationBuilder.CreateTable( name: "Pastes", columns: table => new { PID = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), UUID = table.Column(type: "TEXT", nullable: false), ID = table.Column(type: "TEXT", nullable: true), Title = table.Column(type: "TEXT", nullable: true), AuthorUUID = table.Column(type: "TEXT", nullable: false), UserUID = table.Column(type: "INTEGER", nullable: true), FilePath = table.Column(type: "TEXT", nullable: false), EditedAt = table.Column(type: "INTEGER", nullable: true), Size = table.Column(type: "INTEGER", nullable: false), TrueSize = table.Column(type: "INTEGER", nullable: false), Views = table.Column(type: "INTEGER", nullable: false), Syntax = table.Column(type: "TEXT", nullable: true), ExpiresAt = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Pastes", x => x.PID); table.ForeignKey( name: "FK_Pastes_Users_UserUID", column: x => x.UserUID, principalTable: "Users", principalColumn: "UID"); }); migrationBuilder.CreateIndex( name: "IX_Pastes_UserUID", table: "Pastes", column: "UserUID"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Pastes"); migrationBuilder.DropTable( name: "Users"); } } }