From 69a24c7e20fc373d2bfc72c38a08aa1ca2f9eab4 Mon Sep 17 00:00:00 2001 From: lihenggui Date: Wed, 14 Feb 2024 10:58:43 -0800 Subject: [PATCH] Add NewsResourcesTopics --- .../nowinandroid/core/database/NewsResourceTopics.sq | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core/database/src/commonMain/sqldelight/com/google/samples/apps/nowinandroid/core/database/NewsResourceTopics.sq diff --git a/core/database/src/commonMain/sqldelight/com/google/samples/apps/nowinandroid/core/database/NewsResourceTopics.sq b/core/database/src/commonMain/sqldelight/com/google/samples/apps/nowinandroid/core/database/NewsResourceTopics.sq new file mode 100644 index 000000000..55aaa6b7f --- /dev/null +++ b/core/database/src/commonMain/sqldelight/com/google/samples/apps/nowinandroid/core/database/NewsResourceTopics.sq @@ -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);