Commit graph

12 commits

Author SHA1 Message Date
Dmitriy Zaporozhets
3551a625a8
Whitelist next project names: assets, profile, public
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-01-06 11:14:17 +02:00
Dmitriy Zaporozhets
6024697c10 Merge branch 'master' into 'dz-rename-reserved-project-names'
# Conflicts:
#   db/schema.rb
2016-12-27 16:34:20 +00:00
Z.J. van de Weg
269bc74506 Disable timeout while removing services
On GitLab.com this migration could take about 3 minutes. Disabling the
statement we know we have enough time to complete this.

Fixes #25976
2016-12-27 11:10:15 +01:00
Yorick Peterse
2f93259c6b Removed return from reserved project migration
This return is redundant as the query now uses "WHERE EXISTS (...)" to
filter out projects without a namespace.
2016-12-24 19:39:51 +02:00
Yorick Peterse
dcea45015c Fix parallel renaming of reserved projects
This ensures threads don't re-use the same connection object, and use
fewer queries to perform the work.
2016-12-24 19:39:51 +02:00
Dmitriy Zaporozhets
d72b40423c Rename projects with reserved path names
We cant have project with name 'project' or 'tree' anymore.
This merge request containts a migration that will find and rename all
projects using reserved names by adding N digit to the end of the name.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-24 19:39:51 +02:00
Z.J. van de Weg
1812d523a3 Remove unused services from the database
This adds a migration to remove unused services, where the properties
are empty. As the properties are empty, those do not contain any
settings or other information.

Fixes #25727
2016-12-21 15:11:03 +01:00
Timothy Andrew
eb434b15eb Make ChangePersonalAccessTokensDefaultBackToEmptyArray a "post" migration.
If we leave this as a regular migration, we could have the following flow:

1. Application knows nothing about scopes.
2. First migration runs, all existing personal access tokens have `api` scope
3. Application still knows nothing about scopes.
4. Second migration runs, all tokens created after this point have no scope
5. Application still knows nothing about scopes.
6. Tokens created at this time _should have the API scope, but instead have no scope_
7. Application code is reloaded, application knows about scopes
8. Tokens created after this point only have no scope if the user deliberately
   chooses to have no scopes.

Point #6 is the problem here. To avoid this, we move the second migration to a
"post" migration, which runs after the application code is deployed/reloaded.
2016-12-16 16:29:33 +05:30
Nick Thomas
16674d9b82 Fix a badly-performing migration 2016-11-15 17:07:58 +00:00
Alejandro Rodríguez
591f10f6bd Update 8.14-rc1 migrations to minimize downtime and deploy time
See https://gitlab.com/gitlab-org/gitlab-ce/issues/24386
2016-11-11 15:34:00 -03:00
Nick Thomas
2689428ac2 Fix project records with invalid visibility_level values
The AddVisibilityLevelToGroups migration introduced a visibility_level for
namespaces and specified that projects should always have a visibility level
less than or equal to their namespace. However, some invalid rows could have
been created.

This commit introduces a migration that updates the invalid rows, setting the
invalid project to have the same visibility_level as their namespaces. This
will make some projects internal or private when they would previously have
been public or internal, but this is better than silently making an internal
or private group public.
2016-11-10 17:58:31 +00:00
Yorick Peterse
83c8241160
Support for post deployment migrations
These are regular Rails migrations that are executed by default. A user
can opt-out of these migrations by setting an environment variable
during the deployment process.

Fixes gitlab-org/gitlab-ce#22133
2016-10-31 12:54:48 +01:00