summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-09 20:37:04 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-09 20:37:04 +0300
commit0f2798d498c69372137d13a8ba3ec8e87b7f0a8a (patch)
treee2fa3ed8d25c5a54e4b8baf70e710008d1a03754 /db
parent52cd655f71c6a5393b71640c13cd95e35e8d2624 (diff)
parent85e039049cba5ac1bf92e6cbba2ea1236d6892f7 (diff)
downloadgitlab-ce-0f2798d498c69372137d13a8ba3ec8e87b7f0a8a.tar.gz
Merge branch 'feature/refactoring_scopes_pr' of https://github.com/Undev/gitlabhq into Undev-feature/refactoring_scopes_pr
Conflicts: db/schema.rb
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20130403003950_add_last_activity_column_into_project.rb15
-rw-r--r--db/schema.rb1
2 files changed, 15 insertions, 1 deletions
diff --git a/db/migrate/20130403003950_add_last_activity_column_into_project.rb b/db/migrate/20130403003950_add_last_activity_column_into_project.rb
new file mode 100644
index 00000000000..ddb04843de1
--- /dev/null
+++ b/db/migrate/20130403003950_add_last_activity_column_into_project.rb
@@ -0,0 +1,15 @@
+class AddLastActivityColumnIntoProject < ActiveRecord::Migration
+ def up
+ add_column :projects, :last_activity_at, :datetime
+ add_index :projects, :last_activity_at
+
+ Project.find_each do |project|
+ project.update_attribute(:last_activity_at, project.last_activity_date)
+ end
+ end
+
+ def down
+ remove_index :projects, :last_activity_at
+ remove_column :projects, :last_activity_at
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 0f7827a736e..d85af432a9d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -12,7 +12,6 @@
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130404164628) do
-
create_table "events", :force => true do |t|
t.string "target_type"
t.integer "target_id"