From 9f9b29898dd4bc458b6bab3410501d0d7bd98b7a Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 11 Nov 2024 14:48:16 +0000 Subject: [PATCH] feature: use dict for create table SQL statements --- src/sql/create_tables.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sql/create_tables.py b/src/sql/create_tables.py index c5f13ed..9be40da 100644 --- a/src/sql/create_tables.py +++ b/src/sql/create_tables.py @@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS entries ( CREATE_TAGS_TABLE = """ CREATE TABLE IF NOT EXISTS tags ( - name TEXT PRIMARY KEY UNIQUE, + name TEXT PRIMARY KEY UNIQUE ) """ @@ -31,3 +31,10 @@ CREATE TABLE IF NOT EXISTS entries_tags ( FOREIGN KEY (tag_name) REFERENCES tags(name), PRIMARY KEY (entry_title, tag_name) )""" + +tables = [ + {"name": "entries", "create_statement": CREATE_ENTRIES_TABLE}, + {"name": "tags", "create_statement": CREATE_TAGS_TABLE}, + {"name": "backlinks", "create_statement": CREATE_BACKLINKS_TABLE}, + {"name": "entries_tags", "create_statement": CREATE_ENTRIES_TAGS_TABLE}, +]