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:
authorJob van der Voort <job@gitlab.com>2014-04-07 18:03:49 +0400
committerJob van der Voort <job@gitlab.com>2014-04-07 18:03:49 +0400
commit6d196962670b35ea48588aad3cfdb6f2d11febab (patch)
tree43ecdf0599332cbe3f49376846e5dd2cb7fb36a0 /db
parent11d3a00c28677e3b20582535247945f3d7670fad (diff)
Fix faulty namespaces
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140407135544_fix_namespaces.rb10
-rw-r--r--db/schema.rb2
2 files changed, 11 insertions, 1 deletions
diff --git a/db/migrate/20140407135544_fix_namespaces.rb b/db/migrate/20140407135544_fix_namespaces.rb
new file mode 100644
index 00000000000..6207cf18d65
--- /dev/null
+++ b/db/migrate/20140407135544_fix_namespaces.rb
@@ -0,0 +1,10 @@
+class FixNamespaces < ActiveRecord::Migration
+ def up
+ Namespace.where('name <> path and type is null').each do |namespace|
+ namespace.update_attribute(:name, namespace.path)
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index d8a9d1863fc..9033aa92ac9 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: 20140313092127) do
+ActiveRecord::Schema.define(version: 20140407135544) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"