diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-11-10 04:17:56 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-12-02 02:26:41 +0300 |
commit | a210cb6b827d9d918788578fc4ae956471de3b12 (patch) | |
tree | 0f12a11456af5faad95fb601d3300683a4742478 /db | |
parent | 2ab3031bd35213802e508fef6eebceaaf40cee9b (diff) |
Rename table to untracked_files_for_uploads
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20171103140253_track_untracked_uploads.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/db/post_migrate/20171103140253_track_untracked_uploads.rb b/db/post_migrate/20171103140253_track_untracked_uploads.rb index 90d530d4011..5e4e357b8bc 100644 --- a/db/post_migrate/20171103140253_track_untracked_uploads.rb +++ b/db/post_migrate/20171103140253_track_untracked_uploads.rb @@ -7,31 +7,31 @@ class TrackUntrackedUploads < ActiveRecord::Migration disable_ddl_transaction! DOWNTIME = false - MIGRATION = 'PrepareUnhashedUploads' + MIGRATION = 'PrepareUntrackedUploads' def up - unless table_exists?(:unhashed_upload_files) - create_table :unhashed_upload_files do |t| + unless table_exists?(:untracked_files_for_uploads) + create_table :untracked_files_for_uploads do |t| t.string :path, null: false t.boolean :tracked, default: false, null: false t.timestamps_with_timezone null: false end end - unless index_exists?(:unhashed_upload_files, :path) - add_index :unhashed_upload_files, :path, unique: true + unless index_exists?(:untracked_files_for_uploads, :path) + add_index :untracked_files_for_uploads, :path, unique: true end - unless index_exists?(:unhashed_upload_files, :tracked) - add_index :unhashed_upload_files, :tracked + unless index_exists?(:untracked_files_for_uploads, :tracked) + add_index :untracked_files_for_uploads, :tracked end BackgroundMigrationWorker.perform_async(MIGRATION) end def down - if table_exists?(:unhashed_upload_files) - drop_table :unhashed_upload_files + if table_exists?(:untracked_files_for_uploads) + drop_table :untracked_files_for_uploads end end end diff --git a/db/schema.rb b/db/schema.rb index 2b7e12b45f1..e193d569739 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1719,15 +1719,15 @@ ActiveRecord::Schema.define(version: 20171124150326) do add_index "u2f_registrations", ["key_handle"], name: "index_u2f_registrations_on_key_handle", using: :btree add_index "u2f_registrations", ["user_id"], name: "index_u2f_registrations_on_user_id", using: :btree - create_table "unhashed_upload_files", force: :cascade do |t| + create_table "untracked_files_for_uploads", force: :cascade do |t| t.string "path", null: false t.boolean "tracked", default: false, null: false t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "updated_at", null: false end - add_index "unhashed_upload_files", ["path"], name: "index_unhashed_upload_files_on_path", unique: true, using: :btree - add_index "unhashed_upload_files", ["tracked"], name: "index_unhashed_upload_files_on_tracked", using: :btree + add_index "untracked_files_for_uploads", ["path"], name: "index_untracked_files_for_uploads_on_path", unique: true, using: :btree + add_index "untracked_files_for_uploads", ["tracked"], name: "index_untracked_files_for_uploads_on_tracked", using: :btree create_table "uploads", force: :cascade do |t| t.integer "size", limit: 8, null: false |