Move allow developers to create projects in groups to Core
What does this MR do?
https://gitlab.com/gitlab-org/gitlab-ce/issues/44959
Move allow developers to create projects in groups to Core
EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10057
Database checklist
- Conforms to the database guides
When adding migrations:
-
Updated
db/schema.rb -
Added a
downmethod so the migration can be reverted - Added the output of the migration(s) to the MR body
-
Added tests for the migration in
spec/migrationsif necessary (e.g. when migrating data)
When adding or modifying queries to improve performance:
- Included data that shows the performance improvement, preferably in the form of a benchmark
-
Included the output of
EXPLAIN (ANALYZE, BUFFERS)of the relevant queries
When adding foreign keys to existing tables:
- Included a migration to remove orphaned rows in the source table before adding the foreign key
-
Removed any instances of
dependent: ...that may no longer be necessary
When adding tables:
- Ordered columns based on the Ordering Table Columns guidelines
- Added foreign keys to any columns pointing to data in other tables
- Added indexes for fields that are used in statements such as WHERE, ORDER BY, GROUP BY, and JOINs
When removing columns, tables, indexes or other structures:
- Removed these in a post-deployment migration
- Made sure the application no longer uses (or ignores) these structures
General checklist
- Changelog entry added, if necessary
- Documentation created/updated
- Tests added for this feature/bug
- Conforms to the code review guidelines
- Conforms to the merge request performance guidelines
- Conforms to the style guides
Migration output
== 20190311132500 AddDefaultProjectCreationSetting: migrating =================
-- column_exists?(:application_settings, :default_project_creation)
-> 0.0108s
-- transaction_open?()
-> 0.0000s
-- execute("SET statement_timeout TO 0")
-> 0.0109s
-- transaction()
-- add_column(:application_settings, :default_project_creation, :integer, {:default=>nil})
-> 0.0016s
-- change_column_default(:application_settings, :default_project_creation, 2)
-> 0.0090s
-> 0.0119s
-- transaction_open?()
-> 0.0000s
-- exec_query("SELECT COUNT(*) AS count FROM \"application_settings\"")
-> 0.0010s
-- exec_query("SELECT \"application_settings\".\"id\" FROM \"application_settings\" ORDER BY \"application_settings\".\"id\" ASC LIMIT 1")
-> 0.0020s
-- exec_query("SELECT \"application_settings\".\"id\" FROM \"application_settings\" WHERE \"application_settings\".\"id\" >= 1 ORDER BY \"application_settings\".\"id\" ASC LIMIT 1 OFFSET 1")
-> 0.0006s
-- execute("UPDATE \"application_settings\" SET \"default_project_creation\" = 2 WHERE \"application_settings\".\"id\" >= 1")
-> 0.0009s
-- change_column_null(:application_settings, :default_project_creation, false)
-> 0.0013s
-- execute("RESET ALL")
-> 0.0003s
== 20190311132500 AddDefaultProjectCreationSetting: migrated (0.0490s) ========
== 20190311132527 AddProjectCreationLevelToNamespaces: migrating ==============
-- column_exists?(:namespaces, :project_creation_level)
-> 0.0017s
-- add_column(:namespaces, :project_creation_level, :integer)
-> 0.0006s
== 20190311132527 AddProjectCreationLevelToNamespaces: migrated (0.0023s) =====