active-dbml 0.2.4 → 0.2.5
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/lib/active/dbml/version.rb +1 -1
- data/lib/active/dbml.rb +5 -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: 12bd9ed40bdbfe316aae38c4f1621973400d962673037489fdfe6364ee43ce1a
|
|
4
|
+
data.tar.gz: bf287cb8da032c1bee1f9679a4179775f520f63b4ba358b014784ffb5c00f0a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 524482569e3c543781212a64897f63a1bd92287345aeb9272042f48bc9a58f76d83fac9d11a860128613e58eadd9c2d20859a4ac9a75911789f26d8cf696d53f
|
|
7
|
+
data.tar.gz: 27ca499cb33ecd107507dec7fbaa75a1685381770aabef67aa8332e1bf8b9dc73ae4abc8541a309312312f2673ffc091d4a233c3a0915f8928d6ffaba9d39450
|
data/lib/active/dbml/version.rb
CHANGED
data/lib/active/dbml.rb
CHANGED
|
@@ -100,6 +100,7 @@ module Active
|
|
|
100
100
|
options = []
|
|
101
101
|
options.push 'pk' if primary_key.eql?(column.name)
|
|
102
102
|
options.push 'not null' if !column.null
|
|
103
|
+
options.push "default: '#{column.default}'" if column.default
|
|
103
104
|
options.push "note: '#{column.comment}'" if column.comment.present?
|
|
104
105
|
options.push "ref: #{foreign_keys[column.name][:relation_type]} #{foreign_keys[column.name][:destination]}" if foreign_keys.key?(column.name)
|
|
105
106
|
|
|
@@ -135,7 +136,8 @@ module Active
|
|
|
135
136
|
if key.present? && !enums_generated.include?(key)
|
|
136
137
|
dbml_output << "Enum #{key} {"
|
|
137
138
|
value.keys.each do |value_key|
|
|
138
|
-
|
|
139
|
+
translation = model.human_attribute_name("#{key}.#{value_key}")
|
|
140
|
+
dbml_output << " #{value_key} [note: '#{translation}']"
|
|
139
141
|
end
|
|
140
142
|
|
|
141
143
|
dbml_output << "}\n"
|
|
@@ -151,6 +153,8 @@ module Active
|
|
|
151
153
|
return 'boolean'
|
|
152
154
|
when 'datetime(6)'
|
|
153
155
|
return 'datetime'
|
|
156
|
+
when 'INTEGER'
|
|
157
|
+
return 'bigint'
|
|
154
158
|
else
|
|
155
159
|
return sql_type
|
|
156
160
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active-dbml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ukmshi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-07-
|
|
11
|
+
date: 2023-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|