Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-11-15 16:19:07 +0300
committerMichael Kozono <mkozono@gmail.com>2017-12-02 02:26:41 +0300
commit87529ce5823036d4b9dd9ca412643befc8e490c3 (patch)
treef6c93c6f7f46eb46a5548a5dc90a56e267ff3492 /db/post_migrate
parent10c660be007406533e48d5e3c6485ecf210e051b (diff)
Move temp table creation into the prepare job
* Hopefully fixes spec failures in which the table doesn’t exist * Decouples the background migration from the post-deploy migration, e.g. we could easily run it again even though the table is dropped when finished.
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20171103140253_track_untracked_uploads.rb20
1 files changed, 0 insertions, 20 deletions
diff --git a/db/post_migrate/20171103140253_track_untracked_uploads.rb b/db/post_migrate/20171103140253_track_untracked_uploads.rb
index 7a34abc85ee..548a94d2d38 100644
--- a/db/post_migrate/20171103140253_track_untracked_uploads.rb
+++ b/db/post_migrate/20171103140253_track_untracked_uploads.rb
@@ -10,8 +10,6 @@ class TrackUntrackedUploads < ActiveRecord::Migration
MIGRATION = 'PrepareUntrackedUploads'
def up
- ensure_temporary_tracking_table_exists
-
BackgroundMigrationWorker.perform_async(MIGRATION)
end
@@ -20,22 +18,4 @@ class TrackUntrackedUploads < ActiveRecord::Migration
drop_table :untracked_files_for_uploads
end
end
-
- def ensure_temporary_tracking_table_exists
- unless table_exists?(:untracked_files_for_uploads)
- create_table :untracked_files_for_uploads do |t|
- t.string :path, limit: 600, null: false
- t.boolean :tracked, default: false, null: false
- t.timestamps_with_timezone null: false
- end
- end
-
- unless index_exists?(:untracked_files_for_uploads, :path)
- add_index :untracked_files_for_uploads, :path, unique: true
- end
-
- unless index_exists?(:untracked_files_for_uploads, :tracked)
- add_index :untracked_files_for_uploads, :tracked
- end
- end
end