Permalink
Browse files

Added migration that adds version numbers to 3rd party libs

  • Loading branch information...
1 parent 2bc2c2b commit cc367f01520aa2ac5961b7831e7c8d8e7bfd68f4 @zk committed Oct 11, 2010
Showing with 38 additions and 1 deletion.
  1. +37 −0 db/migrate/20101011035100_add_version_nums_to_third_party.rb
  2. +1 −1 db/schema.rb
@@ -0,0 +1,37 @@
+class AddVersionNumsToThirdParty < ActiveRecord::Migration
+
+ def self.set_lib_version(lib_name, version)
+ lib = Library.find_by_name(lib_name)
+ lib.version = version
+ lib.current = true
+ lib.namespaces.each do |n|
+ n.functions.each do |f|
+ f.version = lib.version
+ f.save
+ end
+
+ n.version = lib.version
+ n.save
+ end
+ lib.save
+ puts "Finished library #{lib_name}"
+ end
+
+ def self.up
+ set_lib_version "circumspec", "0.0.12"
+ set_lib_version "clj-sandbox", "0.4.0"
+ set_lib_version "clj-ssh", "0.2.0-SNAPSHOT"
+ set_lib_version "clj-swing", "0.1.0-SNAPSHOT"
+ set_lib_version "enlive", "1.0.0-SNAPSHOT"
+ set_lib_version "incanter", "1.2.3-SNAPSHOT"
+ set_lib_version "leiningen", "1.2.0"
+ set_lib_version "midje", "0.1.1"
+ set_lib_version "pallet", "0.2.0-SNAPSHOT"
+ set_lib_version "ring", "0.2.3"
+ set_lib_version "swank-clojure", "1.2.0"
+ set_lib_version "trammel", "0.3.2"
+ end
+
+ def self.down
+ end
+end
View
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20101010212830) do
+ActiveRecord::Schema.define(:version => 20101011035100) do
create_table "comments", :force => true do |t|
t.integer "commentable_id", :default => 0

0 comments on commit cc367f0

Please sign in to comment.