diff options
author | James Edwards-Jones <jamedjo@gmail.com> | 2017-02-06 15:12:27 +0000 |
---|---|---|
committer | James Edwards-Jones <jamedjo@gmail.com> | 2017-02-06 15:12:27 +0000 |
commit | b988faaf85c8e68d501f242b980e5e79a00e2b15 (patch) | |
tree | faffbfe623bfcbfe1c09bddac00b2cc879baff63 /db | |
parent | 5af4cae544c8526de63e639bd6c7db730526add3 (diff) | |
parent | 53db7d1d75e1d14cb20278bd0c1a75ce24a6626d (diff) | |
download | gitlab-ce-b988faaf85c8e68d501f242b980e5e79a00e2b15.tar.gz |
Merge branch 'master' into 'jej-pages-to-ce'jej-pages-to-ce
# Conflicts:
# db/schema.rb
Diffstat (limited to 'db')
4 files changed, 64 insertions, 1 deletions
diff --git a/db/migrate/20170126174819_add_terminal_max_session_time_to_application_settings.rb b/db/migrate/20170126174819_add_terminal_max_session_time_to_application_settings.rb new file mode 100644 index 00000000000..334f53f9145 --- /dev/null +++ b/db/migrate/20170126174819_add_terminal_max_session_time_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 AddTerminalMaxSessionTimeToApplicationSettings < 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, :terminal_max_session_time, :integer, default: 0, allow_null: false + end + + def down + remove_column :application_settings, :terminal_max_session_time + end +end diff --git a/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb b/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb new file mode 100644 index 00000000000..0ee4229d1f8 --- /dev/null +++ b/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb @@ -0,0 +1,17 @@ +class RemoveBacklogListsFromBoards < ActiveRecord::Migration + DOWNTIME = false + + def up + execute <<-SQL + DELETE FROM lists WHERE list_type = 0; + SQL + end + + def down + execute <<-SQL + INSERT INTO lists (board_id, list_type, created_at, updated_at) + SELECT boards.id, 0, NOW(), NOW() + FROM boards; + SQL + end +end diff --git a/db/migrate/20170204181513_add_index_to_labels_for_type_and_project.rb b/db/migrate/20170204181513_add_index_to_labels_for_type_and_project.rb new file mode 100644 index 00000000000..8f944930807 --- /dev/null +++ b/db/migrate/20170204181513_add_index_to_labels_for_type_and_project.rb @@ -0,0 +1,11 @@ +class AddIndexToLabelsForTypeAndProject < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def change + add_concurrent_index :labels, [:type, :project_id] + end +end diff --git a/db/schema.rb b/db/schema.rb index 50f723a1a0b..1099397824d 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: 20170130204620) do +ActiveRecord::Schema.define(version: 20170204181513) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -110,6 +110,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do t.string "plantuml_url" t.boolean "plantuml_enabled" t.integer "max_pages_size", default: 100, null: false + t.integer "terminal_max_session_time", default: 0, null: false end create_table "audit_events", force: :cascade do |t| @@ -577,6 +578,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do end add_index "labels", ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true, using: :btree + add_index "labels", ["type", "project_id"], name: "index_labels_on_type_and_project_id", using: :btree create_table "lfs_objects", force: :cascade do |t| t.string "oid", null: false |