Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 18:07:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 18:07:52 +0300
commit27d91a629918e417a9e87825e838209b9ace79c1 (patch)
treee066c3fc84e3011641e662252810cb2c240edb90 /db
parent5e11c9b77cb1b2b77ee29359047b55807afe255d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/03_project.rb4
-rw-r--r--db/migrate/20191129134844_add_broadcast_type_to_broadcast_message.rb19
-rw-r--r--db/schema.rb1
3 files changed, 24 insertions, 0 deletions
diff --git a/db/fixtures/development/03_project.rb b/db/fixtures/development/03_project.rb
index 33df3ed7156..596c5e81a2e 100644
--- a/db/fixtures/development/03_project.rb
+++ b/db/fixtures/development/03_project.rb
@@ -141,6 +141,10 @@ class Gitlab::Seeder::Projects
# the `after_commit` queue to ensure the job is run now.
project.send(:_run_after_commit_queue)
project.import_state.send(:_run_after_commit_queue)
+
+ # Expire repository cache after import to ensure
+ # valid_repo? call below returns a correct answer
+ project.repository.expire_all_method_caches
end
if project.valid? && project.valid_repo?
diff --git a/db/migrate/20191129134844_add_broadcast_type_to_broadcast_message.rb b/db/migrate/20191129134844_add_broadcast_type_to_broadcast_message.rb
new file mode 100644
index 00000000000..84d17f558d1
--- /dev/null
+++ b/db/migrate/20191129134844_add_broadcast_type_to_broadcast_message.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddBroadcastTypeToBroadcastMessage < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+ BROADCAST_MESSAGE_BANNER_TYPE = 1
+
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default(:broadcast_messages, :broadcast_type, :smallint, default: BROADCAST_MESSAGE_BANNER_TYPE)
+ end
+
+ def down
+ remove_column(:broadcast_messages, :broadcast_type)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e3df8af0ea0..4f94c0accfa 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -575,6 +575,7 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do
t.text "message_html", null: false
t.integer "cached_markdown_version"
t.string "target_path", limit: 255
+ t.integer "broadcast_type", limit: 2, default: 1, null: false
t.index ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id"
end