summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-09-07 21:27:04 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2018-02-28 20:29:37 +0100
commitbc76062774f01208403685965f4d780da4e03ebb (patch)
treee9e21e57b8783f25475648889372f4c3aed4eb3b /db
parent5a69b51bc870f5b42ee3406ba77de02f44ef8d32 (diff)
downloadgitlab-ce-bc76062774f01208403685965f4d780da4e03ebb.tar.gz
Merge branch 'jej/lfs-object-storage' into 'master'
Can migrate LFS objects to S3 style object storage Closes #2841 See merge request !2760
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170825015534_add_file_store_to_lfs_objects.rb35
-rw-r--r--db/schema.rb1
2 files changed, 36 insertions, 0 deletions
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 74634d14ccb..9f293205a24 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -741,6 +741,7 @@ ActiveRecord::Schema.define(version: 20170905112933) 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