summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-14 12:00:21 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-14 12:00:21 +0200
commit0d7986a8c7806a5d7630283f26667f954a5e61f7 (patch)
treedd99a049f0d1728fcb4a86a95a5f9afca0cf9cc6 /db
parent58e4e6b0819fcb385d790671d44c7a5051787e92 (diff)
parent9064fba071d06439ead76890015c3d38ffa63375 (diff)
downloadgitlab-ce-0d7986a8c7806a5d7630283f26667f954a5e61f7.tar.gz
Merge branch 'import-timeout' of https://dev.gitlab.org/dzaporozhets/gitlabhq into dzaporozhets/gitlabhq-import-timeout
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: CHANGELOG db/schema.rb
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140312145357_add_import_status_to_project.rb5
-rw-r--r--db/migrate/20140313092127_migrate_already_imported_projects.rb12
-rw-r--r--db/schema.rb4
3 files changed, 19 insertions, 2 deletions
diff --git a/db/migrate/20140312145357_add_import_status_to_project.rb b/db/migrate/20140312145357_add_import_status_to_project.rb
new file mode 100644
index 00000000000..ef972e8342a
--- /dev/null
+++ b/db/migrate/20140312145357_add_import_status_to_project.rb
@@ -0,0 +1,5 @@
+class AddImportStatusToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :import_status, :string
+ end
+end
diff --git a/db/migrate/20140313092127_migrate_already_imported_projects.rb b/db/migrate/20140313092127_migrate_already_imported_projects.rb
new file mode 100644
index 00000000000..f4392c0f05e
--- /dev/null
+++ b/db/migrate/20140313092127_migrate_already_imported_projects.rb
@@ -0,0 +1,12 @@
+class MigrateAlreadyImportedProjects < ActiveRecord::Migration
+ def up
+ Project.where(imported: true).update_all(import_status: "finished")
+ Project.where(imported: false).update_all(import_status: "none")
+ remove_column :projects, :imported
+ end
+
+ def down
+ add_column :projects, :imported, :boolean, default: false
+ Project.where(import_status: 'finished').update_all(imported: true)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e07fd3deaca..d8a9d1863fc 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: 20140305193308) do
+ActiveRecord::Schema.define(version: 20140313092127) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -214,10 +214,10 @@ ActiveRecord::Schema.define(version: 20140305193308) do
t.string "issues_tracker_id"
t.boolean "snippets_enabled", default: true, null: false
t.datetime "last_activity_at"
- t.boolean "imported", default: false, null: false
t.string "import_url"
t.integer "visibility_level", default: 0, null: false
t.boolean "archived", default: false, null: false
+ t.string "import_status"
end
add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree