pg_spec_helper 1.9.5 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8d62acbd1ea6d5a00f4255938077a50e58f4f80bc014dc43c5bc373d646a162
4
- data.tar.gz: 3dabe0757237b7280bd22c2bb244936aabbe1ad14a080e5887348b5951167c45
3
+ metadata.gz: e3b62da006b35dbea8daca7fdd3bd4d3e13ce98492f58d482e652b79d97b3f8f
4
+ data.tar.gz: 3f4220fc53329992304b3987305f71d06ff8522502f940d214b48835d2022502
5
5
  SHA512:
6
- metadata.gz: ae093650221ef8581d6c4e4a6d75ce9d1451bf2c1af6a2fbd033505780affd2c879bd1811ebc4b4aff594e2e0bd4dd52eb616556790889da47645dd20fddfb03
7
- data.tar.gz: cb502feb94c7511dd8670de9114f6509c5d09b95804a7dd5d36b40037dee771fc7a46f9cf64c07123464604bcac62bd8634dfae12919cd6fd6d0ae24298dddad
6
+ metadata.gz: 7be14d2cc0e8249d17fe46807779db16bee0aedac36be575b9f338c1b6454b11e19dc2263cd01b0c3f0b3c0602c78c6029d7ead1d5847a741e24eb24a6da8979
7
+ data.tar.gz: 505d2929712d1d6b7abde81eb9e7ffe9ff65f2a87e1e782a3df73456ba3e541dfcba6ea8792869884576cd5271028b8c76c62ce15104c62d5ae51c410b2065c6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.6](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.5...v1.9.6) (2023-08-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * create columns with default values ([91e05b8](https://github.com/craigulliott/pg_spec_helper/commit/91e05b8b14c38161965ab8e2dc1d7e869e399567))
9
+ * fixed mistake in type signatures ([a2e5f1e](https://github.com/craigulliott/pg_spec_helper/commit/a2e5f1ed897dbd7968716126ccd6a675cc7a5641))
10
+
3
11
  ## [1.9.5](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.4...v1.9.5) (2023-08-24)
4
12
 
5
13
 
@@ -6,11 +6,13 @@ class PGSpecHelper
6
6
  end
7
7
 
8
8
  # create a column for the provided table
9
- def create_column schema_name, table_name, column_name, type, null = true
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
12
  ALTER TABLE #{connection.quote_ident schema_name.to_s}.#{connection.quote_ident table_name.to_s}
13
- ADD COLUMN #{connection.quote_ident column_name.to_s} #{type} #{null ? "" : "NOT NULL"}
13
+ ADD COLUMN #{connection.quote_ident column_name.to_s} #{type}
14
+ #{null ? "" : "NOT NULL"}
15
+ #{default ? "DEFAULT #{default}" : ""}
14
16
  SQL
15
17
  end
16
18
 
@@ -16,7 +16,7 @@ class PGSpecHelper
16
16
  # create the table
17
17
  create_table schema_name, table_name
18
18
  # create the standard columns
19
- create_column schema_name, table_name, :id, :serial
19
+ create_column schema_name, table_name, :id, :uuid, null: false, default: "uuid_generate_v4()"
20
20
  create_column schema_name, table_name, :created_at, :timestamp
21
21
  create_column schema_name, table_name, :updated_at, :timestamp
22
22
  # add the primary key
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PGSpecHelper
4
- VERSION = "1.9.5"
4
+ VERSION = "1.9.6"
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.5
4
+ version: 1.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott