pg_spec_helper 1.9.2 → 1.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f961a6b7a9074ea8c300e1a1ebe2214803f471447041831880c288f8f9124ba0
4
- data.tar.gz: ae3dd1a3af18f3d0453ce3340884d1b2194c2903c35c105fa7830fa257215911
3
+ metadata.gz: b4aa2aee2053fb4f9a129d26cb0312b6661012bdfb7c2204d89be74533459421
4
+ data.tar.gz: 75e5870dfba01ac6b8dd545315d2f0d0131d02b0c4908e35e5c967c702ff97ca
5
5
  SHA512:
6
- metadata.gz: 77e9df5f514da0c15b122b70df99bf577c764f01ffc5a2a812c9c474a19528d5047a9329c4a8800833637cec7e28924333d1532df1e8547eaa8afefffde8c93e
7
- data.tar.gz: b9fef3126817ff75c269c9f9b9620d60a762875409a6dd898c1750b25c8390a7b66011b7ae40f24e440e22d798005ad3b490fe4e51e1cc88c75d380072c15cac
6
+ metadata.gz: b76f0a2b4f6d97a5ce7d7fb08b4a3e9b85a564db9b96f0a48db240ba3150ba9f83460a2e71e1523287d15134bef257698796cc3fd094d7e8035a9b77d7512689
7
+ data.tar.gz: f9c007962259c976c856b75fd2922bbbf45e200a1179f4c8ec306d01033df905933af83124713042b225792ce4f6f882b6f3f1c486077e5b5db6fcda0e58ce32
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.4](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.3...v1.9.4) (2023-08-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * deleting enums and triggers instead of removing the public schema because it may have materialized views in it ([d9a4efc](https://github.com/craigulliott/pg_spec_helper/commit/d9a4efc2c56c2971151efffb5fe2b1d079deb75b))
9
+
10
+ ## [1.9.3](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.2...v1.9.3) (2023-08-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * deleting enums and triggers instead of removing the public schema, because it may have materialized views in it ([34a8afa](https://github.com/craigulliott/pg_spec_helper/commit/34a8afae9cca995ba8950d7d54ad377869901c19))
16
+
3
17
  ## [1.9.2](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.1...v1.9.2) (2023-08-23)
4
18
 
5
19
 
@@ -28,5 +28,14 @@ class PGSpecHelper
28
28
  SQL
29
29
  rows.map { |row| row["enum_name"].to_sym }
30
30
  end
31
+
32
+ # delete all enums in the provided schema
33
+ def delete_enums schema_name
34
+ get_enum_names(schema_name).each do |enum_name|
35
+ connection.exec(<<~SQL)
36
+ DROP TYPE #{schema_name}.#{enum_name};
37
+ SQL
38
+ end
39
+ end
31
40
  end
32
41
  end
@@ -23,5 +23,14 @@ class PGSpecHelper
23
23
  SQL
24
24
  rows.map { |r| r["routine_name"].to_sym }
25
25
  end
26
+
27
+ # delete all functions in the provided schema
28
+ def delete_functions schema_name
29
+ get_function_names(schema_name).each do |function_name|
30
+ connection.exec(<<~SQL)
31
+ DROP FUNCTION #{schema_name}.#{function_name};
32
+ SQL
33
+ end
34
+ end
26
35
  end
27
36
  end
@@ -26,8 +26,8 @@ class PGSpecHelper
26
26
 
27
27
  # delete all schemas in the database
28
28
  def delete_all_schemas
29
- # delete all schemas including public
30
- get_schema_names.each do |schema_name|
29
+ # delete all schemas except public
30
+ get_schema_names.reject { |schema_name| schema_name == :public }.each do |schema_name|
31
31
  connection.exec(<<~SQL)
32
32
  -- temporarily set the client_min_messages to WARNING to
33
33
  -- suppress the NOTICE messages about cascading deletes
@@ -36,8 +36,10 @@ class PGSpecHelper
36
36
  SET client_min_messages TO NOTICE;
37
37
  SQL
38
38
  end
39
- # recreate the public schema
40
- create_schema :public
39
+ # delete all the tables, functions and enums from within the public schema
40
+ delete_tables :public
41
+ delete_functions :public
42
+ delete_enums :public
41
43
  end
42
44
 
43
45
  def schema_exists? schema_name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PGSpecHelper
4
- VERSION = "1.9.2"
4
+ VERSION = "1.9.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_spec_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott