Skip to content
This repository
Browse code

Added migration that adds version numbers to 3rd party libs

  • Loading branch information...
commit cc367f01520aa2ac5961b7831e7c8d8e7bfd68f4 1 parent 2bc2c2b
Zachary Kim authored October 10, 2010
37  db/migrate/20101011035100_add_version_nums_to_third_party.rb
... ...
@@ -0,0 +1,37 @@
  1
+class AddVersionNumsToThirdParty < ActiveRecord::Migration
  2
+  
  3
+  def self.set_lib_version(lib_name, version)
  4
+    lib = Library.find_by_name(lib_name)
  5
+    lib.version = version
  6
+    lib.current = true
  7
+    lib.namespaces.each do |n|
  8
+      n.functions.each do |f|
  9
+        f.version = lib.version
  10
+        f.save
  11
+      end
  12
+      
  13
+      n.version = lib.version
  14
+      n.save
  15
+    end
  16
+    lib.save
  17
+    puts "Finished library #{lib_name}"
  18
+  end
  19
+  
  20
+  def self.up
  21
+    set_lib_version "circumspec", "0.0.12"
  22
+    set_lib_version "clj-sandbox", "0.4.0"
  23
+    set_lib_version "clj-ssh", "0.2.0-SNAPSHOT"
  24
+    set_lib_version "clj-swing", "0.1.0-SNAPSHOT"
  25
+    set_lib_version "enlive", "1.0.0-SNAPSHOT"
  26
+    set_lib_version "incanter", "1.2.3-SNAPSHOT"
  27
+    set_lib_version "leiningen", "1.2.0"
  28
+    set_lib_version "midje", "0.1.1"
  29
+    set_lib_version "pallet", "0.2.0-SNAPSHOT"
  30
+    set_lib_version "ring", "0.2.3"
  31
+    set_lib_version "swank-clojure", "1.2.0"
  32
+    set_lib_version "trammel", "0.3.2"
  33
+  end
  34
+
  35
+  def self.down
  36
+  end
  37
+end
2  db/schema.rb
@@ -9,7 +9,7 @@
9 9
 #
10 10
 # It's strongly recommended to check this file into your version control system.
11 11
 
12  
-ActiveRecord::Schema.define(:version => 20101010212830) do
  12
+ActiveRecord::Schema.define(:version => 20101011035100) do
13 13
 
14 14
   create_table "comments", :force => true do |t|
15 15
     t.integer  "commentable_id",                 :default => 0

0 notes on commit cc367f0

Please sign in to comment.
Something went wrong with that request. Please try again.