pg_spec_helper 1.9.0 → 1.9.2

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: 111948cb669c62fe5e30ff56765ec20856dc53493a87a16304087068dfae8e2e
4
- data.tar.gz: 56df8e6b579bb74df75be7e5b8e5a62b2db35ef737d084f92706982e5e39a032
3
+ metadata.gz: f961a6b7a9074ea8c300e1a1ebe2214803f471447041831880c288f8f9124ba0
4
+ data.tar.gz: ae3dd1a3af18f3d0453ce3340884d1b2194c2903c35c105fa7830fa257215911
5
5
  SHA512:
6
- metadata.gz: a03eb171d281e9689c2e4bc1928845a3014e4a1f411f2c6419150bf617ce3fab4d4a6c9e9de8daa1ce885a65daa9e82310bcc92b9b61152eea1b8d1afa6f260a
7
- data.tar.gz: e2749f90e7d1dab240f19548de538095d378a62b1b98ae6c69be64866a07fa267175ead068be77fbd15f1f70af514a4a7fa63974e9c8aec1bf8b3962dd8c06cd
6
+ metadata.gz: 77e9df5f514da0c15b122b70df99bf577c764f01ffc5a2a812c9c474a19528d5047a9329c4a8800833637cec7e28924333d1532df1e8547eaa8afefffde8c93e
7
+ data.tar.gz: b9fef3126817ff75c269c9f9b9620d60a762875409a6dd898c1750b25c8390a7b66011b7ae40f24e440e22d798005ad3b490fe4e51e1cc88c75d380072c15cac
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.2](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.1...v1.9.2) (2023-08-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * actually deleting and recreating the public schema as part of the reset, this ensures we remove all functions and enums too ([5dd70c9](https://github.com/craigulliott/pg_spec_helper/commit/5dd70c93eb3754a3e84161dc571e3a39b814f34c))
9
+
10
+ ## [1.9.1](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.0...v1.9.1) (2023-08-23)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * track use of functions, triggers and enums so we erase the database correctly between tests ([c705a0d](https://github.com/craigulliott/pg_spec_helper/commit/c705a0defe011c715de18c10f16861a02308122b))
16
+
3
17
  ## [1.9.0](https://github.com/craigulliott/pg_spec_helper/compare/v1.8.5...v1.9.0) (2023-08-21)
4
18
 
5
19
 
@@ -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 except public
30
- get_schema_names.reject { |schema_name| schema_name == :public }.each do |schema_name|
29
+ # delete all schemas including public
30
+ get_schema_names.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,8 @@ class PGSpecHelper
36
36
  SET client_min_messages TO NOTICE;
37
37
  SQL
38
38
  end
39
- # delete all the tables from within the public schema
40
- delete_tables :public
39
+ # recreate the public schema
40
+ create_schema :public
41
41
  end
42
42
 
43
43
  def schema_exists? schema_name
@@ -18,7 +18,10 @@ class PGSpecHelper
18
18
  :create_index,
19
19
  :create_primary_key,
20
20
  :create_unique_constraint,
21
- :create_validation
21
+ :create_validation,
22
+ :create_function,
23
+ :create_trigger,
24
+ :create_enum
22
25
  ]
23
26
 
24
27
  # returns true if any changes have been made to the database structure
@@ -63,11 +66,11 @@ class PGSpecHelper
63
66
  # keep a pointer to the original method
64
67
  original_method = self.class.instance_method(method_name)
65
68
  # ovveride the original method
66
- self.class.define_method(method_name) do |*args|
69
+ self.class.define_method(method_name) do |*args, **kwargs|
67
70
  # note that this method was called
68
71
  track_change method_name
69
72
  # call the original method
70
- original_method.bind_call(self, *args)
73
+ original_method.bind_call(self, *args, **kwargs)
71
74
  # do any materialized views need to be refreshed?
72
75
  refresh_materialized_views_by_method method_name
73
76
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PGSpecHelper
4
- VERSION = "1.9.0"
4
+ VERSION = "1.9.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_spec_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg