Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-02-25 02:15:04 +0300
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-02-25 02:15:04 +0300
commit2cd2543c445c4e0889fea71908e861fd88f77863 (patch)
treefefe787021f8ae1c906ec29a2b22f6678fb89079 /db
parent2cedeb48561122f35bfd5004aaa9c59ee3922911 (diff)
parentd4bfdd34baa9eea2e89223b039f15cd4d4b3e5ae (diff)
Merge branch 'mwessel/gitlab-ce-set-last-activity-at' into 'master'
Give last_activity_at a default value so it will always be set For https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/345 See merge request !1589
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20150223022001_set_missing_last_activity_at.rb9
-rw-r--r--db/schema.rb4
2 files changed, 11 insertions, 2 deletions
diff --git a/db/migrate/20150223022001_set_missing_last_activity_at.rb b/db/migrate/20150223022001_set_missing_last_activity_at.rb
new file mode 100644
index 00000000000..3a3adf18872
--- /dev/null
+++ b/db/migrate/20150223022001_set_missing_last_activity_at.rb
@@ -0,0 +1,9 @@
+class SetMissingLastActivityAt < ActiveRecord::Migration
+ def up
+ execute "UPDATE projects SET last_activity_at = updated_at WHERE last_activity_at IS NULL"
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e11a068c9c5..d34eab75085 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20150213121042) do
+ActiveRecord::Schema.define(version: 20150223022001) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -334,12 +334,12 @@ ActiveRecord::Schema.define(version: 20150213121042) do
t.string "import_url"
t.integer "visibility_level", default: 0, null: false
t.boolean "archived", default: false, null: false
- t.string "avatar"
t.string "import_status"
t.float "repository_size", default: 0.0
t.integer "star_count", default: 0, null: false
t.string "import_type"
t.string "import_source"
+ t.string "avatar"
end
add_index "projects", ["created_at", "id"], name: "index_projects_on_created_at_and_id", using: :btree