crudboy 0.2.1 → 0.2.3

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: 4ac7a52e0f04007518e23a0d64c1cf670666876e64452477dd8060f324739354
4
- data.tar.gz: 550b5ebd601d155da07b05a47a9944ce0c13f52ae14f23c3ebd4037935c08a88
3
+ metadata.gz: e8def8432424bc521f2da4ff1b25d6fe36673c8b811e997368d4a5e7967dd1ce
4
+ data.tar.gz: 2177c45565034ec452b8b6e8eba105c26143e1c9a165d59bdb9cdeaae100460c
5
5
  SHA512:
6
- metadata.gz: df510527319a7e9a3bb466a5c124363dc9f566365c22ccc82540d40cccea61a78eef124487941815d24787919d2e56031a861c8bec40652e8cd85431260b8d55
7
- data.tar.gz: 59f6de8732d4b8db14f40e160bffe7b30a4c97831405c9c48204741aee57c1b706088d56ba4e71c1e40546af17bd08ccd9c3d2fdd26d1db869113772ddb52f73
6
+ metadata.gz: 53fe549ebabd9e6ba66ad4316657ed67747b14fc064a792bf702299c46a5f9bc8b718ec5c860e9f4bd8e799b440b892674363e376910965f0760e5cf0c49a545
7
+ data.tar.gz: c5d3cffccd0565d70f57dada5be7cf05fc5a9779076812d875d1eec69b792d1d7906d7d5e8118c7b2b4f83b4ba22640b3676aeb45efb1c202700f6da5ad167c9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crudboy (0.2.1)
4
+ crudboy (0.2.3)
5
5
  activerecord (>= 6.0.3, < 6.2.0)
6
6
  activesupport (~> 6.0.3)
7
7
  composite_primary_keys (~> 12.0.3)
@@ -116,7 +116,14 @@ module Crudboy
116
116
  end
117
117
 
118
118
  def py_sqlmodel_primary_column_declaration
119
- format('%s: %s = Field(default_factory=gen_id, primary_key=True, max_length=%s, description="%s")', name, python_type, limit, comment)
119
+ raw_type = sql_type.scan(/^\w+/).first
120
+ if raw_type == 'varchar'
121
+ format('%s: %s = Field(default_factory=gen_uuid, primary_key=True, max_length=%s, description="%s")', name, python_type, limit, comment)
122
+ elsif raw_type == 'bigint'
123
+ format('%s: %s = Field(default_factory=gen_bigint_id, primary_key=True,description="%s")', name, python_type, comment)
124
+ else
125
+ format('%s: %s = Field(primary_key=True, description="%s")', name, python_type, comment)
126
+ end
120
127
  end
121
128
 
122
129
  def py_dto_column_declaration(optional = false)
@@ -1,3 +1,3 @@
1
1
  module Crudboy
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crudboy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-16 00:00:00.000000000 Z
11
+ date: 2025-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2