diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb | 17 | ||||
| -rw-r--r-- | db/migrate/20170825015534_add_file_store_to_lfs_objects.rb | 35 | ||||
| -rw-r--r-- | db/schema.rb | 3 |
3 files changed, 55 insertions, 0 deletions
diff --git a/db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb b/db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb new file mode 100644 index 00000000000..deba890a478 --- /dev/null +++ b/db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb @@ -0,0 +1,17 @@ +class AddArtifactsStoreToCiBuild < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column_with_default(:ci_builds, :artifacts_file_store, :integer, default: 1) + add_column_with_default(:ci_builds, :artifacts_metadata_store, :integer, default: 1) + end + + def down + remove_column(:ci_builds, :artifacts_file_store) + remove_column(:ci_builds, :artifacts_metadata_store) + end +end diff --git a/db/migrate/20170825015534_add_file_store_to_lfs_objects.rb b/db/migrate/20170825015534_add_file_store_to_lfs_objects.rb new file mode 100644 index 00000000000..4d459ccab2c --- /dev/null +++ b/db/migrate/20170825015534_add_file_store_to_lfs_objects.rb @@ -0,0 +1,35 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddFileStoreToLfsObjects < 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", "remove_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" or "remove_concurrent_index" methods make sure + # that either of them 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 or removing 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(:lfs_objects, :file_store, :integer) + end + + def down + remove_column(:lfs_objects, :file_store) + end +end diff --git a/db/schema.rb b/db/schema.rb index 4c697a4a384..8846bbd975c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -287,6 +287,8 @@ ActiveRecord::Schema.define(version: 20171205190711) do t.integer "auto_canceled_by_id" t.boolean "retried" t.integer "stage_id" + t.integer "artifacts_file_store", default: 1, null: false + t.integer "artifacts_metadata_store", default: 1, null: false t.boolean "protected" t.integer "failure_reason" end @@ -947,6 +949,7 @@ ActiveRecord::Schema.define(version: 20171205190711) do t.datetime "created_at" t.datetime "updated_at" t.string "file" + t.integer "file_store" end add_index "lfs_objects", ["oid"], name: "index_lfs_objects_on_oid", unique: true, using: :btree |
