From e839a5f61f0faa21ca8b4bd5767f7575d5e576ee Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Wed, 21 May 2025 14:00:28 +0700
Subject: the card flip animation is legit

---
 src/lib/db/schema.sql | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/lib/db/schema.sql')

diff --git a/src/lib/db/schema.sql b/src/lib/db/schema.sql
index 1b678c5..8d1b288 100644
--- a/src/lib/db/schema.sql
+++ b/src/lib/db/schema.sql
@@ -114,9 +114,14 @@ CREATE TABLE IF NOT EXISTS lessons(
     id INTEGER PRIMARY KEY AUTOINCREMENT,
     name TEXT NOT NULL,
     position INTEGER NOT NULL DEFAULT 0,
-    description TEXT,
-    lang TEXT,
-    FOREIGN KEY (lang) REFERENCES languages(code)
+    description TEXT
+);
+CREATE TABLE IF NOT EXISTS lang_lessons(
+  lesson_id INTEGER NOT NULL,
+  lang TEXT NOT NULL,
+  PRIMARY KEY (lang, lesson_id),
+  FOREIGN KEY (lang) REFERENCES languages(code),
+  FOREIGN KEY (lesson_id) REFERENCES lessons(id)
 );
 CREATE TABLE IF NOT EXISTS cards(
     id INTEGER PRIMARY KEY AUTOINCREMENT,
-- 
cgit v1.2.3

