pg_spec_helper 1.9.9 → 1.9.11

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: eab4f11bd8ca2e846f2298687482bf2d28d6caabbd36515c7eebf9edef8663b0
4
- data.tar.gz: e45ab0b87e3ebe1fdc515e4e28a92a116dd11c295584b4cac67ecc13e71b0425
3
+ metadata.gz: 72b2fec5101ae1255ade32d6f1c255d312571bf737b3c4380d868a66287fb1e7
4
+ data.tar.gz: 40373357e82222f4b8a69d553db832683a6cf66fed626938032be2cbe2dd9aa2
5
5
  SHA512:
6
- metadata.gz: b22f267ab7ad3e6e495cb92334094ace7b2304c054ab55bdec04561b339c2163afe9391170d04263c2683292ab3dcd8f239aa9d25fdcd953f7ed81b8ab566f29
7
- data.tar.gz: 36e4342f390c36b28eb21a8a95a7e9b921529258561f1409e2689aadab4db7617bef8a73b0319a7a404dbc21195ae66edee378beba17bf37f28a85a159a5265c
6
+ metadata.gz: f5822433af51aa0b2d3b22e746b238a4c39cc998729c11a76e889cc5746363998b6462d33eeb3d65392869d96f4c3282053a71e813b3e8c0b669335ddd23ed70
7
+ data.tar.gz: 9f0b3d6ebbbbea4e26d1a6727b4243b7f45d5501afd44091599560541e6fe9ab86fcf94b18ec550361190d74ee5929f95d9cbc99ddee4c57a105d476527faf61
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.11](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.10...v1.9.11) (2023-09-01)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * automatically add the citext extension if a column requires it ([0282269](https://github.com/craigulliott/pg_spec_helper/commit/028226916532ec135c47fe59540f556203d9964f))
9
+
10
+ ## [1.9.10](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.9...v1.9.10) (2023-08-25)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * suppressing warning message about extension already exists ([65a9023](https://github.com/craigulliott/pg_spec_helper/commit/65a9023eecbb6ea8697b80791efd5003e6184fa8))
16
+
3
17
  ## [1.9.9](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.8...v1.9.9) (2023-08-24)
4
18
 
5
19
 
@@ -7,6 +7,17 @@ class PGSpecHelper
7
7
 
8
8
  # create a column for the provided table
9
9
  def create_column schema_name, table_name, column_name, type, null = true, default = nil
10
+ # required extension for citext
11
+ if type.to_sym == :citext
12
+ connection.exec(<<~SQL)
13
+ -- temporarily set the client_min_messages to WARNING to
14
+ -- suppress the NOTICE messages about extension already existing
15
+ SET client_min_messages TO WARNING;
16
+ CREATE EXTENSION IF NOT EXISTS "citext";
17
+ SET client_min_messages TO NOTICE;
18
+ SQL
19
+ end
20
+
10
21
  # note the `type` is safe from sql_injection due to the validation above
11
22
  connection.exec(<<~SQL)
12
23
  ALTER TABLE #{connection.quote_ident schema_name.to_s}.#{connection.quote_ident table_name.to_s}
@@ -17,7 +17,11 @@ class PGSpecHelper
17
17
  create_table schema_name, table_name
18
18
  # required for auto increment
19
19
  connection.exec(<<~SQL)
20
+ -- temporarily set the client_min_messages to WARNING to
21
+ -- suppress the NOTICE messages about extension already existing
22
+ SET client_min_messages TO WARNING;
20
23
  CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
24
+ SET client_min_messages TO NOTICE;
21
25
  SQL
22
26
  # create the standard columns
23
27
  create_column schema_name, table_name, :id, :uuid, false, "uuid_generate_v4()"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PGSpecHelper
4
- VERSION = "1.9.9"
4
+ VERSION = "1.9.11"
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.9
4
+ version: 1.9.11
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-24 00:00:00.000000000 Z
11
+ date: 2023-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg