DROPTABLEIFEXISTScategories;-- is a list of categories(lists): type: reading_list, authors, notes, etc it's a type but type is also a keyword in python so better avoiding it
DROPTABLEIFEXISTStopics;-- test table weaved on measure for this test
-- table creation
CREATETABLEcategories(
idINTEGERPRIMARYKEYAUTOINCREMENT,
createdTIMESTAMPNOTNULLDEFAULTCURRENT_TIMESTAMP,
titleTEXTNOTNULL
titleTEXTNOTNULL-- remember to not write the comma here at the end of each table
);
CREATETABLEcards(
@ -15,4 +15,22 @@ CREATE TABLE cards (
createdTIMESTAMPNOTNULLDEFAULTCURRENT_TIMESTAMP,
contentTEXTNOTNULL,
FOREIGNKEY(category_id)REFERENCEScategories(id)
);
);
-- CREATE TABLE relations (
-- id INTEGER PRIMARY KEY AUTOINCREMENT,
-- )
CREATETABLEtopics(
idINTEGERPRIMARYKEYAUTOINCREMENT,
contentTEXTNOTNULL
);
-- join table cards-topic but will i need also topic-card?? having a table of relations would maybe be a better approach? and a table of actions? (like upload file)