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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
1440ac81
Commit
1440ac81
authored
Dec 23, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove index only if exists
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
031461e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
db/migrate/20141121161704_add_identity_table.rb
db/migrate/20141121161704_add_identity_table.rb
+8
-2
No files found.
db/migrate/20141121161704_add_identity_table.rb
View file @
1440ac81
...
...
@@ -14,7 +14,10 @@ SELECT provider, extern_uid, id FROM users
WHERE provider IS NOT NULL
eos
if
index_exists?
(
:users
,
[
"extern_uid"
,
"provider"
])
remove_index
:users
,
[
"extern_uid"
,
"provider"
]
end
remove_column
:users
,
:extern_uid
remove_column
:users
,
:provider
end
...
...
@@ -35,6 +38,9 @@ eos
end
drop_table
:identities
unless
index_exists?
(
:users
,
[
"extern_uid"
,
"provider"
])
add_index
"users"
,
[
"extern_uid"
,
"provider"
],
name:
"index_users_on_extern_uid_and_provider"
,
unique:
true
,
using: :btree
end
end
end
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