using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace MiGu.DB.Migrations.Sqlite { /// /// Sqlite 初始 Schema(平台库全量表)。旧 EnsureCreated 库启动时会先基线本迁移名,再应用后续增量。 /// public partial class InitialPlatform : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "simple_fields", columns: table => new { id = table.Column(type: "TEXT", maxLength: 36, nullable: false), car_type = table.Column(type: "TEXT", maxLength: 64, nullable: false), field_type = table.Column(type: "TEXT", maxLength: 64, nullable: false), key = table.Column(type: "TEXT", maxLength: 128, nullable: false), value = table.Column(type: "TEXT", nullable: false), data_type = table.Column(type: "TEXT", maxLength: 128, nullable: false), chinese = table.Column(type: "TEXT", maxLength: 256, nullable: true), english = table.Column(type: "TEXT", maxLength: 256, nullable: true), other = table.Column(type: "TEXT", maxLength: 512, nullable: false), is_default = table.Column(type: "INTEGER", nullable: false), create_time = table.Column(type: "TEXT", maxLength: 19, nullable: false), update_time = table.Column(type: "TEXT", maxLength: 19, nullable: false) }, constraints: table => { table.PrimaryKey("PK_simple_fields", x => x.id); }); migrationBuilder.CreateTable( name: "user_dashboard_shortcuts", columns: table => new { user_id = table.Column(type: "TEXT", maxLength: 64, nullable: false), scope = table.Column(type: "TEXT", maxLength: 32, nullable: false), keys_json = table.Column(type: "text", nullable: false), updated_at = table.Column(type: "TEXT", maxLength: 40, nullable: false) }, constraints: table => { table.PrimaryKey("PK_user_dashboard_shortcuts", x => new { x.user_id, x.scope }); }); migrationBuilder.CreateTable( name: "wms_areas", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), WarehouseId = table.Column(type: "TEXT", maxLength: 36, nullable: false), Code = table.Column(type: "TEXT", maxLength: 64, nullable: false), Name = table.Column(type: "TEXT", maxLength: 128, nullable: false), Type = table.Column(type: "TEXT", maxLength: 64, nullable: false), LayoutMode = table.Column(type: "TEXT", maxLength: 32, nullable: false), State = table.Column(type: "TEXT", maxLength: 32, nullable: false), Enabled = table.Column(type: "INTEGER", nullable: false), SortOrder = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_areas", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_container_location_history", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), FromLocationType = table.Column(type: "TEXT", maxLength: 32, nullable: false), FromLocationId = table.Column(type: "TEXT", maxLength: 64, nullable: false), ToLocationType = table.Column(type: "TEXT", maxLength: 32, nullable: false), ToLocationId = table.Column(type: "TEXT", maxLength: 64, nullable: false), RelationId = table.Column(type: "TEXT", maxLength: 36, nullable: true), EventType = table.Column(type: "TEXT", maxLength: 64, nullable: false), BeforeJson = table.Column(type: "text", nullable: false), AfterJson = table.Column(type: "text", nullable: false), ContainerId = table.Column(type: "TEXT", maxLength: 36, nullable: true), Operator = table.Column(type: "TEXT", maxLength: 128, nullable: false), OperatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), Source = table.Column(type: "TEXT", maxLength: 32, nullable: false), Reason = table.Column(type: "TEXT", maxLength: 500, nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_container_location_history", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_container_locations", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), ContainerId = table.Column(type: "TEXT", maxLength: 36, nullable: false), LocationType = table.Column(type: "TEXT", maxLength: 32, nullable: false), LocationId = table.Column(type: "TEXT", maxLength: 64, nullable: false), StorageId = table.Column(type: "TEXT", maxLength: 36, nullable: true), LocationCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), LocationName = table.Column(type: "TEXT", maxLength: 128, nullable: false), Status = table.Column(type: "TEXT", maxLength: 32, nullable: false), EnteredAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_container_locations", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_container_material_history", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), MaterialId = table.Column(type: "TEXT", maxLength: 36, nullable: true), QuantityDelta = table.Column(type: "TEXT", precision: 18, scale: 4, nullable: false), RelationId = table.Column(type: "TEXT", maxLength: 36, nullable: true), EventType = table.Column(type: "TEXT", maxLength: 64, nullable: false), BeforeJson = table.Column(type: "text", nullable: false), AfterJson = table.Column(type: "text", nullable: false), ContainerId = table.Column(type: "TEXT", maxLength: 36, nullable: true), Operator = table.Column(type: "TEXT", maxLength: 128, nullable: false), OperatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), Source = table.Column(type: "TEXT", maxLength: 32, nullable: false), Reason = table.Column(type: "TEXT", maxLength: 500, nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_container_material_history", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_container_materials", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), ContainerId = table.Column(type: "TEXT", maxLength: 36, nullable: false), MaterialId = table.Column(type: "TEXT", maxLength: 36, nullable: false), Quantity = table.Column(type: "TEXT", precision: 18, scale: 4, nullable: false), BatchNo = table.Column(type: "TEXT", maxLength: 64, nullable: false), SerialNo = table.Column(type: "TEXT", maxLength: 64, nullable: false), Status = table.Column(type: "TEXT", maxLength: 32, nullable: false), BoundAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), LoadedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UnloadedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_container_materials", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_containers", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), AreaId = table.Column(type: "TEXT", maxLength: 36, nullable: true), Code = table.Column(type: "TEXT", maxLength: 64, nullable: false), Name = table.Column(type: "TEXT", maxLength: 128, nullable: false), ContainerType = table.Column(type: "TEXT", maxLength: 64, nullable: false), Status = table.Column(type: "TEXT", maxLength: 32, nullable: false), Barcode = table.Column(type: "TEXT", maxLength: 128, nullable: false), Length = table.Column(type: "REAL", nullable: false), Width = table.Column(type: "REAL", nullable: false), Height = table.Column(type: "REAL", nullable: false), Enabled = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_containers", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_material_types", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), Code = table.Column(type: "TEXT", maxLength: 64, nullable: false), Name = table.Column(type: "TEXT", maxLength: 128, nullable: false), Spec = table.Column(type: "TEXT", maxLength: 128, nullable: false), Unit = table.Column(type: "TEXT", maxLength: 32, nullable: false), Category = table.Column(type: "TEXT", maxLength: 64, nullable: false), BarcodePrefix = table.Column(type: "TEXT", maxLength: 64, nullable: false), Enabled = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_material_types", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_materials", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), Code = table.Column(type: "TEXT", maxLength: 64, nullable: false), Name = table.Column(type: "TEXT", maxLength: 128, nullable: false), TypeCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), Barcode = table.Column(type: "TEXT", maxLength: 128, nullable: false), Spec = table.Column(type: "TEXT", maxLength: 128, nullable: false), Unit = table.Column(type: "TEXT", maxLength: 32, nullable: false), Category = table.Column(type: "TEXT", maxLength: 64, nullable: false), LifecycleStatus = table.Column(type: "TEXT", maxLength: 32, nullable: false), UnboundAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), Enabled = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_materials", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_stock_events", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), EventType = table.Column(type: "TEXT", maxLength: 32, nullable: false), MaterialId = table.Column(type: "TEXT", maxLength: 36, nullable: true), MaterialCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), MaterialName = table.Column(type: "TEXT", maxLength: 128, nullable: false), MaterialBarcode = table.Column(type: "TEXT", maxLength: 128, nullable: false), MaterialTypeCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), ContainerId = table.Column(type: "TEXT", maxLength: 36, nullable: true), ContainerCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), ContainerName = table.Column(type: "TEXT", maxLength: 128, nullable: false), StorageId = table.Column(type: "TEXT", maxLength: 36, nullable: true), StorageCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), StorageName = table.Column(type: "TEXT", maxLength: 128, nullable: false), AreaCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), FromStorageId = table.Column(type: "TEXT", maxLength: 36, nullable: true), FromStorageCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), FromStorageName = table.Column(type: "TEXT", maxLength: 128, nullable: false), ToStorageId = table.Column(type: "TEXT", maxLength: 36, nullable: true), ToStorageCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), ToStorageName = table.Column(type: "TEXT", maxLength: 128, nullable: false), RefType = table.Column(type: "TEXT", maxLength: 64, nullable: false), RefId = table.Column(type: "TEXT", maxLength: 36, nullable: true), RefCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), Operator = table.Column(type: "TEXT", maxLength: 128, nullable: false), OperatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), Reason = table.Column(type: "TEXT", maxLength: 500, nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_stock_events", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_storages", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), AreaId = table.Column(type: "TEXT", maxLength: 36, nullable: false), Code = table.Column(type: "TEXT", maxLength: 64, nullable: false), Name = table.Column(type: "TEXT", maxLength: 128, nullable: false), StorageType = table.Column(type: "TEXT", maxLength: 64, nullable: false), LocationKind = table.Column(type: "TEXT", maxLength: 32, nullable: false), ColumnNo = table.Column(type: "INTEGER", nullable: false), LevelNo = table.Column(type: "INTEGER", nullable: false), DepthNo = table.Column(type: "INTEGER", nullable: false), SiteId = table.Column(type: "TEXT", maxLength: 64, nullable: false), SiteCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), Barcode = table.Column(type: "TEXT", maxLength: 128, nullable: false), Capacity = table.Column(type: "INTEGER", nullable: false), Status = table.Column(type: "TEXT", maxLength: 32, nullable: false), Usage = table.Column(type: "TEXT", maxLength: 64, nullable: false), Priority = table.Column(type: "INTEGER", nullable: false), ZoneCode = table.Column(type: "TEXT", maxLength: 64, nullable: false), AllowInbound = table.Column(type: "INTEGER", nullable: false), AllowOutbound = table.Column(type: "INTEGER", nullable: false), Enabled = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_storages", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_transport_reservations", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), TaskId = table.Column(type: "TEXT", maxLength: 36, nullable: false), ContainerId = table.Column(type: "TEXT", maxLength: 36, nullable: false), SourceStorageId = table.Column(type: "TEXT", maxLength: 36, nullable: false), TargetStorageId = table.Column(type: "TEXT", maxLength: 36, nullable: false), Status = table.Column(type: "TEXT", maxLength: 32, nullable: false), ExpiresAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_transport_reservations", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_transport_rules", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), Code = table.Column(type: "TEXT", maxLength: 64, nullable: false), Name = table.Column(type: "TEXT", maxLength: 128, nullable: false), TriggerType = table.Column(type: "TEXT", maxLength: 32, nullable: false), Enabled = table.Column(type: "INTEGER", nullable: false), Priority = table.Column(type: "INTEGER", nullable: false), SourceSelectorJson = table.Column(type: "text", nullable: false), TargetSelectorJson = table.Column(type: "text", nullable: false), TaskOptionsJson = table.Column(type: "text", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_transport_rules", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_transport_task_history", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), TaskId = table.Column(type: "TEXT", maxLength: 36, nullable: false), FromStatus = table.Column(type: "TEXT", maxLength: 32, nullable: false), ToStatus = table.Column(type: "TEXT", maxLength: 32, nullable: false), Operator = table.Column(type: "TEXT", maxLength: 128, nullable: false), OperatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), Reason = table.Column(type: "TEXT", maxLength: 500, nullable: false), ErrorMessage = table.Column(type: "TEXT", maxLength: 1000, nullable: false), SnapshotJson = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_transport_task_history", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_transport_tasks", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), BusinessType = table.Column(type: "TEXT", maxLength: 64, nullable: false), RuleId = table.Column(type: "TEXT", maxLength: 36, nullable: true), SourceStorageId = table.Column(type: "TEXT", maxLength: 36, nullable: false), TargetStorageId = table.Column(type: "TEXT", maxLength: 36, nullable: false), ContainerId = table.Column(type: "TEXT", maxLength: 36, nullable: false), MaterialId = table.Column(type: "TEXT", maxLength: 36, nullable: true), Quantity = table.Column(type: "TEXT", precision: 18, scale: 4, nullable: true), Status = table.Column(type: "TEXT", maxLength: 32, nullable: false), DispatchMissionId = table.Column(type: "TEXT", maxLength: 64, nullable: false), DeliveryId = table.Column(type: "TEXT", maxLength: 64, nullable: false), DispatchStatus = table.Column(type: "TEXT", maxLength: 32, nullable: false), Reason = table.Column(type: "TEXT", maxLength: 500, nullable: false), SnapshotJson = table.Column(type: "text", nullable: false), ErrorMessage = table.Column(type: "TEXT", maxLength: 1000, nullable: false), TaskPriority = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_transport_tasks", x => x.Id); }); migrationBuilder.CreateTable( name: "wms_warehouses", columns: table => new { Id = table.Column(type: "TEXT", maxLength: 36, nullable: false), Code = table.Column(type: "TEXT", maxLength: 64, nullable: false), Name = table.Column(type: "TEXT", maxLength: 128, nullable: false), Type = table.Column(type: "TEXT", maxLength: 64, nullable: false), Enabled = table.Column(type: "INTEGER", nullable: false), SortOrder = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), UpdatedAt = table.Column(type: "TEXT", maxLength: 40, nullable: false), CreatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), UpdatedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsDeleted = table.Column(type: "INTEGER", nullable: false), DeletedAt = table.Column(type: "TEXT", maxLength: 40, nullable: true), DeletedBy = table.Column(type: "TEXT", maxLength: 128, nullable: false), Version = table.Column(type: "INTEGER", nullable: false), IsLock = table.Column(type: "INTEGER", nullable: false), Remark = table.Column(type: "TEXT", maxLength: 1000, nullable: false), Extend = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_wms_warehouses", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_simple_fields_car_type_field_type_key", table: "simple_fields", columns: new[] { "car_type", "field_type", "key" }, unique: true); migrationBuilder.CreateIndex( name: "IX_wms_areas_Code", table: "wms_areas", column: "Code", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_areas_WarehouseId", table: "wms_areas", column: "WarehouseId"); migrationBuilder.CreateIndex( name: "IX_wms_container_location_history_ContainerId", table: "wms_container_location_history", column: "ContainerId"); migrationBuilder.CreateIndex( name: "IX_wms_container_location_history_EventType", table: "wms_container_location_history", column: "EventType"); migrationBuilder.CreateIndex( name: "IX_wms_container_location_history_OperatedAt", table: "wms_container_location_history", column: "OperatedAt"); migrationBuilder.CreateIndex( name: "IX_wms_container_locations_ContainerId", table: "wms_container_locations", column: "ContainerId", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_container_locations_LocationType_LocationId", table: "wms_container_locations", columns: new[] { "LocationType", "LocationId" }); migrationBuilder.CreateIndex( name: "IX_wms_container_locations_StorageId", table: "wms_container_locations", column: "StorageId"); migrationBuilder.CreateIndex( name: "IX_wms_container_material_history_ContainerId", table: "wms_container_material_history", column: "ContainerId"); migrationBuilder.CreateIndex( name: "IX_wms_container_material_history_EventType", table: "wms_container_material_history", column: "EventType"); migrationBuilder.CreateIndex( name: "IX_wms_container_material_history_OperatedAt", table: "wms_container_material_history", column: "OperatedAt"); migrationBuilder.CreateIndex( name: "IX_wms_container_materials_ContainerId", table: "wms_container_materials", column: "ContainerId"); migrationBuilder.CreateIndex( name: "IX_wms_container_materials_MaterialId", table: "wms_container_materials", column: "MaterialId", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_containers_Code", table: "wms_containers", column: "Code", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_material_types_Code", table: "wms_material_types", column: "Code", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_materials_Barcode", table: "wms_materials", column: "Barcode"); migrationBuilder.CreateIndex( name: "IX_wms_materials_Code", table: "wms_materials", column: "Code", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_materials_LifecycleStatus_UpdatedAt", table: "wms_materials", columns: new[] { "LifecycleStatus", "UpdatedAt" }); migrationBuilder.CreateIndex( name: "IX_wms_materials_TypeCode", table: "wms_materials", column: "TypeCode"); migrationBuilder.CreateIndex( name: "IX_wms_stock_events_ContainerId", table: "wms_stock_events", column: "ContainerId"); migrationBuilder.CreateIndex( name: "IX_wms_stock_events_EventType", table: "wms_stock_events", column: "EventType"); migrationBuilder.CreateIndex( name: "IX_wms_stock_events_MaterialId", table: "wms_stock_events", column: "MaterialId"); migrationBuilder.CreateIndex( name: "IX_wms_stock_events_OperatedAt", table: "wms_stock_events", column: "OperatedAt"); migrationBuilder.CreateIndex( name: "IX_wms_storages_AreaId", table: "wms_storages", column: "AreaId"); migrationBuilder.CreateIndex( name: "IX_wms_storages_Barcode", table: "wms_storages", column: "Barcode"); migrationBuilder.CreateIndex( name: "IX_wms_storages_Code", table: "wms_storages", column: "Code", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_transport_reservations_ContainerId_Status", table: "wms_transport_reservations", columns: new[] { "ContainerId", "Status" }); migrationBuilder.CreateIndex( name: "IX_wms_transport_reservations_TargetStorageId_Status", table: "wms_transport_reservations", columns: new[] { "TargetStorageId", "Status" }); migrationBuilder.CreateIndex( name: "IX_wms_transport_rules_Code", table: "wms_transport_rules", column: "Code", unique: true); migrationBuilder.CreateIndex( name: "IX_wms_transport_rules_TriggerType_Enabled_Priority", table: "wms_transport_rules", columns: new[] { "TriggerType", "Enabled", "Priority" }); migrationBuilder.CreateIndex( name: "IX_wms_transport_task_history_OperatedAt", table: "wms_transport_task_history", column: "OperatedAt"); migrationBuilder.CreateIndex( name: "IX_wms_transport_task_history_TaskId", table: "wms_transport_task_history", column: "TaskId"); migrationBuilder.CreateIndex( name: "IX_wms_transport_tasks_ContainerId", table: "wms_transport_tasks", column: "ContainerId"); migrationBuilder.CreateIndex( name: "IX_wms_transport_tasks_Status", table: "wms_transport_tasks", column: "Status"); migrationBuilder.CreateIndex( name: "IX_wms_transport_tasks_TargetStorageId", table: "wms_transport_tasks", column: "TargetStorageId"); migrationBuilder.CreateIndex( name: "IX_wms_warehouses_Code", table: "wms_warehouses", column: "Code", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "simple_fields"); migrationBuilder.DropTable( name: "user_dashboard_shortcuts"); migrationBuilder.DropTable( name: "wms_areas"); migrationBuilder.DropTable( name: "wms_container_location_history"); migrationBuilder.DropTable( name: "wms_container_locations"); migrationBuilder.DropTable( name: "wms_container_material_history"); migrationBuilder.DropTable( name: "wms_container_materials"); migrationBuilder.DropTable( name: "wms_containers"); migrationBuilder.DropTable( name: "wms_material_types"); migrationBuilder.DropTable( name: "wms_materials"); migrationBuilder.DropTable( name: "wms_stock_events"); migrationBuilder.DropTable( name: "wms_storages"); migrationBuilder.DropTable( name: "wms_transport_reservations"); migrationBuilder.DropTable( name: "wms_transport_rules"); migrationBuilder.DropTable( name: "wms_transport_task_history"); migrationBuilder.DropTable( name: "wms_transport_tasks"); migrationBuilder.DropTable( name: "wms_warehouses"); } } }