pg_spec_helper 1.9.8 → 1.9.10
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 +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/pg_spec_helper/columns.rb +0 -1
- data/lib/pg_spec_helper/models.rb +9 -1
- data/lib/pg_spec_helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18c3f281f5220ac541ecdff460921d5256d698cde0dfabb9a5522802b9c99cb3
|
4
|
+
data.tar.gz: 45a6ad92ec2637d058ae2978572464e25b3f9153ef543671f49b532a11fc1b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|
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.
|
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-
|
11
|
+
date: 2023-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|