pg_spec_helper 1.9.8 → 1.9.10

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: 718445dba71c4a5574251f19ca1da659e7961e065467d94cc2b1375661edb340
4
- data.tar.gz: 1005b96612ed0402a9724c2a9acceb8a2c5d4e8feda8a8ab37a9f7fe73de101c
3
+ metadata.gz: 18c3f281f5220ac541ecdff460921d5256d698cde0dfabb9a5522802b9c99cb3
4
+ data.tar.gz: 45a6ad92ec2637d058ae2978572464e25b3f9153ef543671f49b532a11fc1b3d
5
5
  SHA512:
6
- metadata.gz: 87c640fcf85228a1bc97fd1dbb34b2b15fe65aa4c5cf7e89aa7ce8a60bea86686009f0796cd107b2e7a9088f30e88575c20aa8144628939afbc71a28a0acb534
7
- data.tar.gz: 0e5a77f800f9cbf9532eeec39f20a7b6821dafeb28565a21ebae3786f1afc81222839f34e7489e80b8889c7652fe5410d047fe4bcecd70fd70c97e117bf1fc45
6
+ metadata.gz: f071cc5f3bda777b7673346cb916230a65375ccb29d1496a106cc2b37d1c18de2be388c59991e144891c67d09156e19c9c64cc90e5e1150ec8fbe019f545a1ca
7
+ data.tar.gz: b12991673a455dc4bbded79ffe4e222b8322295aa57468d68634ceaf7d4db746a90fd588a31e5966276889835ad2c2bd88ef95e0887dc15db11c76783889aa63
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.10](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.9...v1.9.10) (2023-08-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * suppressing warning message about extension already exists ([65a9023](https://github.com/craigulliott/pg_spec_helper/commit/65a9023eecbb6ea8697b80791efd5003e6184fa8))
9
+
10
+ ## [1.9.9](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.8...v1.9.9) (2023-08-24)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * creating model now sets correct null and default values ([2e4634e](https://github.com/craigulliott/pg_spec_helper/commit/2e4634ebac8bf52e7eca497e891e492179f6b98e))
16
+
3
17
  ## [1.9.8](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.7...v1.9.8) (2023-08-24)
4
18
 
5
19
 
@@ -9,7 +9,6 @@ class PGSpecHelper
9
9
  def create_column schema_name, table_name, column_name, type, null = true, default = nil
10
10
  # note the `type` is safe from sql_injection due to the validation above
11
11
  connection.exec(<<~SQL)
12
- create extension if not exists "uuid-ossp";
13
12
  ALTER TABLE #{connection.quote_ident schema_name.to_s}.#{connection.quote_ident table_name.to_s}
14
13
  ADD COLUMN #{connection.quote_ident column_name.to_s} #{type}
15
14
  #{null ? "" : "NOT NULL"}
@@ -15,8 +15,16 @@ class PGSpecHelper
15
15
  end
16
16
  # create the table
17
17
  create_table schema_name, table_name
18
+ # required for auto increment
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;
23
+ CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
24
+ SET client_min_messages TO NOTICE;
25
+ SQL
18
26
  # create the standard columns
19
- create_column schema_name, table_name, :id, :uuid, null: false, default: "uuid_generate_v4()"
27
+ create_column schema_name, table_name, :id, :uuid, false, "uuid_generate_v4()"
20
28
  create_column schema_name, table_name, :created_at, :timestamp
21
29
  create_column schema_name, table_name, :updated_at, :timestamp
22
30
  # add the primary key
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PGSpecHelper
4
- VERSION = "1.9.8"
4
+ VERSION = "1.9.10"
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.8
4
+ version: 1.9.10
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-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg