Namespace model added. Migration to convert exit project/groups
This commit is contained in:
parent
ced242a2d0
commit
e29ccece33
6 changed files with 60 additions and 31 deletions
13
db/migrate/20121122145155_convert_group_to_namespace.rb
Normal file
13
db/migrate/20121122145155_convert_group_to_namespace.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
class ConvertGroupToNamespace < ActiveRecord::Migration
|
||||
def up
|
||||
rename_table 'groups', 'namespaces'
|
||||
add_column :namespaces, :type, :string, null: true
|
||||
|
||||
# Migrate old groups
|
||||
Namespace.update_all(type: 'Group')
|
||||
end
|
||||
|
||||
def down
|
||||
raise 'Rollback is not allowed'
|
||||
end
|
||||
end
|
5
db/migrate/20121122150932_add_namespace_id_to_project.rb
Normal file
5
db/migrate/20121122150932_add_namespace_id_to_project.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddNamespaceIdToProject < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :projects, :group_id, :namespace_id
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue