diff options
Diffstat (limited to 'db')
9 files changed, 90 insertions, 6 deletions
diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb index 213c8bca639..51e69879c79 100644 --- a/db/fixtures/development/04_project.rb +++ b/db/fixtures/development/04_project.rb @@ -67,6 +67,10 @@ Sidekiq::Testing.inline! do skip_disk_validation: true } + if i % 2 == 0 + params[:storage_version] = Project::LATEST_STORAGE_VERSION + end + project = Projects::CreateService.new(User.first, params).execute # Seed-Fu runs this entire fixture in a transaction, so the `after_commit` # hook won't run until after the fixture is loaded. That is too late diff --git a/db/fixtures/development/08_settings.rb b/db/fixtures/development/08_settings.rb new file mode 100644 index 00000000000..141465c06cf --- /dev/null +++ b/db/fixtures/development/08_settings.rb @@ -0,0 +1,7 @@ +# We want to enable hashed storage for every new project in development +# Details https://gitlab.com/gitlab-org/gitlab-ce/issues/46241 +Gitlab::Seeder.quiet do + ApplicationSetting.create_from_defaults unless ApplicationSetting.current_without_cache + ApplicationSetting.current_without_cache.update!(hashed_storage_enabled: true) + print '.' +end diff --git a/db/migrate/20170925184228_add_favicon_to_appearances.rb b/db/migrate/20170925184228_add_favicon_to_appearances.rb new file mode 100644 index 00000000000..65083733afb --- /dev/null +++ b/db/migrate/20170925184228_add_favicon_to_appearances.rb @@ -0,0 +1,7 @@ +class AddFaviconToAppearances < ActiveRecord::Migration + DOWNTIME = false + + def change + add_column :appearances, :favicon, :string + end +end diff --git a/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb b/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb index 975bdfe70f4..41bc7b71694 100644 --- a/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb +++ b/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb @@ -6,10 +6,12 @@ class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration disable_ddl_transaction! def up - rename_column_concurrently :merge_requests, :allow_maintainer_to_push, :allow_collaboration + # NOOP end def down - cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push + if column_exists?(:merge_requests, :allow_collaboration) + cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end end end diff --git a/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb b/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb new file mode 100644 index 00000000000..6f50d428965 --- /dev/null +++ b/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb @@ -0,0 +1,19 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddDeployStrategyToProjectAutoDevops < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column_with_default :project_auto_devops, :deploy_strategy, :integer, default: 0, allow_null: false + end + + def down + remove_column :project_auto_devops, :deploy_strategy + end +end diff --git a/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb new file mode 100644 index 00000000000..dcbbef9bd4a --- /dev/null +++ b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb @@ -0,0 +1,21 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RenameMergeRequestsAllowCollaboration < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + disable_ddl_transaction! + + def up + if column_exists?(:merge_requests, :allow_collaboration) + rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end + end + + def down + # NOOP + end +end diff --git a/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb index b9ce4600675..7301bcf2c6c 100644 --- a/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb +++ b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb @@ -6,10 +6,12 @@ class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration disable_ddl_transaction! def up - cleanup_concurrent_column_rename :merge_requests, :allow_maintainer_to_push, :allow_collaboration + # NOOP end def down - rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push + if column_exists?(:merge_requests, :allow_collaboration) + rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end end end diff --git a/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb b/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb new file mode 100644 index 00000000000..3f3edb8ea3d --- /dev/null +++ b/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb @@ -0,0 +1,20 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class CleanupMergeRequestsAllowCollaborationRename < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + if column_exists?(:merge_requests, :allow_collaboration) + cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end + end + + def down + # NOOP + end +end diff --git a/db/schema.rb b/db/schema.rb index f6fb1c92f8d..d05c6afbb9f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180603190921) do +ActiveRecord::Schema.define(version: 20180608201435) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -38,6 +38,7 @@ ActiveRecord::Schema.define(version: 20180603190921) do t.integer "cached_markdown_version" t.text "new_project_guidelines" t.text "new_project_guidelines_html" + t.string "favicon" end create_table "application_setting_terms", force: :cascade do |t| @@ -1230,8 +1231,8 @@ ActiveRecord::Schema.define(version: 20180603190921) do t.boolean "discussion_locked" t.integer "latest_merge_request_diff_id" t.string "rebase_commit_sha" - t.boolean "allow_collaboration" t.boolean "squash", default: false, null: false + t.boolean "allow_maintainer_to_push" end add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree @@ -1493,6 +1494,7 @@ ActiveRecord::Schema.define(version: 20180603190921) do t.datetime_with_timezone "updated_at", null: false t.boolean "enabled" t.string "domain" + t.integer "deploy_strategy", default: 0, null: false end add_index "project_auto_devops", ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true, using: :btree |