using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace AuthorBuddy.Web.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "DocumentMeta", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), project_id = table.Column(type: "INTEGER", nullable: true), file_path = table.Column(type: "TEXT", nullable: false), last_modified = table.Column(type: "TEXT", nullable: true), Hash = table.Column(type: "TEXT", nullable: true), file_type = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_DocumentMeta", x => x.Id); }); migrationBuilder.CreateTable( name: "Projects", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false), RootPath = table.Column(type: "TEXT", nullable: false), LastOpened = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Projects", x => x.Id); }); migrationBuilder.CreateTable( name: "Settings", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), key = table.Column(type: "TEXT", nullable: false), value = table.Column(type: "TEXT", nullable: false), user_id = table.Column(type: "INTEGER", nullable: true), project_id = table.Column(type: "INTEGER", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Settings", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), name = table.Column(type: "TEXT", nullable: false), is_current = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DocumentMeta"); migrationBuilder.DropTable( name: "Projects"); migrationBuilder.DropTable( name: "Settings"); migrationBuilder.DropTable( name: "Users"); } } }