Skip to content

Commit

Permalink
chore: split index migrations into up and down
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 5, 2023
1 parent 21ce787 commit 2115a96
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
include PactBroker::MigrationHelper

Sequel.migration do
change do
up do
if !mysql?
alter_table(:released_versions) do
add_index(:version_id, name: "released_versions_version_id_ndx")
end
end
end

down do
if !mysql?
alter_table(:released_versions) do
drop_index(:version_id, name: "released_versions_version_id_ndx")
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
include PactBroker::MigrationHelper

Sequel.migration do
change do
up do
if !mysql?
alter_table(:deployed_versions) do
add_index(:version_id, name: "deployed_versions_version_id_ndx")
end
end
end

down do
if !mysql?
alter_table(:deployed_versions) do
drop_index(:version_id, name: "deployed_versions_version_id_ndx")
end
end
end
end

0 comments on commit 2115a96

Please sign in to comment.