typedb / typedb-studio

TypeDB Studio (IDE)
https://typedb.com
Mozilla Public License 2.0
195 stars 44 forks source link

Mistyped attribute in the Types explorer in TypeDB Studio #672

Open izmalk opened 1 year ago

izmalk commented 1 year ago

Please replace every line in curly brackets ( { like this } ) with appropriate answers, and remove this line.

Description

I have uploaded the schema to different DBs. It was containing id as a long. But since I have switched it to string (due to intended use of UUID).

Still using it as id @key mostly.

Environment

  1. TypeDB version: 2.13
  2. OS of TypeDB server: MacOS 12.6.1
  3. Studio version: 2.11
  4. OS of Studio: MacOS 12.6.1
  5. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Create new DB (clean)
  2. Load the schema
  3. Check the ID attribute type.

Expected Output

ID to be of type string.

Actual Output

ID is of type long.

Additional information

## Running> Define query:
define
name sub attribute,
    value string;
date sub attribute,
    value datetime;
description sub attribute,
    value string;
id sub attribute,
    value string;
price sub attribute,
    value long;
stock sub attribute,
    value long;
ISBN sub attribute,
    value string;
Book_Author sub attribute,
    value string;
Publisher sub attribute,
    value string;
rating sub attribute,
    value long;
contact_info sub attribute,
    value string;
status sub attribute,
    value string;
delivery_address sub attribute,
    value string;
payment_details sub attribute,
    value string;
username sub attribute,
    value string;
password sub attribute,
    value string;
management_role sub attribute,
    value string;
Product sub entity,
    abstract,
    owns id @key,
    owns name,
    owns description,
    owns price,
    owns stock,
    plays ordered:item;
Book sub Product,
    owns ISBN,
    owns Book_Author,
    owns Publisher,
    plays book_review:reviewed_book,
    plays genre:add_tag;
review sub entity,
    owns id @key,
    owns date,
    owns rating,
    owns description,
    plays book_review:review_result;
Category_tag sub entity,
    owns name,
    plays genre:tag_book;
Person sub entity,
    owns name;
User sub Person,
    owns id @key,
    owns username,
    owns password,
    plays book_review:author;
Customer sub User,
    owns contact_info,
    plays ordered:author;
Employee sub User;
Manager sub Employee,
    owns management_role;
Order sub entity,
    owns id @key,
    owns date,
    owns status,
    owns delivery_address,
    owns payment_details,
    plays ordered:order;
book_review sub relation,
    relates author,
    relates review_result,
    relates reviewed_book;
genre sub relation,
    relates add_tag,
    relates tag_book;
ordered sub relation,
    relates item,
    relates order,
    relates author;

## Result> Define query successfully defined new types in the schema.
jamesreprise commented 1 year ago

I haven't been able to replicate this; 'id' is definitely of type string when writing this schema to an empty database. Is it possible you changed id's value to string from long and attempted to write the schema again? In this case, it's expected that id would remain long (to my knowledge).

izmalk commented 1 year ago

I haven't been able to replicate this; 'id' is definitely of type string when writing this schema to an empty database. Is it possible you changed id's value to string from long and attempted to write the schema again? In this case, it's expected that id would remain long (to my knowledge).

Yeah. I did that at first. But then I created a new database, switched to it, and uploaded this schema to the new database.

izmalk commented 1 year ago

https://discord.com/channels/665254494820368395/805451339424596028/1045770002801885297