@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
!define ForeignTable(name,desc) class name as "desc" << (T,#ada6a6) >>
!define TranslationTable(name,desc) class name as "desc" << (I,#4286f4) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
' other tags available:
' <i></i>
' <back:COLOR></color>, where color is a color name or html color code
' (#FFAACC)
' see: http://plantuml.com/classes.html#More
hide methods
hide stereotypes
hide empty members
skinparam backgroundColor #FFFFFF

' entities

Table(ShopwareCoreContentProductProductDefinition, "product\n(Product)") {
   primary_key(id) id
   primary_key(versionId) version
   parentId parentFk
   not_null(parentVersionId) referenceVersion
   blacklistIds blacklistRule
   whitelistIds whitelistRule
   autoIncrement int
   active bool
   stock int
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
   not_null(manufacturerId) foreignKey
   not_null(productManufacturerVersionId) referenceVersion
   unitId foreignKey
   not_null(taxId) foreignKey
   coverId foreignKey
   productMediaVersionId referenceVersion
   not_null(price) price
   listingPrices priceRulesJson
   manufacturerNumber string
   ean string
   productNumber numberRange
   isCloseout bool
   minStock int
   purchaseSteps int
   maxPurchase int
   minPurchase int
   purchaseUnit float
   referenceUnit float
   shippingFree bool
   purchasePrice float
   markAsTopseller bool
   sales int
   position int
   weight float
   width float
   height float
   length float
   allowNotification bool
   releaseDate date
   categoryTree list
   datasheetIds list
   variationIds list
   minDeliveryTime int
   maxDeliveryTime int
   restockTime int
   additionalText translated
   name translated
   keywords translated
   description translated
   descriptionLong translated
   metaTitle translated
   packUnit translated
   attributes translated
}
Table(ShopwareCoreContentProductAggregateProductCategoryProductCategoryDefinition, "product_category\n(M:N Mapping)") {
   primary_key(productId) foreignKey
   primary_key(productVersionId) referenceVersion
   primary_key(categoryId) foreignKey
   primary_key(categoryVersionId) referenceVersion
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
}
Table(ShopwareCoreContentProductAggregateProductTagProductTagDefinition, "product_tag\n(M:N Mapping)") {
   primary_key(productId) foreignKey
   primary_key(productVersionId) referenceVersion
   primary_key(tagId) foreignKey
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
}
Table(ShopwareCoreContentProductAggregateProductConfiguratorProductConfiguratorDefinition, "product_configurator\n(The root product configurator.)") {
   primary_key(id) id
   primary_key(versionId) version
   not_null(productId) foreignKey
   not_null(productVersionId) referenceVersion
   not_null(optionId) foreignKey
   price price
   prices priceRulesJson
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
   attributes attributes
}
Table(ShopwareCoreContentProductAggregateProductPriceRuleProductPriceRuleDefinition, "product_price_rule\n(Staggered pricing)") {
   primary_key(id) id
   primary_key(versionId) version
   not_null(productId) foreignKey
   not_null(productVersionId) referenceVersion
   not_null(currencyId) foreignKey
   not_null(ruleId) foreignKey
   not_null(price) price
   not_null(quantityStart) int
   quantityEnd int
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
   attributes attributes
}
Table(ShopwareCoreContentProductAggregateProductDatasheetProductDatasheetDefinition, "product_datasheet\n(M:N Mapping)") {
   primary_key(productId) foreignKey
   not_null(productVersionId) referenceVersion
   primary_key(optionId) foreignKey
}
Table(ShopwareCoreContentProductAggregateProductManufacturerProductManufacturerDefinition, "product_manufacturer\n(Manufacturer)") {
   primary_key(id) id
   primary_key(versionId) version
   mediaId foreignKey
   link string
   not_null(updatedAt) updatedAt
   not_null(createdAt) createdAt
   name translated
   description translated
   metaTitle translated
   metaDescription translated
   metaKeywords translated
   attributes translated
}
TranslationTable(ShopwareCoreContentProductAggregateProductManufacturerTranslationProductManufacturerTranslationDefinition, "product_manufacturer_translation\n((Translations))") {
   not_null(name) string
   description longText
   metaTitle string
   metaDescription string
   metaKeywords string
   attributes attributes
   primary_key(productManufacturerId) foreignKey
   primary_key(languageId) foreignKey
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
   primary_key(productManufacturerVersionId) referenceVersion
}
Table(ShopwareCoreContentProductAggregateProductMediaProductMediaDefinition, "product_media\n(Product media/images)") {
   primary_key(id) id
   primary_key(versionId) version
   not_null(productId) foreignKey
   not_null(productVersionId) referenceVersion
   not_null(mediaId) foreignKey
   position int
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
   attributes attributes
}
TranslationTable(ShopwareCoreContentProductAggregateProductTranslationProductTranslationDefinition, "product_translation\n((Translations))") {
   additionalText string
   name string
   keywords longText
   description longText
   descriptionLong longTextWithHtml
   metaTitle string
   packUnit string
   attributes attributes
   primary_key(productId) foreignKey
   primary_key(languageId) foreignKey
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
   primary_key(productVersionId) referenceVersion
}
Table(ShopwareCoreContentProductAggregateProductVariationProductVariationDefinition, "product_variation\n(M:N Mapping)") {
   primary_key(productId) foreignKey
   not_null(productVersionId) referenceVersion
   primary_key(optionId) foreignKey
}
Table(ShopwareCoreContentProductAggregateProductCategoryTreeProductCategoryTreeDefinition, "product_category_tree\n(M:N Mapping)") {
   primary_key(productId) foreignKey
   primary_key(productVersionId) referenceVersion
   primary_key(categoryId) foreignKey
   primary_key(categoryVersionId) referenceVersion
}
Table(ShopwareCoreContentProductAggregateProductVisibilityProductVisibilityDefinition, "product_visibility\n(Visibility in sales channels)") {
   primary_key(id) id
   not_null(productId) foreignKey
   not_null(productVersionId) referenceVersion
   not_null(salesChannelId) foreignKey
   not_null(visibility) int
   not_null(createdAt) createdAt
   not_null(updatedAt) updatedAt
}
ForeignTable(ShopwareCoreSystemTaxTaxDefinition, "tax") {
}
ForeignTable(ShopwareCoreSystemUnitUnitDefinition, "unit") {
}
ForeignTable(ShopwareCoreContentProductAggregateProductServiceProductServiceDefinition, "product_service") {
}
ForeignTable(ShopwareCoreFrameworkSearchSearchDocumentDefinition, "search_document") {
}
ForeignTable(ShopwareStorefrontFrameworkSeoSeoUrlDefinition, "seo_url") {
}
ForeignTable(ShopwareCoreContentCategoryCategoryDefinition, "category") {
}
ForeignTable(ShopwareCoreFrameworkTagTagDefinition, "tag") {
}
ForeignTable(ShopwareCoreContentConfigurationAggregateConfigurationGroupOptionConfigurationGroupOptionDefinition, "configuration_group_option") {
}
ForeignTable(ShopwareCoreSystemCurrencyCurrencyDefinition, "currency") {
}
ForeignTable(ShopwareCoreContentRuleRuleDefinition, "rule") {
}
ForeignTable(ShopwareCoreContentMediaMediaDefinition, "media") {
}
ForeignTable(ShopwareCoreSystemLanguageLanguageDefinition, "language") {
}
ForeignTable(ShopwareCoreSystemSalesChannelSalesChannelDefinition, "sales_channel") {
}

' relationshipd

ShopwareCoreContentProductProductDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductProductDefinition --> ShopwareCoreSystemTaxTaxDefinition
ShopwareCoreContentProductAggregateProductManufacturerProductManufacturerDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductProductDefinition --> ShopwareCoreSystemUnitUnitDefinition
ShopwareCoreContentProductAggregateProductMediaProductMediaDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductAggregateProductPriceRuleProductPriceRuleDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductProductDefinition --> ShopwareCoreContentProductAggregateProductServiceProductServiceDefinition
ShopwareCoreContentProductAggregateProductDatasheetProductDatasheetDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductAggregateProductCategoryProductCategoryDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductAggregateProductTagProductTagDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductProductDefinition --> ShopwareCoreFrameworkSearchSearchDocumentDefinition
ShopwareCoreContentProductAggregateProductCategoryTreeProductCategoryTreeDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductAggregateProductTranslationProductTranslationDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductAggregateProductConfiguratorProductConfiguratorDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductAggregateProductVariationProductVariationDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductAggregateProductVisibilityProductVisibilityDefinition --> ShopwareCoreContentProductProductDefinition
ShopwareCoreContentProductProductDefinition --> ShopwareStorefrontFrameworkSeoSeoUrlDefinition
ShopwareCoreContentProductAggregateProductCategoryProductCategoryDefinition --> ShopwareCoreContentCategoryCategoryDefinition
ShopwareCoreContentProductAggregateProductTagProductTagDefinition --> ShopwareCoreFrameworkTagTagDefinition
ShopwareCoreContentProductAggregateProductConfiguratorProductConfiguratorDefinition --> ShopwareCoreContentConfigurationAggregateConfigurationGroupOptionConfigurationGroupOptionDefinition
ShopwareCoreContentProductAggregateProductPriceRuleProductPriceRuleDefinition --> ShopwareCoreSystemCurrencyCurrencyDefinition
ShopwareCoreContentProductAggregateProductPriceRuleProductPriceRuleDefinition --> ShopwareCoreContentRuleRuleDefinition
ShopwareCoreContentProductAggregateProductDatasheetProductDatasheetDefinition --> ShopwareCoreContentConfigurationAggregateConfigurationGroupOptionConfigurationGroupOptionDefinition
ShopwareCoreContentProductAggregateProductManufacturerProductManufacturerDefinition --> ShopwareCoreContentMediaMediaDefinition
ShopwareCoreContentProductAggregateProductManufacturerTranslationProductManufacturerTranslationDefinition --> ShopwareCoreContentProductAggregateProductManufacturerProductManufacturerDefinition
ShopwareCoreContentProductAggregateProductManufacturerTranslationProductManufacturerTranslationDefinition --> ShopwareCoreSystemLanguageLanguageDefinition
ShopwareCoreContentProductAggregateProductMediaProductMediaDefinition --> ShopwareCoreContentMediaMediaDefinition
ShopwareCoreContentProductAggregateProductTranslationProductTranslationDefinition --> ShopwareCoreSystemLanguageLanguageDefinition
ShopwareCoreContentProductAggregateProductVariationProductVariationDefinition --> ShopwareCoreContentConfigurationAggregateConfigurationGroupOptionConfigurationGroupOptionDefinition
ShopwareCoreContentProductAggregateProductCategoryTreeProductCategoryTreeDefinition --> ShopwareCoreContentCategoryCategoryDefinition
ShopwareCoreContentProductAggregateProductVisibilityProductVisibilityDefinition --> ShopwareCoreSystemSalesChannelSalesChannelDefinition
@enduml
