edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Unnecessary `conv_expr` for changing cardinality on computed

Open jackfischer opened this issue 2 years ago • 0 comments

  • EdgeDB Version: 3.3
  • EdgeDB CLI Version: 3.5.0+e1ad387
  • OS Version: macos 13.5

Schema

type Target_ {
    multi link latestSource := (
        select .<t[is Source_] order by .created desc limit 1
    )
}

type Source_ {
    required created: datetime;
    link t: Target_;
}

Steps to Reproduce:

  1. Change latestSource cardinality from multi to single
  2. create migration,
did you convert link 'latestSource' of object type 'default::Target_' to 'single' cardinality? [y,n,l,c,b,s,q,?]
> y
Please specify an expression in order to convert link 'latestSource' of object type 'default::Target_' to 'single' cardinality:
conv_expr> (SELECT .latestSource LIMIT 1)

The expression seems unnecessary since latestSource is a computed. This one is obviously easy, and in fact the CLI fills it in for you (!!) but filing in case this would affect other migration changes to computeds or is a hint of a deeper problem.

jackfischer avatar Sep 14 '23 21:09 jackfischer