Skip to content
Snippets Groups Projects
Commit 92e8ad52 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Merge index during table creation

parent e58ce2b7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -17,6 +17,7 @@ class CreateJobArtifacts < ActiveRecord::Migration
t.string :file
 
t.foreign_key :ci_builds, column: :job_id, on_delete: :cascade
t.index [:job_id, :file_type], unique: true
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
Loading
Loading
@@ -11,7 +11,7 @@
#
# 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
enable_extension "plpgsql"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment