X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/141871be7be50fe092cef6c84cfc84f2393c3545..9d1da497d442b16de5ab68a9cf74f832059734e7:/cookbooks/postgresql/resources/database.rb?ds=sidebyside diff --git a/cookbooks/postgresql/resources/database.rb b/cookbooks/postgresql/resources/database.rb index c73250464..cd2d4c764 100644 --- a/cookbooks/postgresql/resources/database.rb +++ b/cookbooks/postgresql/resources/database.rb @@ -17,6 +17,8 @@ # limitations under the License. # +unified_mode true + default_action :create property :database, :kind_of => String, :name_property => true @@ -41,7 +43,11 @@ end action :drop do if cluster.databases.include?(new_resource.database) converge_by "drop database #{new_resource.database}" do - cluster.execute(:command => "DROP DATABASE \"#{new_resource.database}\"") + if cluster.version >= 13 + cluster.execute(:command => "DROP DATABASE \"#{new_resource.database}\" WITH (FORCE)") + else + cluster.execute(:command => "DROP DATABASE \"#{new_resource.database}\"") + end end end end