Merge index during table creation
This commit is contained in:
parent
e58ce2b72e
commit
92e8ad5247
|
@ -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
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
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 @@
|
||||||
#
|
#
|
||||||
# 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"
|
||||||
|
|
Loading…
Reference in New Issue