[ 
https://issues.apache.org/jira/browse/CAY-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrus Adamchik updated CAY-2962:
---------------------------------
    Description: 
PostgreSQL "text" is an unconstrained VARCHAR. Cayenne doesn't like it very 
much. Reverse engineering sets the max length to 2147483647, and the absence of 
max length causes validation warning.

1. Let's handle this specific case on PostgreSQL by setting max length to -1 
(unknown)
2. No longer warn about VARCHAR without max length
3. When generating DDL SQL for PG and other databases, be smart about missing 
max length. On PostgreSQL use "text", on MySQL - one of the text columns 
(mediumtext?). On other DBs that require a max, come up with a per-DB default 
number supported by VARCHAR analog

  was:
Occasionally we have these silly DbAttributes reverse engineered as as  
VARCHAR(2147483647). In those cases we should just drop the max length all 
together, and leave its as a bare VARCHAR.

For this to be valid, we need to also remove Modeler validation for VARCHAR 
without max length


> Allow unconstrained VARCHAR
> ---------------------------
>
>                 Key: CAY-2962
>                 URL: https://issues.apache.org/jira/browse/CAY-2962
>             Project: Cayenne
>          Issue Type: Task
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Minor
>             Fix For: 5.0-M3
>
>
> PostgreSQL "text" is an unconstrained VARCHAR. Cayenne doesn't like it very 
> much. Reverse engineering sets the max length to 2147483647, and the absence 
> of max length causes validation warning.
> 1. Let's handle this specific case on PostgreSQL by setting max length to -1 
> (unknown)
> 2. No longer warn about VARCHAR without max length
> 3. When generating DDL SQL for PG and other databases, be smart about missing 
> max length. On PostgreSQL use "text", on MySQL - one of the text columns 
> (mediumtext?). On other DBs that require a max, come up with a per-DB default 
> number supported by VARCHAR analog



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to