Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Resetting DB with mysql will now take InnoDB as engine

  • Loading branch information...
commit a33f75af94dddf657c8bfac169e36ce6d7bcbfdf 1 parent acdebe8
vinothkr authored
Showing with 17 additions and 6 deletions.
  1. +1 −1  project.clj
  2. +16 −5 test/clj_record/test_helper.clj
View
2  project.clj
@@ -1,4 +1,4 @@
-(defproject net.kronkltd/clj-record "1.0-SNAPSHOT"
+(defproject clj-record "1.0-SNAPSHOT"
:description "A pseudo-port of ActiveRecord to the Clojure programming language"
:url "http://github.com/duelinmarkers/clj-record"
:dependencies [[org.clojure/clojure "1.3.0"]
View
21 test/clj_record/test_helper.clj
@@ -36,29 +36,40 @@
(defmethod get-id-key-spec :default [db-spec name]
[:id "SERIAL UNIQUE PRIMARY KEY"])
+(defmulti get-table-spec :subprotocol)
+(defmethod get-table-spec "mysql" [db-spec]
+ "Engine=InnoDB")
+(defmethod get-table-spec :default [db-spec]
+ nil)
+
(def table-specs
{ :manufacturers
[ (get-id-key-spec db "manufacturer_pk")
[:name "VARCHAR(32)" "NOT NULL"]
[:founded "VARCHAR(4)"]
- [:grade :int] ]
+ [:grade :int]
+ :table-spec (get-table-spec db)]
:productos
[ (get-id-key-spec db "product_pk")
[:name "VARCHAR(32)" "NOT NULL"]
[:price :int]
- [:manufacturer_id :int "NOT NULL"] ]
+ [:manufacturer_id :int "NOT NULL"]
+ :table-spec (get-table-spec db)]
:person
[ (get-id-key-spec db "person_pk")
[:name "VARCHAR(32) NOT NULL"]
[:mother_id :int]
- [:father_person_id :int] ]
+ [:father_person_id :int]
+ :table-spec (get-table-spec db)]
:thing_one
[ (get-id-key-spec db "thing_one_pk")
[:name "VARCHAR(32)" "NOT NULL"]
- [:owner_person_id :int] ]
+ [:owner_person_id :int]
+ :table-spec (get-table-spec db)]
:thing_two
[ (get-id-key-spec db "thing_two_pk")
- [:thing_one_id :int "NOT NULL"] ] })
+ [:thing_one_id :int "NOT NULL"]
+ :table-spec (get-table-spec db)] })
(defn drop-tables
([] (drop-tables (keys table-specs)))
Please sign in to comment.
Something went wrong with that request. Please try again.