dynamic_migrations 3.2.0 → 3.2.1

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: '05957cccec4b1ee5138e9e74daa7714da41b99be958f7171e1c88475fe495e7b'
4
- data.tar.gz: fd7cb71f07ded6599286dac27c274832bf97de43e56b69a47b7238aefaac2cde
3
+ metadata.gz: ca3d0e63e744237ce50761c65a92516cc4c53bf5c3bc71b7108fc06220b65185
4
+ data.tar.gz: fc9ee993485d527e71558de3ac9d5f5e98b35f6fefadbaffe9a44a90fc44bcee
5
5
  SHA512:
6
- metadata.gz: f1729685ce54c91e0a3a8ce03fbb552887450b843f4c654678717aba41c1e52b66dff1104b9acaedd955e221267619e64405fe4088af9de54b9216446bf87984
7
- data.tar.gz: 95668080a1d329fcaf0172e3593cfc59bab34b7edca05fedfe23d10d7b83945bd9c79943768765f505997fdd8781721569b2845d752d8f99450d251758d41eac
6
+ metadata.gz: '00922f2a680713f98d20258d25cc2a7be769a1c1088e7fd717f1de111dfc738301c45a9f022061670a67bd66882700df63b631728767e6591df8f677aaaf4c0f'
7
+ data.tar.gz: 449b4d2e2dc6d18a6d3a19f21b5800738b6bcd1e60d29440684f4286a0384bd22564589ad07b6b18122a26a1b5df4011a750468060c94ff9811daa59381c06bd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.1](https://github.com/craigulliott/dynamic_migrations/compare/v3.2.0...v3.2.1) (2023-08-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * making column descriptions optional ([c384225](https://github.com/craigulliott/dynamic_migrations/commit/c3842254841c677efb777a1beb519754a4e85cc1))
9
+ * trimming object descriptions when saving ([c384225](https://github.com/craigulliott/dynamic_migrations/commit/c3842254841c677efb777a1beb519754a4e85cc1))
10
+
3
11
  ## [3.2.0](https://github.com/craigulliott/dynamic_migrations/compare/v3.1.1...v3.2.0) (2023-08-16)
4
12
 
5
13
 
@@ -21,6 +21,15 @@ module DynamicMigrations
21
21
  options[:array] = true
22
22
  end
23
23
 
24
+ # comment has to be last
25
+ if column.description
26
+ options[:comment] = <<~RUBY
27
+ <<~COMMENT
28
+ #{indent column.description}
29
+ COMMENT
30
+ RUBY
31
+ end
32
+
24
33
  options_syntax = options.map { |k, v| "#{k}: #{v}" }.join(", ")
25
34
 
26
35
  data_type = column.data_type
@@ -34,9 +43,7 @@ module DynamicMigrations
34
43
  object: column,
35
44
  code_comment: code_comment,
36
45
  migration: <<~RUBY
37
- add_column :#{column.table.name}, :#{column.name}, :#{data_type}, #{options_syntax}, comment: <<~COMMENT
38
- #{indent column.description}
39
- COMMENT
46
+ add_column :#{column.table.name}, :#{column.name}, :#{data_type}, #{options_syntax}
40
47
  RUBY
41
48
  end
42
49
 
@@ -38,7 +38,8 @@ module DynamicMigrations
38
38
 
39
39
  unless description.nil?
40
40
  raise ExpectedStringError, description unless description.is_a? String
41
- @description = description
41
+ @description = description.strip
42
+ @description = nil if description == ""
42
43
  end
43
44
  end
44
45
 
@@ -34,7 +34,8 @@ module DynamicMigrations
34
34
 
35
35
  unless description.nil?
36
36
  raise ExpectedStringError, description unless description.is_a? String
37
- @description = description
37
+ @description = description.strip
38
+ @description = nil if description == ""
38
39
  end
39
40
 
40
41
  @interval_type = interval_type
@@ -72,7 +72,8 @@ module DynamicMigrations
72
72
 
73
73
  unless description.nil?
74
74
  raise ExpectedStringError, description unless description.is_a? String
75
- @description = description
75
+ @description = description.strip
76
+ @description = nil if description == ""
76
77
  end
77
78
 
78
79
  raise ExpectedBooleanError, deferrable unless [true, false].include?(deferrable)
@@ -61,7 +61,8 @@ module DynamicMigrations
61
61
 
62
62
  unless description.nil?
63
63
  raise ExpectedStringError, description unless description.is_a? String
64
- @description = description
64
+ @description = description.strip
65
+ @description = nil if description == ""
65
66
  end
66
67
 
67
68
  raise ExpectedBooleanError, unique unless [true, false].include?(unique)
@@ -45,7 +45,8 @@ module DynamicMigrations
45
45
 
46
46
  unless description.nil?
47
47
  raise ExpectedStringError, description unless description.is_a? String
48
- @description = description
48
+ @description = description.strip
49
+ @description = nil if description == ""
49
50
  end
50
51
  end
51
52
 
@@ -115,7 +115,8 @@ module DynamicMigrations
115
115
 
116
116
  unless description.nil?
117
117
  raise ExpectedStringError, description unless description.is_a? String
118
- @description = description
118
+ @description = description.strip
119
+ @description = nil if description == ""
119
120
  end
120
121
  end
121
122
 
@@ -50,7 +50,8 @@ module DynamicMigrations
50
50
 
51
51
  unless description.nil?
52
52
  raise ExpectedStringError, description unless description.is_a? String
53
- @description = description
53
+ @description = description.strip
54
+ @description = nil if description == ""
54
55
  end
55
56
 
56
57
  raise ExpectedBooleanError, deferrable unless [true, false].include?(deferrable)
@@ -48,7 +48,8 @@ module DynamicMigrations
48
48
 
49
49
  unless description.nil?
50
50
  raise ExpectedStringError, description unless description.is_a? String
51
- @description = description
51
+ @description = description.strip
52
+ @description = nil if description == ""
52
53
  end
53
54
 
54
55
  raise ExpectedBooleanError, deferrable unless [true, false].include?(deferrable)
@@ -39,7 +39,8 @@ module DynamicMigrations
39
39
 
40
40
  unless description.nil?
41
41
  raise ExpectedStringError, description unless description.is_a? String
42
- @description = description
42
+ @description = description.strip
43
+ @description = nil if description == ""
43
44
  end
44
45
 
45
46
  @columns = {}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicMigrations
4
- VERSION = "3.2.0"
4
+ VERSION = "3.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-16 00:00:00.000000000 Z
11
+ date: 2023-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -142,13 +142,13 @@ files:
142
142
  - lib/dynamic_migrations/postgres/server/database/triggers_and_functions_loader.rb
143
143
  - lib/dynamic_migrations/postgres/server/database/validations_loader.rb
144
144
  - lib/dynamic_migrations/version.rb
145
- homepage:
145
+ homepage:
146
146
  licenses:
147
147
  - MIT
148
148
  metadata:
149
149
  source_code_uri: https://github.com/craigulliott/dynamic_migrations/
150
150
  changelog_uri: https://github.com/craigulliott/dynamic_migrations/blob/main/CHANGELOG.md
151
- post_install_message:
151
+ post_install_message:
152
152
  rdoc_options: []
153
153
  require_paths:
154
154
  - lib
@@ -163,8 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubygems_version: 3.2.3
167
- signing_key:
166
+ rubygems_version: 3.3.26
167
+ signing_key:
168
168
  specification_version: 4
169
169
  summary: Manage your database schema through configuration
170
170
  test_files: []