using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Atomx.Data.Migrations { /// public partial class _01 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Addresses", columns: table => new { Id = table.Column(type: "bigint", nullable: false), UserId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(128)", nullable: false), Email = table.Column(type: "varchar(255)", nullable: false), Phone = table.Column(type: "varchar(20)", nullable: false), Company = table.Column(type: "varchar(255)", nullable: false), CountryId = table.Column(type: "bigint", nullable: false), Country = table.Column(type: "varchar(50)", nullable: false), ProvinceId = table.Column(type: "bigint", nullable: false), Province = table.Column(type: "varchar(100)", nullable: false), CityId = table.Column(type: "bigint", nullable: false), City = table.Column(type: "varchar(100)", nullable: false), RegionId = table.Column(type: "bigint", nullable: false), Region = table.Column(type: "varchar(100)", nullable: false), PostalCode = table.Column(type: "varchar(15)", nullable: false), AddressDetails = table.Column(type: "varchar(256)", nullable: false), FullAddress = table.Column(type: "varchar(1024)", nullable: false), Longitude = table.Column(type: "numeric(10,6)", nullable: false), Latitude = table.Column(type: "numeric(10,6)", nullable: false), IsVirtual = table.Column(type: "boolean", nullable: false), Count = table.Column(type: "integer", nullable: false), IsDelete = table.Column(type: "boolean", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Addresses", x => x.Id); }); migrationBuilder.CreateTable( name: "Admins", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Username = table.Column(type: "varchar(64)", nullable: false), Password = table.Column(type: "varchar(64)", nullable: false), Email = table.Column(type: "varchar(64)", nullable: false), Mobile = table.Column(type: "varchar(64)", nullable: false), Avatar = table.Column(type: "varchar(64)", nullable: false), RoleId = table.Column(type: "integer", nullable: false), TimeOffset = table.Column(type: "varchar(4)", nullable: false), Status = table.Column(type: "integer", nullable: false), LoginCount = table.Column(type: "integer", nullable: false), LastLogin = table.Column(type: "timestamptz", nullable: true), LastIp = table.Column(type: "varchar(50)", nullable: false), LockoutEndTime = table.Column(type: "timestamptz", nullable: true), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Admins", x => x.Id); }); migrationBuilder.CreateTable( name: "AppVersions", columns: table => new { Id = table.Column(type: "bigint", nullable: false), SiteId = table.Column(type: "bigint", nullable: false), Platform = table.Column(type: "integer", nullable: false), AppName = table.Column(type: "varchar(64)", nullable: false), Title = table.Column(type: "varchar(64)", nullable: false), Version = table.Column(type: "varchar(64)", nullable: false), VersionX = table.Column(type: "varchar(64)", nullable: false), VersionY = table.Column(type: "varchar(64)", nullable: false), VersionZ = table.Column(type: "varchar(64)", nullable: false), VersionDate = table.Column(type: "varchar(64)", nullable: false), VersionState = table.Column(type: "integer", nullable: false), Content = table.Column(type: "text", nullable: false), Status = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AppVersions", x => x.Id); }); migrationBuilder.CreateTable( name: "Areas", columns: table => new { Id = table.Column(type: "bigint", nullable: false), ParentId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(255)", nullable: false), Initial = table.Column(type: "varchar(1)", nullable: false), TwoLetterISOCode = table.Column(type: "varchar(2)", nullable: false), ThreeLetterISOCode = table.Column(type: "varchar(3)", nullable: false), NumericISOCode = table.Column(type: "integer", nullable: false), AllowShipping = table.Column(type: "boolean", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Areas", x => x.Id); }); migrationBuilder.CreateTable( name: "Categories", columns: table => new { Id = table.Column(type: "bigint", nullable: false), SiteId = table.Column(type: "bigint", nullable: false), Type = table.Column(type: "integer", nullable: false), ParentId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(25)", nullable: false), Slug = table.Column(type: "varchar(50)", nullable: false), MetaDescription = table.Column(type: "varchar(255)", nullable: false), MetaKeywords = table.Column(type: "varchar(255)", nullable: false), FilterAttributes = table.Column(type: "varchar(255)", nullable: false), Image = table.Column(type: "varchar(255)", nullable: false), Banner = table.Column(type: "varchar(255)", nullable: false), IsNode = table.Column(type: "boolean", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), Depth = table.Column(type: "integer", nullable: false), Path = table.Column(type: "varchar(100)", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), Count = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Categories", x => x.Id); }); migrationBuilder.CreateTable( name: "Currencies", columns: table => new { Id = table.Column(type: "integer", nullable: false), Name = table.Column(type: "varchar(50)", nullable: false), Title = table.Column(type: "varchar(50)", nullable: false), CurrencyCode = table.Column(type: "varchar(10)", nullable: false), DisplayLocale = table.Column(type: "varchar(15)", nullable: false), Symbolic = table.Column(type: "varchar(8)", nullable: false), CustomFormatting = table.Column(type: "varchar(20)", nullable: false), Rate = table.Column(type: "numeric(16,4)", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), EnableDisplay = table.Column(type: "boolean", nullable: false), EnablePay = table.Column(type: "boolean", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Currencies", x => x.Id); }); migrationBuilder.CreateTable( name: "CurrencyChannelRelations", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Title = table.Column(type: "text", nullable: false), CurrencyId = table.Column(type: "integer", nullable: false), PayChannelId = table.Column(type: "integer", nullable: false), StartTime = table.Column(type: "integer", nullable: false), EndTime = table.Column(type: "integer", nullable: false), TimeZone = table.Column(type: "integer", nullable: false), Rate = table.Column(type: "numeric", nullable: false), Extended = table.Column(type: "text", nullable: false), Status = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_CurrencyChannelRelations", x => x.Id); }); migrationBuilder.CreateTable( name: "Languages", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "varchar(50)", nullable: false), Title = table.Column(type: "varchar(50)", nullable: false), Culture = table.Column(type: "varchar(25)", nullable: false), FlagImage = table.Column(type: "varchar(255)", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), ResourceVersion = table.Column(type: "varchar(25)", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Languages", x => x.Id); }); migrationBuilder.CreateTable( name: "LocaleResources", columns: table => new { Id = table.Column(type: "bigint", nullable: false), LanguageId = table.Column(type: "integer", nullable: false), Name = table.Column(type: "varchar(255)", nullable: false), Value = table.Column(type: "varchar(1000)", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_LocaleResources", x => x.Id); }); migrationBuilder.CreateTable( name: "LocalizedProperties", columns: table => new { Id = table.Column(type: "bigint", nullable: false), LanguageNumber = table.Column(type: "integer", nullable: false), Type = table.Column(type: "integer", nullable: false), EntityId = table.Column(type: "bigint", nullable: false), Key = table.Column(type: "varchar(255)", nullable: false), Value = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_LocalizedProperties", x => x.Id); }); migrationBuilder.CreateTable( name: "Menus", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Type = table.Column(type: "integer", nullable: false), ParentId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(50)", nullable: false), Icon = table.Column(type: "varchar(255)", nullable: false), Key = table.Column(type: "varchar(50)", nullable: false), Url = table.Column(type: "varchar(255)", nullable: false), Code = table.Column(type: "varchar(50)", nullable: false), IsLink = table.Column(type: "boolean", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), Depth = table.Column(type: "integer", nullable: false), Path = table.Column(type: "varchar(100)", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Menus", x => x.Id); }); migrationBuilder.CreateTable( name: "MessageTemplates", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Type = table.Column(type: "integer", nullable: false), Key = table.Column(type: "varchar(64)", nullable: false), Name = table.Column(type: "varchar(256)", nullable: false), Title = table.Column(type: "varchar(256)", nullable: false), Body = table.Column(type: "text", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_MessageTemplates", x => x.Id); }); migrationBuilder.CreateTable( name: "PaymentChannels", columns: table => new { Id = table.Column(type: "integer", nullable: false), Type = table.Column(type: "integer", nullable: false), Network = table.Column(type: "integer", nullable: false), Name = table.Column(type: "varchar(20)", nullable: false), Title = table.Column(type: "varchar(20)", nullable: false), Description = table.Column(type: "varchar(512)", nullable: false), Account = table.Column(type: "varchar(255)", nullable: false), Config = table.Column(type: "text", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), Status = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_PaymentChannels", x => x.Id); }); migrationBuilder.CreateTable( name: "Permissions", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(128)", nullable: false), Description = table.Column(type: "varchar(255)", nullable: false), Category = table.Column(type: "varchar(128)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Permissions", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductAttributeCombinations", columns: table => new { Id = table.Column(type: "bigint", nullable: false), ProductId = table.Column(type: "bigint", nullable: false), CorporationId = table.Column(type: "bigint", nullable: false), ManufacturerId = table.Column(type: "bigint", nullable: false), AttributesJson = table.Column(type: "text", nullable: false), StockQuantity = table.Column(type: "integer", nullable: false), SalesQuantity = table.Column(type: "integer", nullable: false), SkuNumber = table.Column(type: "varchar(20)", nullable: false), Weight = table.Column(type: "numeric(18,4)", nullable: false), WeightUnit = table.Column(type: "integer", nullable: false), ProcessCharge = table.Column(type: "numeric(18,4)", nullable: false), ProcessCost = table.Column(type: "numeric(18,4)", nullable: false), Surcharge = table.Column(type: "numeric(18,4)", nullable: false), SurchargeCost = table.Column(type: "numeric(18,4)", nullable: false), MarketPrice = table.Column(type: "numeric(18,4)", nullable: false), Price = table.Column(type: "numeric(18,4)", nullable: false), Mark = table.Column(type: "integer", nullable: false), Note = table.Column(type: "varchar(255)", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ProductAttributeCombinations", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductAttributeOptions", columns: table => new { Id = table.Column(type: "bigint", nullable: false), AttributeId = table.Column(type: "bigint", nullable: false), Value = table.Column(type: "varchar(50)", nullable: false), Count = table.Column(type: "integer", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), Standard = table.Column(type: "boolean", nullable: false), Status = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ProductAttributeOptions", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductAttributeRelations", columns: table => new { Id = table.Column(type: "bigint", nullable: false), ProductId = table.Column(type: "bigint", nullable: false), AttributeId = table.Column(type: "bigint", nullable: false), Image = table.Column(type: "boolean", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProductAttributeRelations", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductAttributes", columns: table => new { Id = table.Column(type: "bigint", nullable: false), CategoryId = table.Column(type: "bigint", nullable: false), ParentId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(50)", nullable: false), WeightIsRequired = table.Column(type: "boolean", nullable: false), WeightUnit = table.Column(type: "integer", nullable: false), ControlType = table.Column(type: "integer", nullable: false), Count = table.Column(type: "integer", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), IsRequired = table.Column(type: "boolean", nullable: false), Status = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ProductAttributes", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductAttributeValues", columns: table => new { Id = table.Column(type: "bigint", nullable: false), ProductId = table.Column(type: "bigint", nullable: false), OptionId = table.Column(type: "bigint", nullable: false), ProductAttributeRelationId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(50)", nullable: false), Image = table.Column(type: "varchar(255)", nullable: false), Weight = table.Column(type: "numeric(18,4)", nullable: false), WeightUnit = table.Column(type: "integer", nullable: false), IsAddWeight = table.Column(type: "boolean", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProductAttributeValues", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductInventories", columns: table => new { Id = table.Column(type: "bigint", nullable: false), CorporationId = table.Column(type: "bigint", nullable: false), ProductId = table.Column(type: "bigint", nullable: false), ProductAttributeCombinationId = table.Column(type: "bigint", nullable: false), WarehouseId = table.Column(type: "bigint", nullable: false), StockQuantity = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ProductInventories", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductInventoryLogs", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Operator = table.Column(type: "bigint", nullable: true), Type = table.Column(type: "integer", nullable: true), ProductId = table.Column(type: "bigint", nullable: false), StoreId = table.Column(type: "bigint", nullable: false), CorporationId = table.Column(type: "bigint", nullable: false), ManufacturerId = table.Column(type: "bigint", nullable: false), WarehouseId = table.Column(type: "bigint", nullable: false), ProductAttributeCombinationId = table.Column(type: "bigint", nullable: false), OrderId = table.Column(type: "bigint", nullable: false), ChangeAmount = table.Column(type: "integer", nullable: false), Weight = table.Column(type: "numeric(18,4)", nullable: false), BeforeStock = table.Column(type: "integer", nullable: false), AfterStock = table.Column(type: "integer", nullable: false), Note = table.Column(type: "varchar(255)", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProductInventoryLogs", x => x.Id); }); migrationBuilder.CreateTable( name: "Products", columns: table => new { Id = table.Column(type: "bigint", nullable: false), CorporationStaffId = table.Column(type: "bigint", nullable: false), CorporationId = table.Column(type: "bigint", nullable: false), StoreId = table.Column(type: "bigint", nullable: false), ProductTypeId = table.Column(type: "bigint", nullable: false), CategoryPath = table.Column(type: "varchar(200)", nullable: true), CategoryId = table.Column(type: "bigint", nullable: false), ManufacturerId = table.Column(type: "bigint", nullable: false), Title = table.Column(type: "varchar(255)", nullable: false), SIN = table.Column(type: "varchar(20)", nullable: true), Image = table.Column(type: "varchar(256)", nullable: true), Photos = table.Column(type: "text", nullable: true), Feature = table.Column(type: "varchar(255)", nullable: true), Description = table.Column(type: "varchar(255)", nullable: true), SpecificationJson = table.Column(type: "text", nullable: true), Weight = table.Column(type: "numeric(6,2)", nullable: true), MinWeight = table.Column(type: "numeric(6,2)", nullable: true), MaxWeight = table.Column(type: "numeric(6,2)", nullable: true), MarketPrice = table.Column(type: "numeric(18,4)", nullable: false), Price = table.Column(type: "numeric(18,4)", nullable: false), SkuPrices = table.Column(type: "text", nullable: true), Extended = table.Column(type: "text", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), ReviewStatus = table.Column(type: "integer", nullable: false), InventoryMethod = table.Column(type: "integer", nullable: false), StockQuantity = table.Column(type: "integer", nullable: false), SalesQuantity = table.Column(type: "integer", nullable: false), PictureCount = table.Column(type: "integer", nullable: false), Status = table.Column(type: "integer", nullable: false), Deleted = table.Column(type: "boolean", nullable: false), DeletedTime = table.Column(type: "timestamptz", nullable: true), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Products", x => x.Id); }); migrationBuilder.CreateTable( name: "RefreshTokens", columns: table => new { Id = table.Column(type: "text", nullable: false), UserId = table.Column(type: "bigint", nullable: false), Token = table.Column(type: "varchar(500)", nullable: false), IssuedTime = table.Column(type: "timestamp with time zone", nullable: false), ExpiresTime = table.Column(type: "timestamp with time zone", nullable: false), IsRevoked = table.Column(type: "boolean", nullable: false), RevokedTime = table.Column(type: "timestamptz", nullable: false), Ip = table.Column(type: "varchar(50)", nullable: false), UserAgent = table.Column(type: "varchar(500)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RefreshTokens", x => x.Id); }); migrationBuilder.CreateTable( name: "Roles", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Type = table.Column(type: "integer", nullable: false), Name = table.Column(type: "text", nullable: false), Description = table.Column(type: "varchar(255)", nullable: false), Permission = table.Column(type: "text", nullable: false), IsSystemRole = table.Column(type: "boolean", nullable: false), Count = table.Column(type: "integer", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Roles", x => x.Id); }); migrationBuilder.CreateTable( name: "Settings", columns: table => new { Id = table.Column(type: "bigint", nullable: false), SiteId = table.Column(type: "bigint", nullable: false), Key = table.Column(type: "varchar(64)", nullable: false), Type = table.Column(type: "integer", nullable: false), Name = table.Column(type: "varchar(64)", nullable: false), Content = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Settings", x => x.Id); }); migrationBuilder.CreateTable( name: "SiteApps", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Type = table.Column(type: "integer", nullable: false), Name = table.Column(type: "varchar(64)", nullable: false), Enabled = table.Column(type: "boolean", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_SiteApps", x => x.Id); }); migrationBuilder.CreateTable( name: "SpecificationAttributeOptions", columns: table => new { Id = table.Column(type: "bigint", nullable: false), SpecificationId = table.Column(type: "bigint", nullable: false), Value = table.Column(type: "varchar(50)", nullable: false), Count = table.Column(type: "integer", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), Status = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_SpecificationAttributeOptions", x => x.Id); }); migrationBuilder.CreateTable( name: "SpecificationAttributes", columns: table => new { Id = table.Column(type: "bigint", nullable: false), CategoryId = table.Column(type: "bigint", nullable: false), ParentId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(50)", nullable: false), ControlType = table.Column(type: "integer", nullable: false), Count = table.Column(type: "integer", nullable: false), DisplayOrder = table.Column(type: "integer", nullable: false), Status = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_SpecificationAttributes", x => x.Id); }); migrationBuilder.CreateTable( name: "UploadFiles", columns: table => new { Id = table.Column(type: "bigint", nullable: false), SiteId = table.Column(type: "bigint", nullable: false), Type = table.Column(type: "integer", nullable: false), Name = table.Column(type: "varchar(64)", nullable: false), Path = table.Column(type: "varchar(128)", nullable: false), Extension = table.Column(type: "varchar(12)", nullable: false), ContentType = table.Column(type: "varchar(32)", nullable: false), SHA256Hash = table.Column(type: "varchar(128)", nullable: false), Size = table.Column(type: "integer", nullable: false), CreateUid = table.Column(type: "bigint", nullable: false), CreateBy = table.Column(type: "varchar(32)", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_UploadFiles", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "varchar(64)", nullable: false), Email = table.Column(type: "varchar(128)", nullable: false), Mobile = table.Column(type: "varchar(32)", nullable: false), Avatar = table.Column(type: "varchar(64)", nullable: false), Password = table.Column(type: "varchar(32)", nullable: false), IsActive = table.Column(type: "boolean", nullable: false), EmailConfirmed = table.Column(type: "boolean", nullable: false), LockoutEndTime = table.Column(type: "timestamptz", nullable: true), FailedLoginAttempts = table.Column(type: "integer", nullable: false), CreateTime = table.Column(type: "timestamptz", nullable: false), UpdateTime = table.Column(type: "timestamptz", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Addresses"); migrationBuilder.DropTable( name: "Admins"); migrationBuilder.DropTable( name: "AppVersions"); migrationBuilder.DropTable( name: "Areas"); migrationBuilder.DropTable( name: "Categories"); migrationBuilder.DropTable( name: "Currencies"); migrationBuilder.DropTable( name: "CurrencyChannelRelations"); migrationBuilder.DropTable( name: "Languages"); migrationBuilder.DropTable( name: "LocaleResources"); migrationBuilder.DropTable( name: "LocalizedProperties"); migrationBuilder.DropTable( name: "Menus"); migrationBuilder.DropTable( name: "MessageTemplates"); migrationBuilder.DropTable( name: "PaymentChannels"); migrationBuilder.DropTable( name: "Permissions"); migrationBuilder.DropTable( name: "ProductAttributeCombinations"); migrationBuilder.DropTable( name: "ProductAttributeOptions"); migrationBuilder.DropTable( name: "ProductAttributeRelations"); migrationBuilder.DropTable( name: "ProductAttributes"); migrationBuilder.DropTable( name: "ProductAttributeValues"); migrationBuilder.DropTable( name: "ProductInventories"); migrationBuilder.DropTable( name: "ProductInventoryLogs"); migrationBuilder.DropTable( name: "Products"); migrationBuilder.DropTable( name: "RefreshTokens"); migrationBuilder.DropTable( name: "Roles"); migrationBuilder.DropTable( name: "Settings"); migrationBuilder.DropTable( name: "SiteApps"); migrationBuilder.DropTable( name: "SpecificationAttributeOptions"); migrationBuilder.DropTable( name: "SpecificationAttributes"); migrationBuilder.DropTable( name: "UploadFiles"); migrationBuilder.DropTable( name: "Users"); } } }