Skip to content

Commit

Permalink
populate-database.clj for standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
jsyrjala committed Feb 18, 2012
1 parent d3499a2 commit 5a08ef0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
8 changes: 5 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(defproject ruuvi-server "0.0.1-SNAPSHOT"
:description "RuuviTracker server"
:dependencies [
:dependencies
[
[org.clojure/clojure "1.2.1"]
[compojure "1.0.1"]
[ring-json-params "0.1.3"]
Expand All @@ -23,10 +24,11 @@
[postgresql/postgresql "8.4-702.jdbc4"]
[org.apache.tomcat/tomcat-jdbc "7.0.25"]
[org.clojure/java.jdbc "0.1.1"]
[korma "0.3.0-beta3"]
[korma "0.3.0-beta3" :exclusions [log4j/log4j] ]
[lobos "0.8.0"]
]
:dev-dependencies [
:dev-dependencies
[
[ring/ring-devel "1.0.1"]
]
:ring {:handler ruuvi-tracker.core/dev-app}
Expand Down
14 changes: 9 additions & 5 deletions src/ruuvi_server/load_initial_data.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
(ns ruuvi-server.load-initial-data
(:use ruuvi-server.database)
(:use ruuvi-server.models.entities)
(:use korma.db)
(:use [clojure.tools.logging :only (debug info warn error)])
)

(defn create-test-trackers []
(print "Creting test trackers")
(create-tracker "990123" "test-tracker" "salakala")
(create-tracker "123" "Murre-tracker" "password")
(create-tracker "foo" "FooBar" "bar")
(create-tracker "foobar" "foobar" "foobar")
(info "Creating test trackers")
(transaction
(create-tracker "990123" "test-tracker" "salakala")
(create-tracker "123" "Murre-tracker" "password")
(create-tracker "foo" "FooBar" "bar")
(create-tracker "foobar" "foobar" "foobar")
)
)
8 changes: 8 additions & 0 deletions src/ruuvi_server/standalone/populate_database.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns ruuvi-server.standalone.populate-database
(:use ruuvi-server.standalone.config)
(:use ruuvi-server.load-initial-data)
)

(defn -main []
(create-test-trackers)
)

0 comments on commit 5a08ef0

Please sign in to comment.