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
64a0d1ac
Commit
64a0d1ac
authored
Sep 26, 2019
by
Sean Arnold
Committed by
Douglas Barbosa Alexandre
Sep 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove setup_postgres task and update schema RB
parent
d5e16544
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
21 deletions
+10
-21
changelogs/unreleased/update-schema-rb.yml
changelogs/unreleased/update-schema-rb.yml
+5
-0
db/migrate/20180113220114_rework_redirect_routes_indexes.rb
db/migrate/20180113220114_rework_redirect_routes_indexes.rb
+1
-3
db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
...grate/20180306164012_add_path_index_to_redirect_routes.rb
+1
-6
db/schema.rb
db/schema.rb
+3
-0
lib/tasks/gitlab/setup.rake
lib/tasks/gitlab/setup.rake
+0
-1
lib/tasks/migrate/setup_postgresql.rake
lib/tasks/migrate/setup_postgresql.rake
+0
-11
No files found.
changelogs/unreleased/update-schema-rb.yml
0 → 100644
View file @
64a0d1ac
---
title
:
Remove Postgresql specific setup tasks and move to schema.rb
merge_request
:
author
:
type
:
other
db/migrate/20180113220114_rework_redirect_routes_indexes.rb
View file @
64a0d1ac
...
...
@@ -20,9 +20,7 @@ class ReworkRedirectRoutesIndexes < ActiveRecord::Migration[4.2]
def
up
disable_statement_timeout
do
# this is a plain btree on a single boolean column. It'll never be
# selective enough to be valuable. This class is called by
# setup_postgresql.rake so it needs to be able to handle this
# index not existing.
# selective enough to be valuable.
if
index_exists?
(
:redirect_routes
,
:permanent
)
remove_concurrent_index
(
:redirect_routes
,
:permanent
)
end
...
...
db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
View file @
64a0d1ac
...
...
@@ -14,9 +14,7 @@ class AddPathIndexToRedirectRoutes < ActiveRecord::Migration[4.2]
# RedirectRoute.matching_path_and_descendants
#
# This same index is also added in the `ReworkRedirectRoutesIndexes` so this
# is a no-op in most cases. But this migration is also called from the
# `setup_postgresql.rake` task when setting up a new database, in which case
# we want to create the index.
# is a no-op in most cases.
def
up
return
unless
Gitlab
::
Database
.
postgresql?
...
...
@@ -31,8 +29,5 @@ class AddPathIndexToRedirectRoutes < ActiveRecord::Migration[4.2]
# Do nothing in the DOWN. Since the index above is originally created in the
# `ReworkRedirectRoutesIndexes`. This migration wouldn't have actually
# created any new index.
#
# This migration is only here to be called form `setup_postgresql.rake` so
# any newly created database would have this index.
end
end
db/schema.rb
View file @
64a0d1ac
...
...
@@ -2917,6 +2917,7 @@ ActiveRecord::Schema.define(version: 2019_09_26_041216) do
t
.
boolean
"emails_disabled"
t
.
integer
"max_pages_size"
t
.
integer
"max_artifacts_size"
t
.
index
"lower((name)::text)"
,
name:
"index_projects_on_lower_name"
t
.
index
[
"archived"
,
"pending_delete"
,
"merge_requests_require_code_owner_approval"
],
name:
"projects_requiring_code_owner_approval"
,
where:
"((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))"
t
.
index
[
"created_at"
],
name:
"index_projects_on_created_at"
t
.
index
[
"creator_id"
],
name:
"index_projects_on_creator_id"
...
...
@@ -3113,6 +3114,7 @@ ActiveRecord::Schema.define(version: 2019_09_26_041216) do
t
.
string
"path"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
index
"lower((path)::text) varchar_pattern_ops"
,
name:
"index_redirect_routes_on_path_unique_text_pattern_ops"
,
unique:
true
t
.
index
[
"path"
],
name:
"index_redirect_routes_on_path"
,
unique:
true
t
.
index
[
"source_type"
,
"source_id"
],
name:
"index_redirect_routes_on_source_type_and_source_id"
end
...
...
@@ -3641,6 +3643,7 @@ ActiveRecord::Schema.define(version: 2019_09_26_041216) do
t
.
string
"first_name"
,
limit:
255
t
.
string
"last_name"
,
limit:
255
t
.
string
"static_object_token"
,
limit:
255
t
.
index
"lower((name)::text)"
,
name:
"index_on_users_name_lower"
t
.
index
[
"accepted_term_id"
],
name:
"index_users_on_accepted_term_id"
t
.
index
[
"admin"
],
name:
"index_users_on_admin"
t
.
index
[
"bot_type"
],
name:
"index_users_on_bot_type"
...
...
lib/tasks/gitlab/setup.rake
View file @
64a0d1ac
...
...
@@ -31,7 +31,6 @@ namespace :gitlab do
terminate_all_connections
unless
Rails
.
env
.
production?
Rake
::
Task
[
"db:reset"
].
invoke
Rake
::
Task
[
"setup_postgresql"
].
invoke
Rake
::
Task
[
"db:seed_fu"
].
invoke
rescue
Gitlab
::
TaskAbortedByUserError
puts
"Quitting..."
.
color
(
:red
)
...
...
lib/tasks/migrate/setup_postgresql.rake
View file @
64a0d1ac
desc
'GitLab | Sets up PostgreSQL'
task
setup_postgresql: :environment
do
require
Rails
.
root
.
join
(
'db/migrate/20180215181245_users_name_lower_index.rb'
)
require
Rails
.
root
.
join
(
'db/migrate/20180504195842_project_name_lower_index.rb'
)
require
Rails
.
root
.
join
(
'db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb'
)
UsersNameLowerIndex
.
new
.
up
ProjectNameLowerIndex
.
new
.
up
AddPathIndexToRedirectRoutes
.
new
.
up
end
desc
'GitLab | Generate PostgreSQL Password Hash'
task
:postgresql_md5_hash
do
require
'digest'
...
...
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