This commit is contained in:
jlimolina 2025-11-24 23:06:26 +01:00
parent 86ee083b90
commit e3a99d9604
8 changed files with 489 additions and 483 deletions

View file

@ -31,11 +31,13 @@ ALTER TABLE traducciones
-- ---------------------------------------------
-- 3. TABLA RELACIÓN EVENTO <-> NOTICIA <-> TRADUCCIÓN
-- (tipos alineados con noticias.id (VARCHAR(32))
-- y traducciones.id (INTEGER))
-- ---------------------------------------------
CREATE TABLE IF NOT EXISTS eventos_noticias (
evento_id BIGINT NOT NULL REFERENCES eventos(id) ON DELETE CASCADE,
noticia_id CHAR(32) NOT NULL REFERENCES noticias(id) ON DELETE CASCADE,
traduccion_id BIGINT NOT NULL REFERENCES traducciones(id) ON DELETE CASCADE,
evento_id BIGINT NOT NULL REFERENCES eventos(id) ON DELETE CASCADE,
noticia_id VARCHAR(32) NOT NULL REFERENCES noticias(id) ON DELETE CASCADE,
traduccion_id INTEGER NOT NULL REFERENCES traducciones(id) ON DELETE CASCADE,
PRIMARY KEY (evento_id, traduccion_id)
);