Created
May 16, 2015 13:36
-
-
Save Olical/688f3b1199cad2c19b77 to your computer and use it in GitHub Desktop.
Model for lisp cast thing at Hack the Tower
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns webdev.item.model | |
| (:require [clojure.java.jdbc :as db])) | |
| (defn create-table [db] | |
| (db/execute! | |
| db | |
| ["CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\""]) | |
| (db/execute! | |
| db | |
| ["CREATE TABLE IF NOT EXISTS items | |
| (id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), | |
| name TEXT NOT NULL, | |
| description TEXT NOT NULL, | |
| checked BOOLEAN NOT NULL DEFAULT FALSE, | |
| data_created TIMESTAMPTZ NOT NULL DEFAULT now())"])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment