Skip to content

Instantly share code, notes, and snippets.

@Olical
Created May 16, 2015 13:36
Show Gist options
  • Select an option

  • Save Olical/688f3b1199cad2c19b77 to your computer and use it in GitHub Desktop.

Select an option

Save Olical/688f3b1199cad2c19b77 to your computer and use it in GitHub Desktop.
Model for lisp cast thing at Hack the Tower
(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