blob: c1128e9c5430343948dd847332ac456711853c9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
(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]
[:parent :text]]})) ;TODO: create root category
(jdbc/execute! db (sql/format {:create-table :recipes
:with-columns [[:id :integer :auto-increment :primary-key]
[:category :integer]
[:title :text]
[:description :text]]})))
|