sagrawal31 opened a new issue, #14497:
URL: https://github.com/apache/grails-core/issues/14497

   ### Task List
   
   - [x] Steps to reproduce provided
   - [ ] ~Stacktrace (if present) provided~
   - [ ] ~Example that reproduces the problem uploaded to Github~
   - [x] Full description of the issue provided (see below)
   
   ### Steps to Reproduce
   
   1. Create a simple domain class.
   2. Add the following mapping block-
   
   ```groovy
   import grails.gorm.hibernate.mapping.MappingBuilder
   
   class User {
   
       String id
   
       static mapping = MappingBuilder.orm {
           id generator: "assigned", length: 20
           // Tried below as well
           // id generator: "assigned", maxLength: 20
           // id generator: "assigned", params: [length: 20]
       }
   }
   ```
   3. Run the app and check the table `desc user` in MySQL.
   
   ### Expected Behaviour
   
   The `id` column should be created as `VARCHAR(20)`.
   
   ### Actual Behaviour
   
   The `id` column is being created as `VARCHAR(255)`.
   
   ### Environment Information
   
   - **Operating System**: macOS Catalina 10.15.7
   - **GORM Version:** 7.0.6
   - **Grails Version (if using Grails):** 4.0.4
   - **JDK Version:** Oracle JDK 1.8.0_91
   
   ### Description
   
   To use types and `@GrailsCompileStatic` annotation, I'm using 
`MappingBuilder.orm` in the `mapping` block.
   
   https://stackoverflow.com/a/60118491/2405040


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to