summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-04 13:36:36 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-04 13:36:36 +0200
commit44321b1a3d99fc1a25d4b24afef55e1755f89e8a (patch)
treeb5eee1964c7f32adb8096c07cee23c2a413640eb /db
parentb03f1699c47ce8a08f67ef458107d22cbafbc0bd (diff)
parent5efd67942cec39d733d27a52edc2ebc86babce30 (diff)
downloadgitlab-ce-44321b1a3d99fc1a25d4b24afef55e1755f89e8a.tar.gz
Merge branch 'master' into feature/multi-level-container-registry-images
* master: (57 commits) Ensure we generate unique usernames otherwise validations fail Fix a Knapsack issue that would load support/capybara.rb before support/env.rb Ensure users have a short username otherwise a click event is triggered ... Enable the `bullet_logger` setting; enable `raise` in test environment Fix Rubocop offenses Set the right timeout for Gitlab::Shell#fetch_remote Refactoring Projects::ImportService Move methods that are not related to mirroring to the repository model Fix GitHub pull request formatter spec Rename skip_metrics to imported on the importable concern Add CHANGELOG Remove unused include from RepositoryImportWorker Skip MR metrics when importing projects from GitHub Fetch GitHub project as a mirror to get all refs at once Make file templates easy to use and discover Ensure user has a unique username otherwise `user10` would match `user1` Ensure the AbuseReport fixtures create unique reported users Don't use FFaker in factories, use sequences instead Fix brittle specs Fix the AbuseReport seeder ... Conflicts: db/schema.rb
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/18_abuse_reports.rb28
-rw-r--r--db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb33
-rw-r--r--db/schema.rb3
3 files changed, 60 insertions, 4 deletions
diff --git a/db/fixtures/development/18_abuse_reports.rb b/db/fixtures/development/18_abuse_reports.rb
index 8618d10387a..88d2f784852 100644
--- a/db/fixtures/development/18_abuse_reports.rb
+++ b/db/fixtures/development/18_abuse_reports.rb
@@ -1,5 +1,27 @@
-require 'factory_girl_rails'
+module Db
+ module Fixtures
+ module Development
+ class AbuseReport
+ def self.seed
+ Gitlab::Seeder.quiet do
+ (::AbuseReport.default_per_page + 3).times do |i|
+ reported_user =
+ ::User.create!(
+ username: "reported_user_#{i}",
+ name: FFaker::Name.name,
+ email: FFaker::Internet.email,
+ confirmed_at: DateTime.now,
+ password: '12345678'
+ )
-(AbuseReport.default_per_page + 3).times do
- FactoryGirl.create(:abuse_report)
+ ::AbuseReport.create(reporter: ::User.take, user: reported_user, message: 'User sends spam')
+ print '.'
+ end
+ end
+ end
+ end
+ end
+ end
end
+
+Db::Fixtures::Development::AbuseReport.seed
diff --git a/db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb b/db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb
new file mode 100644
index 00000000000..a8affd19a0b
--- /dev/null
+++ b/db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb
@@ -0,0 +1,33 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddPollingIntervalMultiplierToApplicationSettings < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ # When a migration requires downtime you **must** uncomment the following
+ # constant and define a short and easy to understand explanation as to why the
+ # migration requires downtime.
+ # DOWNTIME_REASON = ''
+
+ # When using the methods "add_concurrent_index" or "add_column_with_default"
+ # you must disable the use of transactions as these methods can not run in an
+ # existing transaction. When using "add_concurrent_index" make sure that this
+ # method is the _only_ method called in the migration, any other changes
+ # should go in a separate migration. This ensures that upon failure _only_ the
+ # index creation fails and can be retried or reverted easily.
+ #
+ # To disable transactions uncomment the following line and remove these
+ # comments:
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default :application_settings, :polling_interval_multiplier, :decimal, default: 1, allow_null: false
+ end
+
+ def down
+ remove_column :application_settings, :polling_interval_multiplier
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 598ee70872b..3c11e68da2c 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: 20170322013926) do
+ActiveRecord::Schema.define(version: 20170329124448) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -115,6 +115,7 @@ ActiveRecord::Schema.define(version: 20170322013926) do
t.integer "unique_ips_limit_per_user"
t.integer "unique_ips_limit_time_window"
t.boolean "unique_ips_limit_enabled", default: false, null: false
+ t.decimal "polling_interval_multiplier", default: 1.0, null: false
end
create_table "audit_events", force: :cascade do |t|