using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Blahblah.FlowerStory.Server.Migrations { /// public partial class InitialCreateDb : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "flowers", columns: table => new { fid = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), categoryid = table.Column(type: "INTEGER", nullable: false), name = table.Column(type: "TEXT", nullable: false), datebuy = table.Column(type: "numeric", nullable: false), cost = table.Column(type: "real", nullable: true), purchase = table.Column(type: "TEXT", nullable: true), photo = table.Column(type: "BLOB", nullable: true) }, constraints: table => { table.PrimaryKey("PK_flowers", x => x.fid); }); migrationBuilder.CreateTable( name: "records", columns: table => new { rid = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), eid = table.Column(type: "INTEGER", nullable: false), date = table.Column(type: "numeric", nullable: false), byuid = table.Column(type: "INTEGER", nullable: true), byname = table.Column(type: "TEXT", nullable: true), photo = table.Column(type: "BLOB", nullable: true) }, constraints: table => { table.PrimaryKey("PK_records", x => x.rid); }); migrationBuilder.CreateTable( name: "users", columns: table => new { uid = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), id = table.Column(type: "TEXT", nullable: false), password = table.Column(type: "TEXT", nullable: false), level = table.Column(type: "INTEGER", nullable: false), regdate = table.Column(type: "numeric", nullable: false), activedate = table.Column(type: "numeric", nullable: true), name = table.Column(type: "TEXT", nullable: false), email = table.Column(type: "TEXT", nullable: true), mobile = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_users", x => x.uid); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "flowers"); migrationBuilder.DropTable( name: "records"); migrationBuilder.DropTable( name: "users"); } } }