diff options
| author | user@node5.net <user@node5.net> | 2026-06-15 21:24:56 +0200 |
|---|---|---|
| committer | user@node5.net <user@node5.net> | 2026-06-15 21:24:56 +0200 |
| commit | 38b8178cce160b3d2e6c8b3256c7655f4d0a27cd (patch) | |
| tree | ee232c74e786890a4d2bad8b1d89e2b5a5e2c6e6 /src/create_db.sql | |
| parent | 693525e6444a74980ddfffb32ffe561c53dfcc24 (diff) | |
internalize needed files for starting the program
Diffstat (limited to 'src/create_db.sql')
| -rw-r--r-- | src/create_db.sql | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/create_db.sql b/src/create_db.sql new file mode 100644 index 0000000..ee0f968 --- /dev/null +++ b/src/create_db.sql @@ -0,0 +1,25 @@ +CREATE TABLE comment ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + comment text NOT NULL, -- URL of the page the comment belongs to, this is the relation between the markdown and this database + page_url text, + visitor_url text, -- The website the user claims to be from, if they have their own self hosted website + nickname text, + show_visitor_url bool, + contact text, -- A means of contacting this person, email phone, or similar + show_contact bool, -- True: Publicly show the contact information, False: Site creators eyes only + public bool, -- Indicates if the comment is to be publicly viewable, or if it''s merely for the creator + approved bool DEFAULT FALSE, + created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP +); + +INSERT INTO comment (comment, page_url, nickname, visitor_url, show_visitor_url, contact, show_contact, public, approved) + VALUES ('Hello world!', '/', 'user@node5.net', 'https://blog.node5.net/', TRUE, 'Leave a comment on this blog', TRUE, TRUE, TRUE); + +INSERT INTO comment (comment, page_url, nickname, visitor_url, show_visitor_url, contact, show_contact, public, approved) + VALUES ('Test private means of contact', '/', NULL, NULL, TRUE, 'Death star plans', FALSE, TRUE, TRUE); + +INSERT INTO comment (comment, page_url, nickname, visitor_url, show_visitor_url, contact, show_contact, public, approved) + VALUES ('Test private comment', '/', NULL, NULL, TRUE, 'Don''t', TRUE, FALSE, TRUE); + +INSERT INTO comment (comment, page_url, nickname, visitor_url, show_visitor_url, contact, show_contact, public, approved) + VALUES ('Test unapproved comment', '/', NULL, NULL, TRUE, NULL, TRUE, TRUE, FALSE); |
