Add entry_id relationship links to Entries

- Introduce reusable EntryLink component
- Use EntryLink in Releases and Label detail tables
- Link both ID and title to /zxdb/entries/[id] for consistency

Signed-off-by: Junie@MacOS
This commit is contained in:
2025-12-17 22:30:48 +00:00
parent 07478b280c
commit 2bade1825c
9 changed files with 382 additions and 6 deletions

View File

@@ -143,6 +143,14 @@ export const hosts = mysqlTable("hosts", {
magazineId: smallint("magazine_id"),
});
// ---- Aliases (alternative titles per entry/release/language)
export const aliases = mysqlTable("aliases", {
entryId: int("entry_id").notNull(),
releaseSeq: smallint("release_seq").notNull().default(0),
languageId: char("language_id", { length: 2 }).notNull(),
title: varchar("title", { length: 250 }).notNull(),
});
// `releases` are identified by (entry_id, release_seq)
export const releases = mysqlTable("releases", {
entryId: int("entry_id").notNull(),
@@ -184,6 +192,22 @@ export const downloads = mysqlTable("downloads", {
comments: varchar("comments", { length: 250 }),
});
// ---- Web references (external links tied to entries)
export const webrefs = mysqlTable("webrefs", {
entryId: int("entry_id").notNull(),
link: varchar("link", { length: 200 }).notNull(),
websiteId: tinyint("website_id").notNull(),
languageId: char("language_id", { length: 2 }).notNull(),
});
export const websites = mysqlTable("websites", {
id: tinyint("id").notNull().primaryKey(),
name: varchar("name", { length: 100 }).notNull(),
comments: varchar("comments", { length: 100 }),
link: varchar("link", { length: 100 }),
linkMask: varchar("link_mask", { length: 100 }),
});
// Roles relation (composite PK in DB)
export const roles = mysqlTable("roles", {
entryId: int("entry_id").notNull(),