From 3d8f5d82738f27cdde78ba4bd0b07535c234f6db Mon Sep 17 00:00:00 2001
From: Mitsuo Tokumori <rtokumori@pucp.edu.pe>
Date: Fri, 27 Oct 2023 18:34:05 -0500
Subject: Add sqlite3 connection

---
 flaskr/schema.sql | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 flaskr/schema.sql

(limited to 'flaskr/schema.sql')

diff --git a/flaskr/schema.sql b/flaskr/schema.sql
new file mode 100644
index 0000000..be76d7e
--- /dev/null
+++ b/flaskr/schema.sql
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS user;
+DROP TABLE IF EXISTS post;
+
+CREATE TABLE user (
+  id INTEGER PRIMARY KEY AUTOINCREMENT,
+  username TEXT UNIQUE NOT NULL,
+  password TEXT NOT NULL
+);
+
+CREATE TABLE post (
+  id INTEGER PRIMARY KEY AUTOINCREMENT,
+  author_id INTEGER NOT NULL,
+  created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  title TEXT NOT NULL,
+  body TEXT NOT NULL,
+  FOREIGN KEY (author_id) REFERENCES user (id)
+);
-- 
cgit v1.2.3

