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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/pg_spec_helper/columns.rb +0 -1
- data/lib/pg_spec_helper/models.rb +5 -1
- data/lib/pg_spec_helper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eab4f11bd8ca2e846f2298687482bf2d28d6caabbd36515c7eebf9edef8663b0
|
4
|
+
data.tar.gz: e45ab0b87e3ebe1fdc515e4e28a92a116dd11c295584b4cac67ecc13e71b0425
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|