Commit 89eeb6de authored by Kamil Trzcinski's avatar Kamil Trzcinski

Merge index during table creation

parent b9f4c623
...@@ -17,6 +17,7 @@ class CreateJobArtifacts < ActiveRecord::Migration ...@@ -17,6 +17,7 @@ class CreateJobArtifacts < ActiveRecord::Migration
t.string :file t.string :file
t.foreign_key :ci_builds, column: :job_id, on_delete: :cascade t.foreign_key :ci_builds, column: :job_id, on_delete: :cascade
t.index [:job_id, :file_type], unique: true
end end
end end
end end
class UniquenessContraintJobArtifactFileType < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :ci_job_artifacts, [:job_id, :file_type], unique: true
end
def down
remove_concurrent_index :ci_job_artifacts, [:job_id, :file_type]
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20171130145523) do ActiveRecord::Schema.define(version: 20171124150326) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment