summaryrefslogtreecommitdiff
path: root/src/chef/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/chef/database')
-rw-r--r--src/chef/database/init.clj16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/chef/database/init.clj b/src/chef/database/init.clj
new file mode 100644
index 0000000..f791e39
--- /dev/null
+++ b/src/chef/database/init.clj
@@ -0,0 +1,16 @@
+(ns chef.database.init
+ (:require [next.jdbc :as jdbc]
+ [honey.sql :as sql]))
+
+(defn exec! [db]
+ (jdbc/execute! db (sql/format {:create-table :categories
+ :with-columns [[:id :integer :auto-increment :primary-key]
+ [:name :text]
+ [:question :text]
+ [:children :text]
+ [:parent :text]]}))
+ (jdbc/execute! db (sql/format {:create-table :recipes
+ :with-columns [[:id :integer :auto-increment :primary-key]
+ [:category :integer]
+ [:title :text]
+ [:description :text]]})))