pg_spec_helper 1.9.8 → 1.9.9

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: 718445dba71c4a5574251f19ca1da659e7961e065467d94cc2b1375661edb340
4
- data.tar.gz: 1005b96612ed0402a9724c2a9acceb8a2c5d4e8feda8a8ab37a9f7fe73de101c
3
+ metadata.gz: eab4f11bd8ca2e846f2298687482bf2d28d6caabbd36515c7eebf9edef8663b0
4
+ data.tar.gz: e45ab0b87e3ebe1fdc515e4e28a92a116dd11c295584b4cac67ecc13e71b0425
5
5
  SHA512:
6
- metadata.gz: 87c640fcf85228a1bc97fd1dbb34b2b15fe65aa4c5cf7e89aa7ce8a60bea86686009f0796cd107b2e7a9088f30e88575c20aa8144628939afbc71a28a0acb534
7
- data.tar.gz: 0e5a77f800f9cbf9532eeec39f20a7b6821dafeb28565a21ebae3786f1afc81222839f34e7489e80b8889c7652fe5410d047fe4bcecd70fd70c97e117bf1fc45
6
+ metadata.gz: b22f267ab7ad3e6e495cb92334094ace7b2304c054ab55bdec04561b339c2163afe9391170d04263c2683292ab3dcd8f239aa9d25fdcd953f7ed81b8ab566f29
7
+ data.tar.gz: 36e4342f390c36b28eb21a8a95a7e9b921529258561f1409e2689aadab4db7617bef8a73b0319a7a404dbc21195ae66edee378beba17bf37f28a85a159a5265c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.9](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.8...v1.9.9) (2023-08-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * creating model now sets correct null and default values ([2e4634e](https://github.com/craigulliott/pg_spec_helper/commit/2e4634ebac8bf52e7eca497e891e492179f6b98e))
9
+
3
10
  ## [1.9.8](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.7...v1.9.8) (2023-08-24)
4
11
 
5
12
 
@@ -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,12 @@ 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
+ CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
21
+ SQL
18
22
  # create the standard columns
19
- create_column schema_name, table_name, :id, :uuid, null: false, default: "uuid_generate_v4()"
23
+ create_column schema_name, table_name, :id, :uuid, false, "uuid_generate_v4()"
20
24
  create_column schema_name, table_name, :created_at, :timestamp
21
25
  create_column schema_name, table_name, :updated_at, :timestamp
22
26
  # 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.9"
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.8
4
+ version: 1.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott