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
3349c5b7
Commit
3349c5b7
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
3620ea42
Changes
1
Hide 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 @
3349c5b7
...
@@ -14,7 +14,10 @@ SELECT provider, extern_uid, id FROM users
...
@@ -14,7 +14,10 @@ SELECT provider, extern_uid, id FROM users
WHERE provider IS NOT NULL
WHERE provider IS NOT NULL
eos
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
,
:extern_uid
remove_column
:users
,
:provider
remove_column
:users
,
:provider
end
end
...
@@ -35,6 +38,9 @@ eos
...
@@ -35,6 +38,9 @@ eos
end
end
drop_table
:identities
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
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