🗃️ db: add media_external_links model

This commit is contained in:
2026-05-18 21:00:00 +07:00
parent 743abc0b7a
commit 2b5ee22731
2 changed files with 16 additions and 6 deletions

View File

@ -2,7 +2,7 @@
"id": "0",
"name": "Main Diagram",
"createdAt": "2026-05-19T16:28:02.086Z",
"updatedAt": "2026-05-20T01:23:06.250Z",
"updatedAt": "2026-05-21T15:34:35.866Z",
"databaseType": "postgresql",
"tables": [
{
@ -768,26 +768,26 @@
},
{
"id": "62",
"name": "media_id",
"name": "media",
"type": {
"id": "uuid",
"name": "uuid"
},
"primaryKey": false,
"unique": false,
"nullable": true,
"nullable": false,
"createdAt": 1777282589093
},
{
"id": "63",
"name": "name",
"name": "site_name",
"type": {
"id": "varchar",
"name": "varchar"
},
"primaryKey": false,
"unique": false,
"nullable": true,
"nullable": false,
"createdAt": 1777282589093,
"characterMaximumLength": "64"
},

View File

@ -256,7 +256,7 @@ model Media {
themes MediaTheme[]
demographics MediaDemographic[]
relations MediaRelation[] @relation("MediaRelationMedia")
// external_links MediaExternalLink[]
external_links MediaExternalLink[]
// characters MediaCharacter[]
// approved_by User? @relation(fields: [approver_id], references: [id])
// approved_at Boolean @default(false)
@ -432,6 +432,16 @@ model MediaRelation {
@@map("media_relations")
}
model MediaExternalLink {
id String @id @db.Uuid @default(uuid(7))
media Media @relation(fields: [media_id], references: [id])
url String @db.VarChar(255)
site_name String? @db.VarChar(100)
media_id String @db.Uuid
@@map("media_external_links")
}
/**