parent
502f5646ad
commit
69a24c7e20
@ -0,0 +1,11 @@
|
||||
CREATE TABLE IF NOT EXISTS news_resources_topics (
|
||||
news_resource_id TEXT NOT NULL,
|
||||
topic_id TEXT NOT NULL,
|
||||
PRIMARY KEY(news_resource_id, topic_id),
|
||||
FOREIGN KEY(news_resource_id) REFERENCES news_resources(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY(topic_id) REFERENCES topics(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS index_news_resources_topics_news_resource_id ON news_resources_topics(news_resource_id);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS index_news_resources_topics_topic_id ON news_resources_topics(topic_id);
|
||||
Loading…
Reference in new issue