Skip to content

Commit

Permalink
20240514113500_create_cnb_lifecycle_data.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
c0d1ngm0nk3y committed Jun 18, 2024
1 parent 86c5b94 commit da18b18
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions db/migrations/20240514113500_create_cnb_lifecycle_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

String :build_guid, size: 255
foreign_key [:build_guid], :builds, key: :guid, name: :fk_cnb_lifecycle_build_guid, on_delete: :cascade
add_index [:build_guid], name: :fk_cnb_lifecycle_build_guid_index, if_not_exists: true
add_index [:build_guid], name: :fk_cnb_lifecycle_build_guid_index, if_not_exists: true, concurrently: true if database_type == :postgres

String :app_guid, size: 255
add_index [:app_guid], name: :fk_cnb_lifecycle_app_guid_index, if_not_exists: true
add_index [:app_guid], name: :fk_cnb_lifecycle_app_guid_index, if_not_exists: true, concurrently: true if database_type == :postgres

String :droplet_guid, size: 255
add_index [:droplet_guid], name: :fk_cnb_lifecycle_droplet_guid_index, if_not_exists: true
add_index [:droplet_guid], name: :fk_cnb_lifecycle_droplet_guid_index, if_not_exists: true, concurrently: true if database_type == :postgres

String :stack, size: 255
end
Expand All @@ -27,13 +27,13 @@
end

VCAP::Migration.with_concurrent_timeout(self) do
add_index :buildpack_lifecycle_buildpacks, :cnb_lifecycle_data_guid, name: :bl_cnb_bldata_guid_index, concurrently: true, if_not_exists: true if database_type == :postgres
add_index :buildpack_lifecycle_buildpacks, :cnb_lifecycle_data_guid, name: :bl_cnb_bldata_guid_index, if_not_exists: true, concurrently: true if database_type == :postgres
end
end

down do
VCAP::Migration.with_concurrent_timeout(self) do
drop_index :buildpack_lifecycle_buildpacks, :cnb_lifecycle_data_guid, name: :bl_cnb_bldata_guid_index, concurrently: true, if_exists: true if database_type == :postgres
drop_index :buildpack_lifecycle_buildpacks, :cnb_lifecycle_data_guid, name: :bl_cnb_bldata_guid_index, if_exists: true, concurrently: true if database_type == :postgres
end

transaction do
Expand Down

0 comments on commit da18b18

Please sign in to comment.