using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace AMREZ.EOP.Infrastructures.Migrations { /// public partial class AddProductMasterData : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "master"); migrationBuilder.CreateTable( name: "allergens", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_allergens", x => x.Id); table.UniqueConstraint("AK_allergens_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_allergens_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_allergens_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "brands", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), ExternalRef = table.Column(type: "text", nullable: true), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_brands", x => x.Id); table.UniqueConstraint("AK_brands_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_brands_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_brands_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "categories", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), ParentId = table.Column(type: "uuid", nullable: true), Path = table.Column(type: "text", nullable: true), SortOrder = table.Column(type: "integer", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_categories", x => x.Id); table.UniqueConstraint("AK_categories_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_categories_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_categories_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_categories_categories_tenant_id_ParentId", columns: x => new { x.tenant_id, x.ParentId }, principalSchema: "master", principalTable: "categories", principalColumns: new[] { "tenant_id", "Id" }, onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "compliance_statuses", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_compliance_statuses", x => x.Id); table.UniqueConstraint("AK_compliance_statuses_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_compliance_statuses_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_compliance_statuses_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "countries", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_countries", x => x.Id); table.UniqueConstraint("AK_countries_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_countries_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_countries_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "currencies", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Exponent = table.Column(type: "smallint", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_currencies", x => x.Id); table.UniqueConstraint("AK_currencies_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_currencies_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_currencies_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "doc_control_statuses", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_doc_control_statuses", x => x.Id); table.UniqueConstraint("AK_doc_control_statuses_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_doc_control_statuses_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_doc_control_statuses_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "func_tests", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_func_tests", x => x.Id); table.UniqueConstraint("AK_func_tests_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_func_tests_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_func_tests_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "hazard_classes", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_hazard_classes", x => x.Id); table.UniqueConstraint("AK_hazard_classes_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_hazard_classes_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_hazard_classes_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "languages", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_languages", x => x.Id); table.UniqueConstraint("AK_languages_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_languages_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_languages_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "manufacturers", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), CountryCode = table.Column(type: "text", nullable: true), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_manufacturers", x => x.Id); table.UniqueConstraint("AK_manufacturers_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_manufacturers_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_manufacturers_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "markets", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_markets", x => x.Id); table.UniqueConstraint("AK_markets_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_markets_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_markets_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "packing_groups", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_packing_groups", x => x.Id); table.UniqueConstraint("AK_packing_groups_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_packing_groups_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_packing_groups_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "qa_stages", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_qa_stages", x => x.Id); table.UniqueConstraint("AK_qa_stages_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_qa_stages_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_qa_stages_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "qc_statuses", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_qc_statuses", x => x.Id); table.UniqueConstraint("AK_qc_statuses_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_qc_statuses_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_qc_statuses_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "recall_classes", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_recall_classes", x => x.Id); table.UniqueConstraint("AK_recall_classes_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_recall_classes_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_recall_classes_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "risk_classes", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_risk_classes", x => x.Id); table.UniqueConstraint("AK_risk_classes_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_risk_classes_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_risk_classes_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "routes", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_routes", x => x.Id); table.UniqueConstraint("AK_routes_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_routes_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_routes_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "rx_schedules", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_rx_schedules", x => x.Id); table.UniqueConstraint("AK_rx_schedules_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_rx_schedules_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_rx_schedules_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "species", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_species", x => x.Id); table.UniqueConstraint("AK_species_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_species_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_species_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "stability_statuses", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_stability_statuses", x => x.Id); table.UniqueConstraint("AK_stability_statuses_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_stability_statuses_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_stability_statuses_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "sterilization_methods", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_sterilization_methods", x => x.Id); table.UniqueConstraint("AK_sterilization_methods_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_sterilization_methods_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_sterilization_methods_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "uoms", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), BaseCode = table.Column(type: "text", nullable: true), SiFactor = table.Column(type: "numeric", nullable: true), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_uoms", x => x.Id); table.UniqueConstraint("AK_uoms_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_uoms_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_uoms_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "vvms", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), Scope = table.Column(type: "text", nullable: false, defaultValue: "global"), Code = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), NameI18n = table.Column(type: "jsonb", nullable: true), OverridesGlobalId = table.Column(type: "uuid", nullable: true), IsActive = table.Column(type: "boolean", nullable: false, defaultValue: true), IsSystem = table.Column(type: "boolean", nullable: false, defaultValue: false), Meta = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_vvms", x => x.Id); table.UniqueConstraint("AK_vvms_tenant_id_Id", x => new { x.tenant_id, x.Id }); table.CheckConstraint("ck_vvms_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_vvms_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); }); migrationBuilder.CreateTable( name: "allergen_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_allergen_blocks", x => x.Id); table.CheckConstraint("ck_allergen_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_allergen_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_allergen_blocks_allergens_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "allergens", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "brand_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_brand_blocks", x => x.Id); table.CheckConstraint("ck_brand_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_brand_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_brand_blocks_brands_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "brands", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "category_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_category_blocks", x => x.Id); table.CheckConstraint("ck_category_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_category_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_category_blocks_categories_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "categories", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "category_exts", schema: "master", columns: table => new { CategoryId = table.Column(type: "uuid", nullable: false), Slug = table.Column(type: "text", nullable: true), SeoTitle = table.Column(type: "text", nullable: true), SeoDescription = table.Column(type: "text", nullable: true), ImageUrl = table.Column(type: "text", nullable: true), ChannelVisibility = table.Column(type: "jsonb", nullable: true), FacetSchema = table.Column(type: "jsonb", nullable: true) }, constraints: table => { table.PrimaryKey("PK_category_exts", x => x.CategoryId); table.ForeignKey( name: "FK_category_exts_categories_CategoryId", column: x => x.CategoryId, principalSchema: "master", principalTable: "categories", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "compliance_status_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_compliance_status_blocks", x => x.Id); table.CheckConstraint("ck_compliance_status_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_compliance_status_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_compliance_status_blocks_compliance_statuses_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "compliance_statuses", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "country_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_country_blocks", x => x.Id); table.CheckConstraint("ck_country_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_country_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_country_blocks_countries_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "countries", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "currency_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_currency_blocks", x => x.Id); table.CheckConstraint("ck_currency_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_currency_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_currency_blocks_currencies_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "currencies", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "doc_control_status_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_doc_control_status_blocks", x => x.Id); table.CheckConstraint("ck_doc_control_status_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_doc_control_status_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_doc_control_status_blocks_doc_control_statuses_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "doc_control_statuses", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "func_test_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_func_test_blocks", x => x.Id); table.CheckConstraint("ck_func_test_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_func_test_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_func_test_blocks_func_tests_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "func_tests", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "hazard_class_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_hazard_class_blocks", x => x.Id); table.CheckConstraint("ck_hazard_class_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_hazard_class_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_hazard_class_blocks_hazard_classes_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "hazard_classes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "language_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_language_blocks", x => x.Id); table.CheckConstraint("ck_language_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_language_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_language_blocks_languages_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "languages", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "manufacturer_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_manufacturer_blocks", x => x.Id); table.CheckConstraint("ck_manufacturer_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_manufacturer_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_manufacturer_blocks_manufacturers_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "manufacturers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "market_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_market_blocks", x => x.Id); table.CheckConstraint("ck_market_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_market_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_market_blocks_markets_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "markets", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "packing_group_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_packing_group_blocks", x => x.Id); table.CheckConstraint("ck_packing_group_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_packing_group_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_packing_group_blocks_packing_groups_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "packing_groups", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "qa_stage_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_qa_stage_blocks", x => x.Id); table.CheckConstraint("ck_qa_stage_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_qa_stage_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_qa_stage_blocks_qa_stages_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "qa_stages", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "qc_status_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_qc_status_blocks", x => x.Id); table.CheckConstraint("ck_qc_status_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_qc_status_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_qc_status_blocks_qc_statuses_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "qc_statuses", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "recall_class_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_recall_class_blocks", x => x.Id); table.CheckConstraint("ck_recall_class_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_recall_class_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_recall_class_blocks_recall_classes_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "recall_classes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "risk_class_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_risk_class_blocks", x => x.Id); table.CheckConstraint("ck_risk_class_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_risk_class_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_risk_class_blocks_risk_classes_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "risk_classes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "route_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_route_blocks", x => x.Id); table.CheckConstraint("ck_route_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_route_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_route_blocks_routes_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "routes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "rx_schedule_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_rx_schedule_blocks", x => x.Id); table.CheckConstraint("ck_rx_schedule_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_rx_schedule_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_rx_schedule_blocks_rx_schedules_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "rx_schedules", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "species_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_species_blocks", x => x.Id); table.CheckConstraint("ck_species_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_species_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_species_blocks_species_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "species", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "stability_status_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_stability_status_blocks", x => x.Id); table.CheckConstraint("ck_stability_status_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_stability_status_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_stability_status_blocks_stability_statuses_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "stability_statuses", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "sterilization_method_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_sterilization_method_blocks", x => x.Id); table.CheckConstraint("ck_sterilization_method_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_sterilization_method_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_sterilization_method_blocks_sterilization_methods_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "sterilization_methods", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "uom_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_uom_blocks", x => x.Id); table.CheckConstraint("ck_uom_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_uom_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_uom_blocks_uoms_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "uoms", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "vvm_blocks", schema: "master", columns: table => new { Id = table.Column(type: "uuid", nullable: false), tenant_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now() at time zone 'utc'"), created_by = table.Column(type: "text", nullable: true), updated_at = table.Column(type: "timestamp with time zone", nullable: true), updated_by = table.Column(type: "text", nullable: true), is_deleted = table.Column(type: "boolean", nullable: false, defaultValue: false), GlobalId = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_vvm_blocks", x => x.Id); table.CheckConstraint("ck_vvm_blocks_tenant_not_null", "tenant_id is not null"); table.CheckConstraint("ck_vvm_blocks_tenant_not_zero", "tenant_id <> '00000000-0000-0000-0000-000000000000'"); table.ForeignKey( name: "FK_vvm_blocks_vvms_GlobalId", column: x => x.GlobalId, principalSchema: "master", principalTable: "vvms", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_allergen_blocks_GlobalId", schema: "master", table: "allergen_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_allergen_blocks_tenant_id", schema: "master", table: "allergen_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_allergen_blocks_tenant_id_GlobalId", schema: "master", table: "allergen_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_allergens_Scope_tenant_id_Code", schema: "master", table: "allergens", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_allergens_tenant_id", schema: "master", table: "allergens", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_brand_blocks_GlobalId", schema: "master", table: "brand_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_brand_blocks_tenant_id", schema: "master", table: "brand_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_brand_blocks_tenant_id_GlobalId", schema: "master", table: "brand_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_brands_Scope_tenant_id_Code", schema: "master", table: "brands", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_brands_tenant_id", schema: "master", table: "brands", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_categories_ParentId", schema: "master", table: "categories", column: "ParentId"); migrationBuilder.CreateIndex( name: "IX_categories_Path", schema: "master", table: "categories", column: "Path"); migrationBuilder.CreateIndex( name: "IX_categories_Scope_tenant_id_Code", schema: "master", table: "categories", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_categories_Scope_tenant_id_SortOrder", schema: "master", table: "categories", columns: new[] { "Scope", "tenant_id", "SortOrder" }); migrationBuilder.CreateIndex( name: "IX_categories_tenant_id", schema: "master", table: "categories", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_categories_tenant_id_ParentId", schema: "master", table: "categories", columns: new[] { "tenant_id", "ParentId" }); migrationBuilder.CreateIndex( name: "IX_category_blocks_GlobalId", schema: "master", table: "category_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_category_blocks_tenant_id", schema: "master", table: "category_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_category_blocks_tenant_id_GlobalId", schema: "master", table: "category_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_compliance_status_blocks_GlobalId", schema: "master", table: "compliance_status_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_compliance_status_blocks_tenant_id", schema: "master", table: "compliance_status_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_compliance_status_blocks_tenant_id_GlobalId", schema: "master", table: "compliance_status_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_compliance_statuses_Scope_tenant_id_Code", schema: "master", table: "compliance_statuses", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_compliance_statuses_tenant_id", schema: "master", table: "compliance_statuses", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_countries_Scope_tenant_id_Code", schema: "master", table: "countries", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_countries_tenant_id", schema: "master", table: "countries", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_country_blocks_GlobalId", schema: "master", table: "country_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_country_blocks_tenant_id", schema: "master", table: "country_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_country_blocks_tenant_id_GlobalId", schema: "master", table: "country_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_currencies_Scope_tenant_id_Code", schema: "master", table: "currencies", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_currencies_tenant_id", schema: "master", table: "currencies", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_currency_blocks_GlobalId", schema: "master", table: "currency_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_currency_blocks_tenant_id", schema: "master", table: "currency_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_currency_blocks_tenant_id_GlobalId", schema: "master", table: "currency_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_doc_control_status_blocks_GlobalId", schema: "master", table: "doc_control_status_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_doc_control_status_blocks_tenant_id", schema: "master", table: "doc_control_status_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_doc_control_status_blocks_tenant_id_GlobalId", schema: "master", table: "doc_control_status_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_doc_control_statuses_Scope_tenant_id_Code", schema: "master", table: "doc_control_statuses", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_doc_control_statuses_tenant_id", schema: "master", table: "doc_control_statuses", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_func_test_blocks_GlobalId", schema: "master", table: "func_test_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_func_test_blocks_tenant_id", schema: "master", table: "func_test_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_func_test_blocks_tenant_id_GlobalId", schema: "master", table: "func_test_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_func_tests_Scope_tenant_id_Code", schema: "master", table: "func_tests", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_func_tests_tenant_id", schema: "master", table: "func_tests", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_hazard_class_blocks_GlobalId", schema: "master", table: "hazard_class_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_hazard_class_blocks_tenant_id", schema: "master", table: "hazard_class_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_hazard_class_blocks_tenant_id_GlobalId", schema: "master", table: "hazard_class_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_hazard_classes_Scope_tenant_id_Code", schema: "master", table: "hazard_classes", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_hazard_classes_tenant_id", schema: "master", table: "hazard_classes", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_language_blocks_GlobalId", schema: "master", table: "language_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_language_blocks_tenant_id", schema: "master", table: "language_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_language_blocks_tenant_id_GlobalId", schema: "master", table: "language_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_languages_Scope_tenant_id_Code", schema: "master", table: "languages", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_languages_tenant_id", schema: "master", table: "languages", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_manufacturer_blocks_GlobalId", schema: "master", table: "manufacturer_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_manufacturer_blocks_tenant_id", schema: "master", table: "manufacturer_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_manufacturer_blocks_tenant_id_GlobalId", schema: "master", table: "manufacturer_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_manufacturers_Scope_tenant_id_Code", schema: "master", table: "manufacturers", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_manufacturers_tenant_id", schema: "master", table: "manufacturers", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_market_blocks_GlobalId", schema: "master", table: "market_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_market_blocks_tenant_id", schema: "master", table: "market_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_market_blocks_tenant_id_GlobalId", schema: "master", table: "market_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_markets_Scope_tenant_id_Code", schema: "master", table: "markets", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_markets_tenant_id", schema: "master", table: "markets", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_packing_group_blocks_GlobalId", schema: "master", table: "packing_group_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_packing_group_blocks_tenant_id", schema: "master", table: "packing_group_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_packing_group_blocks_tenant_id_GlobalId", schema: "master", table: "packing_group_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_packing_groups_Scope_tenant_id_Code", schema: "master", table: "packing_groups", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_packing_groups_tenant_id", schema: "master", table: "packing_groups", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_qa_stage_blocks_GlobalId", schema: "master", table: "qa_stage_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_qa_stage_blocks_tenant_id", schema: "master", table: "qa_stage_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_qa_stage_blocks_tenant_id_GlobalId", schema: "master", table: "qa_stage_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_qa_stages_Scope_tenant_id_Code", schema: "master", table: "qa_stages", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_qa_stages_tenant_id", schema: "master", table: "qa_stages", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_qc_status_blocks_GlobalId", schema: "master", table: "qc_status_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_qc_status_blocks_tenant_id", schema: "master", table: "qc_status_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_qc_status_blocks_tenant_id_GlobalId", schema: "master", table: "qc_status_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_qc_statuses_Scope_tenant_id_Code", schema: "master", table: "qc_statuses", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_qc_statuses_tenant_id", schema: "master", table: "qc_statuses", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_recall_class_blocks_GlobalId", schema: "master", table: "recall_class_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_recall_class_blocks_tenant_id", schema: "master", table: "recall_class_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_recall_class_blocks_tenant_id_GlobalId", schema: "master", table: "recall_class_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_recall_classes_Scope_tenant_id_Code", schema: "master", table: "recall_classes", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_recall_classes_tenant_id", schema: "master", table: "recall_classes", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_risk_class_blocks_GlobalId", schema: "master", table: "risk_class_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_risk_class_blocks_tenant_id", schema: "master", table: "risk_class_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_risk_class_blocks_tenant_id_GlobalId", schema: "master", table: "risk_class_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_risk_classes_Scope_tenant_id_Code", schema: "master", table: "risk_classes", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_risk_classes_tenant_id", schema: "master", table: "risk_classes", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_route_blocks_GlobalId", schema: "master", table: "route_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_route_blocks_tenant_id", schema: "master", table: "route_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_route_blocks_tenant_id_GlobalId", schema: "master", table: "route_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_routes_Scope_tenant_id_Code", schema: "master", table: "routes", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_routes_tenant_id", schema: "master", table: "routes", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_rx_schedule_blocks_GlobalId", schema: "master", table: "rx_schedule_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_rx_schedule_blocks_tenant_id", schema: "master", table: "rx_schedule_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_rx_schedule_blocks_tenant_id_GlobalId", schema: "master", table: "rx_schedule_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_rx_schedules_Scope_tenant_id_Code", schema: "master", table: "rx_schedules", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_rx_schedules_tenant_id", schema: "master", table: "rx_schedules", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_species_Scope_tenant_id_Code", schema: "master", table: "species", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_species_tenant_id", schema: "master", table: "species", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_species_blocks_GlobalId", schema: "master", table: "species_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_species_blocks_tenant_id", schema: "master", table: "species_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_species_blocks_tenant_id_GlobalId", schema: "master", table: "species_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_stability_status_blocks_GlobalId", schema: "master", table: "stability_status_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_stability_status_blocks_tenant_id", schema: "master", table: "stability_status_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_stability_status_blocks_tenant_id_GlobalId", schema: "master", table: "stability_status_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_stability_statuses_Scope_tenant_id_Code", schema: "master", table: "stability_statuses", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_stability_statuses_tenant_id", schema: "master", table: "stability_statuses", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_sterilization_method_blocks_GlobalId", schema: "master", table: "sterilization_method_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_sterilization_method_blocks_tenant_id", schema: "master", table: "sterilization_method_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_sterilization_method_blocks_tenant_id_GlobalId", schema: "master", table: "sterilization_method_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_sterilization_methods_Scope_tenant_id_Code", schema: "master", table: "sterilization_methods", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_sterilization_methods_tenant_id", schema: "master", table: "sterilization_methods", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_uom_blocks_GlobalId", schema: "master", table: "uom_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_uom_blocks_tenant_id", schema: "master", table: "uom_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_uom_blocks_tenant_id_GlobalId", schema: "master", table: "uom_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_uoms_Scope_tenant_id_Code", schema: "master", table: "uoms", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_uoms_tenant_id", schema: "master", table: "uoms", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_vvm_blocks_GlobalId", schema: "master", table: "vvm_blocks", column: "GlobalId"); migrationBuilder.CreateIndex( name: "IX_vvm_blocks_tenant_id", schema: "master", table: "vvm_blocks", column: "tenant_id"); migrationBuilder.CreateIndex( name: "IX_vvm_blocks_tenant_id_GlobalId", schema: "master", table: "vvm_blocks", columns: new[] { "tenant_id", "GlobalId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_vvms_Scope_tenant_id_Code", schema: "master", table: "vvms", columns: new[] { "Scope", "tenant_id", "Code" }, unique: true); migrationBuilder.CreateIndex( name: "IX_vvms_tenant_id", schema: "master", table: "vvms", column: "tenant_id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "allergen_blocks", schema: "master"); migrationBuilder.DropTable( name: "brand_blocks", schema: "master"); migrationBuilder.DropTable( name: "category_blocks", schema: "master"); migrationBuilder.DropTable( name: "category_exts", schema: "master"); migrationBuilder.DropTable( name: "compliance_status_blocks", schema: "master"); migrationBuilder.DropTable( name: "country_blocks", schema: "master"); migrationBuilder.DropTable( name: "currency_blocks", schema: "master"); migrationBuilder.DropTable( name: "doc_control_status_blocks", schema: "master"); migrationBuilder.DropTable( name: "func_test_blocks", schema: "master"); migrationBuilder.DropTable( name: "hazard_class_blocks", schema: "master"); migrationBuilder.DropTable( name: "language_blocks", schema: "master"); migrationBuilder.DropTable( name: "manufacturer_blocks", schema: "master"); migrationBuilder.DropTable( name: "market_blocks", schema: "master"); migrationBuilder.DropTable( name: "packing_group_blocks", schema: "master"); migrationBuilder.DropTable( name: "qa_stage_blocks", schema: "master"); migrationBuilder.DropTable( name: "qc_status_blocks", schema: "master"); migrationBuilder.DropTable( name: "recall_class_blocks", schema: "master"); migrationBuilder.DropTable( name: "risk_class_blocks", schema: "master"); migrationBuilder.DropTable( name: "route_blocks", schema: "master"); migrationBuilder.DropTable( name: "rx_schedule_blocks", schema: "master"); migrationBuilder.DropTable( name: "species_blocks", schema: "master"); migrationBuilder.DropTable( name: "stability_status_blocks", schema: "master"); migrationBuilder.DropTable( name: "sterilization_method_blocks", schema: "master"); migrationBuilder.DropTable( name: "uom_blocks", schema: "master"); migrationBuilder.DropTable( name: "vvm_blocks", schema: "master"); migrationBuilder.DropTable( name: "allergens", schema: "master"); migrationBuilder.DropTable( name: "brands", schema: "master"); migrationBuilder.DropTable( name: "categories", schema: "master"); migrationBuilder.DropTable( name: "compliance_statuses", schema: "master"); migrationBuilder.DropTable( name: "countries", schema: "master"); migrationBuilder.DropTable( name: "currencies", schema: "master"); migrationBuilder.DropTable( name: "doc_control_statuses", schema: "master"); migrationBuilder.DropTable( name: "func_tests", schema: "master"); migrationBuilder.DropTable( name: "hazard_classes", schema: "master"); migrationBuilder.DropTable( name: "languages", schema: "master"); migrationBuilder.DropTable( name: "manufacturers", schema: "master"); migrationBuilder.DropTable( name: "markets", schema: "master"); migrationBuilder.DropTable( name: "packing_groups", schema: "master"); migrationBuilder.DropTable( name: "qa_stages", schema: "master"); migrationBuilder.DropTable( name: "qc_statuses", schema: "master"); migrationBuilder.DropTable( name: "recall_classes", schema: "master"); migrationBuilder.DropTable( name: "risk_classes", schema: "master"); migrationBuilder.DropTable( name: "routes", schema: "master"); migrationBuilder.DropTable( name: "rx_schedules", schema: "master"); migrationBuilder.DropTable( name: "species", schema: "master"); migrationBuilder.DropTable( name: "stability_statuses", schema: "master"); migrationBuilder.DropTable( name: "sterilization_methods", schema: "master"); migrationBuilder.DropTable( name: "uoms", schema: "master"); migrationBuilder.DropTable( name: "vvms", schema: "master"); } } }