]> source.dussan.org Git - redmine.git/commitdiff
scm: add "extra_info" column to repositories table and set serialize (#7146, #7047).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 12 May 2011 17:29:18 +0000 (17:29 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 12 May 2011 17:29:18 +0000 (17:29 +0000)
This column is for specific SCM.
Git 7 days problem (#7146) can not resolve unless storing branches info in database.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5762 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb
db/migrate/20110511000000_add_repositories_extra_info.rb [new file with mode: 0644]

index c2a15965dc781750d8a58dc5e9ed6ee81cbb7431..47471ca9215b17ad58922f3aa492dc2c80fb5a9f 100644 (file)
@@ -22,6 +22,8 @@ class Repository < ActiveRecord::Base
   has_many :changesets, :order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC"
   has_many :changes, :through => :changesets
 
+  serialize :extra_info
+
   # Raw SQL to delete changesets and changes in the database
   # has_many :changesets, :dependent => :destroy is too slow for big repositories
   before_destroy :clear_changesets
diff --git a/db/migrate/20110511000000_add_repositories_extra_info.rb b/db/migrate/20110511000000_add_repositories_extra_info.rb
new file mode 100644 (file)
index 0000000..a5280dc
--- /dev/null
@@ -0,0 +1,9 @@
+class AddRepositoriesExtraInfo < ActiveRecord::Migration
+  def self.up
+    add_column :repositories, :extra_info, :text
+  end
+
+  def self.down
+    remove_column :repositories, :extra_info
+  end
+end