diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-02-22 14:25:06 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-03-06 14:41:09 -0500 |
commit | 4c622b71fd284058deee483bf0009f8179b792bc (patch) | |
tree | 306cc2ffb5eec2d4fc972b33d14be2baf3959718 /db/migrate | |
parent | 2a2b24d5a7687abf7e7517eb011ba427852d6df0 (diff) | |
download | gitlab-ce-4c622b71fd284058deee483bf0009f8179b792bc.tar.gz |
Add Upload model and UploadChecksumWorker worker
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170130221926_create_uploads.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20170130221926_create_uploads.rb b/db/migrate/20170130221926_create_uploads.rb new file mode 100644 index 00000000000..6f06c5dd840 --- /dev/null +++ b/db/migrate/20170130221926_create_uploads.rb @@ -0,0 +1,20 @@ +class CreateUploads < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :uploads do |t| + t.integer :size, limit: 8, null: false + t.string :path, null: false + t.string :checksum, limit: 64 + t.references :model, polymorphic: true + t.string :uploader, null: false + t.datetime :created_at, null: false + end + + add_index :uploads, :path + add_index :uploads, :checksum + add_index :uploads, [:model_id, :model_type] + end +end |