Generated by
prisma-markdown
erDiagram
"Country" {
Int id PK
String name UK
String code UK
Float longitude "nullable"
Float latitude "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
}
"Department" {
Int id PK
String name
String code
Float longitude "nullable"
Float latitude "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int countryId FK
}
"City" {
Int id PK
String name
String zip
Float longitude "nullable"
Float latitude "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int departmentId FK
}
"Address" {
Int id PK
String houseNumber "nullable"
String street
String zip
String otherDetails "nullable"
Float longitude
Float latitude
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int cityId FK
}
"Department" }o--|| "Country" : country
"City" }o--|| "Department" : department
"Address" }o--|| "City" : city
CountryRepresents a country with its geographical details and departments.
Properties
id: The unique identifier for a country.name: The name of the country.code: The ISO code of the country.longitude: The longitude coordinate of the country.latitude: The latitude coordinate of the country.createdAt: The date and time when the country was created.updatedAt: The date and time when the country was last updated.deletedAt: The date and time when the country was deleted.DepartmentRepresents a department within a country, including its geographical details.
Properties
id: The unique identifier for a department.name: The name of the department.code: The code of the department.longitude: The longitude coordinate of the department.latitude: The latitude coordinate of the department.createdAt: The date and time when the department was created.updatedAt: The date and time when the department was last updated.deletedAt: The date and time when the department was deleted.countryId: The ID of the country to which the department belongs.CityRepresents a city within a department, including its geographical details and addresses.
Properties
id: The unique identifier for a city.name: The name of the city.zip: The ZIP code of the city.longitude: The longitude coordinate of the city.latitude: The latitude coordinate of the city.createdAt: The date and time when the city was created.updatedAt: The date and time when the city was last updated.deletedAt: The date and time when the city was deleted.departmentId: The ID of the department to which the city belongs.AddressRepresents an address within a city, including its geographical details.
Properties
id: The unique identifier for an address.houseNumber: The house number of the address.street: The street name of the address.zip: The ZIP code of the address.otherDetails: Additional details about the address.longitude: The longitude coordinate of the address.latitude: The latitude coordinate of the address.createdAt: The date and time when the address was created.updatedAt: The date and time when the address was last updated.deletedAt: The date and time when the address was deleted.cityId: The ID of the city to which the address belongs.
erDiagram
"User" {
Int id PK
String uuid UK
String username UK
String email UK
Boolean emailVerified
String password
String picture "nullable"
String telNumber "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
}
"Profile" {
Int id PK
Role role
Boolean isActive
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int userId FK
}
"Sanctions" {
Int id PK
Int userId FK
SanctionType sanctionType
String reason
Int issuerId FK "nullable"
DateTime sanctionStart
DateTime sanctionEnd "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
}
"Profile" }o--|| "User" : user
"Sanctions" }o--|| "User" : user
"Sanctions" }o--o| "Profile" : issuer
UserRepresents a user in the system, including their profile and authentication details.
Properties
id: The unique identifier for the user.uuid: The universally unique identifier for the user.username: The username of the user.email: The email address of the user.emailVerified: Indicates whether the user’s email is verified.password: The hashed password of the user.picture: The profile picture of the user.telNumber: The telephone number of the user.createdAt: The date and time when the user was created.updatedAt: The date and time when the user was last updated.deletedAt: The date and time when the user was deleted.ProfileRepresents a profile for a user, including personal details and preferences.
Properties
id: The unique identifier for the profile.role: The role of the profile.isActive: Indicates whether the profile is active.createdAt: The date and time when the profile was created.updatedAt: The date and time when the profile was last updated.deletedAt: The date and time when the profile was deleted.userId: The ID of the user associated with the profile.SanctionsRepresents a sanction imposed on a user.
Properties
id: The unique identifier for the sanction.userId: The ID of the user associated with the sanction.sanctionType: The type of the sanction.reason: The reason for the sanction.issuerId: The ID of the profile that issued the sanction.sanctionStart: The start date and time of the sanction.sanctionEnd: The end date and time of the sanction.createdAt: The date and time when the sanction was created.updatedAt: The date and time when the sanction was last updated.deletedAt: The date and time when the sanction was deleted.
erDiagram
"OAuthProviders" {
Int providerId PK
String provider UK
}
"OAuthProviderUser" {
String providerUserId
Int userId FK
Int providerId FK
Int id PK
}
"OAuthProviderUser" }o--|| "OAuthProviders" : provider
OAuthProvidersRepresents the OAuth providers available for authentication.
Properties
providerId: The unique identifier for the OAuth provider.provider: The name of the OAuth provider.OAuthProviderUserRepresents the association between an OAuth provider and a user.
Properties
providerUserId: The unique identifier for the user in the OAuth provider.userId: The unique identifier for the user in the system.providerId: The unique identifier for the OAuth provider.id: The unique identifier for the OAuth provider user association.
erDiagram
"Person" {
Int id PK
String name
String bio "nullable"
PersonType type
String birthDate "nullable"
String deathDate "nullable"
String picture "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
}
PersonRepresents a person in the system.
Properties
id: The unique identifier for the person.name: The name of the person.bio: The biography of the person.type: The type of the person.birthDate: The birth date of the person.deathDate: The death date of the person.picture: The picture of the person.createdAt: The date and time when the person was created.updatedAt: The date and time when the person was last updated.deletedAt: The date and time when the person was deleted.
erDiagram
"ItemCategory" {
Int id PK
String name UK
String description "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
}
"ItemType" {
Int id PK
String name
String description "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int itemCategoryId FK
}
"Item" {
Int id PK
String uuid UK
String name
String description "nullable"
String textToTranslate
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int itemTypeId FK "nullable"
Int relatedPersonId FK "nullable"
Int siteId FK "nullable"
}
"ItemType" }o--|| "ItemCategory" : itemCategory
"Item" }o--o| "ItemType" : itemType
ItemCategoryRepresents a category of items.
Properties
id: The unique identifier for the item category.name: The name of the item category.description: The description of the item category.createdAt: The date and time when the item category was created.updatedAt: The date and time when the item category was last updated.deletedAt: The date and time when the item category was deleted.ItemTypeRepresents a type of item.
Properties
id: The unique identifier for the item type.name: The name of the item type.description: The description of the item type.createdAt: The date and time when the item type was created.updatedAt: The date and time when the item type was last updated.deletedAt: The date and time when the item type was deleted.itemCategoryId: The ID of the item category to which the item type belongs.ItemRepresents an item in the system.
Properties
id: The unique identifier for the item.uuid: The universally unique identifier for the item.name: The name of the item.description: The description of the item.textToTranslate: The text to be translated for the item.createdAt: The date and time when the item was created.updatedAt: The date and time when the item was last updated.deletedAt: The date and time when the item was deleted.itemTypeId: The ID of the item type to which the item belongs.relatedPersonId: The ID of the person related to the item.siteId: The ID of the site where the item is located.
erDiagram
"SignLanguage" {
Int id PK
String uuid UK
String name UK
String code UK
String color
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
}
"Video" {
Int id PK
String uuid UK
Int hostingProviderId FK
String hostingProviderVideoId
ValidationStatus validationStatus
Int duration
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
String deletedReason "nullable"
Int itemId FK
Int profileId FK
Int signLanguageId FK "nullable"
}
"HostingProvider" {
Int id PK
String name UK
String url
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
}
"UserlikesVideos" {
Int id PK
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int userId FK
Int videoId FK
}
"Video" }o--o| "SignLanguage" : signLanguage
"Video" }o--|| "HostingProvider" : hostingProvider
"UserlikesVideos" }o--|| "Video" : video
SignLanguageRepresents a sign language used in videos.
Properties
id: The unique identifier for the sign language.uuid: The universally unique identifier for the sign language.name: The name of the sign language.code: The code of the sign language.color: The color associated with the sign language.createdAt: The date and time when the sign language was created.updatedAt: The date and time when the sign language was last updated.deletedAt: The date and time when the sign language was deleted.VideoRepresents a video in the system.
Properties
id: The unique identifier for the video.uuid: The universally unique identifier for the video.hostingProviderId: The ID of the hosting provider for the video.hostingProviderVideoId: The ID of the video on the hosting provider’s platform.validationStatus: The validation status of the video.duration: The duration of the video in seconds.createdAt: The date and time when the video was created.updatedAt: The date and time when the video was last updated.deletedAt: The date and time when the video was deleted.deletedReason: The reason why the video was deleted.itemId: The ID of the item associated with the video.profileId: The ID of the profile that posted the video.signLanguageId: The ID of the sign language used in the video.HostingProviderRepresents a hosting provider for videos.
Properties
id: The unique identifier for the hosting provider.name: The name of the hosting provider.url: The URL of the hosting provider.createdAt: The date and time when the hosting provider was created.updatedAt: The date and time when the hosting provider was last updated.deletedAt: The date and time when the hosting provider was deleted.UserlikesVideosRepresents the relationship between users and videos they like.
Properties
id: The unique identifier for the user-video like relationship.createdAt: The date and time when the like was created.updatedAt: The date and time when the like was last updated.deletedAt: The date and time when the like was deleted.userId: The ID of the user who liked the video.videoId: The ID of the video that was liked.
erDiagram
"Site" {
Int id PK
String uuid UK
String name
String shortDescription "nullable"
String longDescription "nullable"
String telNumber "nullable"
String email "nullable"
String website "nullable"
Float price
SiteType type
SiteTag tags
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int addressId FK
}
"SiteHasManager" {
Int id PK
Boolean isMain
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int siteId FK
Int profileId FK
}
"SiteHasManager" }o--|| "Site" : site
SiteRepresents a site in the system.
Properties
id: The unique identifier for the site.uuid: The universally unique identifier for the site.name: The name of the site.shortDescription: A short description of the site.longDescription: A long description of the site.telNumber: The telephone number of the site.email: The email address of the site.website: The website of the site.price: The price associated with the site.type: The type of the site.tags: The tags associated with the site.createdAt: The date and time when the site was created.updatedAt: The date and time when the site was last updated.deletedAt: The date and time when the site was deleted.addressId: The ID of the address associated with the site.SiteHasManagerRepresents the relationship between sites and their managers.
Properties
id: The unique identifier for the site-manager relationship.isMain: Indicates whether the manager is the main manager.createdAt: The date and time when the relationship was created.updatedAt: The date and time when the relationship was last updated.deletedAt: The date and time when the relationship was deleted.siteId: The ID of the site.profileId: The ID of the profile managing the site.
erDiagram
"Exhibition" {
Int id PK
String name
String shortDescription "nullable"
String longDescription "nullable"
DateTime startDate "nullable"
DateTime endDate "nullable"
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int siteId FK
}
"ExhibitedItem" {
Int id PK
Int itemId FK
Int exhibitionId FK
}
"ExhibitedItem" }o--|| "Exhibition" : exhibition
ExhibitionRepresents an exhibition in the system.
Properties
id: The unique identifier for the exhibition.name: The name of the exhibition.shortDescription: A short description of the exhibition.longDescription: A long description of the exhibition.startDate: The start date of the exhibition.endDate: The end date of the exhibition.createdAt: The date and time when the exhibition was created.updatedAt: The date and time when the exhibition was last updated.deletedAt: The date and time when the exhibition was deleted.siteId: The ID of the site where the exhibition is held.ExhibitedItemRepresents an item exhibited in an exhibition.
Properties
id: The unique identifier for the exhibited item.itemId: The ID of the item being exhibited.exhibitionId: The ID of the exhibition where the item is exhibited.
erDiagram
"Picture" {
Int id PK
String uuid UK
String localPath "nullable"
String hostingUrl
DateTime createdAt
DateTime updatedAt
DateTime deletedAt "nullable"
Int itemId FK "nullable"
Int siteId FK "nullable"
}
PictureRepresents a picture in the system.
Properties
id: The unique identifier for the picture.uuid: The universally unique identifier for the picture.localPath: The local path of the picture.hostingUrl: The hosting URL of the picture.createdAt: The date and time when the picture was created.updatedAt: The date and time when the picture was last updated.deletedAt: The date and time when the picture was deleted.itemId: The ID of the item associated with the picture.siteId: The ID of the site associated with the picture.
erDiagram
"UserLoginLog" {
Int id PK
DateTime loginTime
Int userId FK
Int providerId FK "nullable"
}
"UserActionLog" {
Int id PK
String action
String object
Int objectId
String details "nullable"
DateTime createdAt
Int profileId FK
}
"SensitiveActionLog" {
Int id PK
String action
String object
Int objectId
String details "nullable"
DateTime createdAt
Int profileId FK
}
UserLoginLogRepresents a log of user login attempts.
Properties
id: The unique identifier for the user login log.loginTime: The date and time when the login attempt occurred.userId: The ID of the user associated with the login attempt.providerId: The ID of the OAuth provider used for the login attempt.UserActionLogRepresents a log of user actions.
Properties
id: The unique identifier for the user action log.action: The action performed by the user.object: The object on which the action was performed.objectId: The ID of the object on which the action was performed.details: Additional details about the action.createdAt: The date and time when the action was logged.profileId: The ID of the profile that performed the action.SensitiveActionLogRepresents a log of sensitive user actions.
Properties
id: The unique identifier for the sensitive action log.action: The sensitive action performed by the user.object: The object on which the sensitive action was performed.objectId: The ID of the object on which the sensitive action was performed.details: Additional details about the sensitive action.createdAt: The date and time when the sensitive action was logged.profileId: The ID of the profile that performed the sensitive action.
erDiagram
"RoleColor" {
Int id PK
Role role UK
String color
}
"SiteTagColor" {
Int id PK
SiteTag siteTag UK
String color
}
"SiteTypeColor" {
Int id PK
SiteType siteType UK
String color
}
"PersonTypeColor" {
Int id PK
PersonType personType UK
String color
}
"SanctionTypeColor" {
Int id PK
SanctionType sanctionType UK
String color
}
"ValidationStatusColor" {
Int id PK
ValidationStatus validationStatus UK
String color
}
RoleColorRepresents the color associated with each user role.
Properties
id: The unique identifier for the role color.role: The role associated with the color.color: The color associated with the role.SiteTagColorRepresents the color associated with each site tag.
Properties
id: The unique identifier for the site tag color.siteTag: The tag of the site.color: The color associated with the site tag.SiteTypeColorRepresents the color associated with each site type.
Properties
id: The unique identifier for the site type color.siteType: The type of the site.color: The color associated with the site type.PersonTypeColorRepresents the color associated with each person type.
Properties
id: The unique identifier for the person type color.personType: The type of the person.color: The color associated with the person type.SanctionTypeColorRepresents the color associated with each sanction type.
Properties
id: The unique identifier for the sanction type color.sanctionType: The type of the sanction.color: The color associated with the sanction type.ValidationStatusColorRepresents the color associated with each validation status.
Properties
id: The unique identifier for the validation status color.validationStatus: The validation status associated with the color.color: The color associated with the validation status.