edgedb icon indicating copy to clipboard operation
edgedb copied to clipboard

When migrating an array to a `multi` property, `array_unpack(.prop)` throws an error

Open raddevon opened this issue 10 months ago • 0 comments

If a property is changed from an array to a multi property, a cast expression of array_unpack(.prop) should work, but instead, it throws an error:

SchemaError: possibly more than one element returned by the USING clause for the alteration of property 'names' of object type 'default::User', while a singleton is expected
  • EdgeDB Version: 4.7+45e4acc
  • EdgeDB CLI Version: 4.3.0-dev.1138+af2b269
  • OS Version: macOS 14.0

Steps to Reproduce:

  1. Start a new project
  2. Migrate the before schema
  3. Migrate the after schema
  4. Enter the cast expression array_unpack(.names)

Before schema:

module default {
  type User {
    required names: array<str>;
  }
}

After schema:

module default {
  type User {
    required multi names: str;
  }
}

raddevon avatar Apr 22 '24 11:04 raddevon