BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1440ac81
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
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
remove_index
:users
,
[
"extern_uid"
,
"provider"
]
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
add_index
"users"
,
[
"extern_uid"
,
"provider"
],
name:
"index_users_on_extern_uid_and_provider"
,
unique:
true
,
using: :btree
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