Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4359949d
Commit
4359949d
authored
Nov 07, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_broken_migration' into 'master'
Fix broken migration See merge request !233
parents
34c241e1
e45d5f7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb
...te/20140813133925_rename_ldap_group_to_ldap_group_link.rb
+4
-10
No files found.
db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb
View file @
4359949d
...
...
@@ -4,16 +4,10 @@ class RenameLdapGroupToLdapGroupLink < ActiveRecord::Migration
# NOTE: we use the old_ methods because the new methods are overloaded
# for backwards compatibility
Group
.
where
.
not
(
ldap_cn:
nil
).
each
do
|
group
|
# Make sure we use the database column, not the model methods
ldap_cn
=
group
.
read_attribute
(
:ldap_cn
)
ldap_access
=
group
.
read_attribute
(
:ldap_access
)
group
.
ldap_group_links
.
where
(
cn:
ldap_cn
).
first_or_create
do
|
ldap_group_link
|
ldap_group_link
.
group_access
=
ldap_access
end
end
time
=
Time
.
now
.
strftime
(
'%Y-%m-%d %H:%M:%S'
)
execute
"INSERT INTO ldap_group_links ( group_access, cn, group_id, created_at, updated_at )
SELECT ldap_access, ldap_cn, id, DATE('
#{
time
}
'), DATE('
#{
time
}
') FROM namespaces
WHERE ldap_cn IS NOT NULL;"
end
def
down
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment