question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration issue when cyclic dependency is altered

See original GitHub issue
  • EdgeDB Version: 1-beta.2

Steps to Reproduce:

  1. Apply the following schema:
module default {
    type Article {
        required property deleted := (EXISTS (.<element[IS default::DeletionRecord]));
    };
    type Category {
        required property deleted := (EXISTS (.<element[IS default::DeletionRecord]));
    };
    type DeletionRecord {
        required link element -> (default::Article | default::Category) {
            on target delete  delete source;
            constraint std::exclusive;
        };
    };
};
  1. Change to:
module default {
    abstract type Removable {
        property deleted := EXISTS(.<element[IS DeletionRecord]);
    }
    type Article extending Removable {
    };
    type Category extending Removable {
    };
    type DeletionRecord {
        required link element -> Removable {
            on target delete delete source;
            constraint std::exclusive;
        };
    };
};
  1. Get the following error on create-migration:
did you create object type 'default::Removable'? [y,n,l,c,b,s,q,?]
y
error: 'default::Removable.<element' does not resolve to any known path
  ┌─ query:2:41
  │
2 │     CREATE PROPERTY deleted := (EXISTS (.<element[IS default::DeletionRecord]));
  │                                         ^^^^^^^^^ error

Rolling back last operation...
did you create object type 'default::Removable'? [y,n,l,c,b,s,q,?]

On the other hand, schema from (2) works fine if applied from scratch

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
elpranscommented, Jul 6, 2021

Can we rephrase error to something like

We prohibit mixing non-computables with computables as well, not just different computables, but I agree that the error message needs clarification. I’d actually specialize the message to each prohibited combination (i.e. computable and non-computable and computable/computable).

\cc @vpetrovykh

1reaction
elpranscommented, Jul 6, 2021

Is the limitation fundamental or temporary

Temporary, until the compiler learns to actually produce correct queries for polymorphic computables.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Circular dependency error when running migrations in ...
The error message you get when you run the migrate command explains in detail the source of the conflicting model. – jcuot. Jul...
Read more >
22932 ("makemigrations" generates circular dependencies)
The solution is to move the TeamCaptain model into a second migration in the team app, and make sure the migration dependencies are...
Read more >
Circular dependencies detected when migrating from ...
When migrating to Rational® Application Developer (RAD) from WebSphere® Studio Application Developer (WSAD) it is possible that circular dependency errors ...
Read more >
Error MSB4006: There is a circular dependency -- Creating ...
While trying to setup an EF Core project, the following error occurs when creating the migration. \foo\view\obj\view.csproj.
Read more >
Handling circular dependency errors in AWS CloudFormation
When you get a circular dependency error, the first step is to examine the resources that are outlined and ensure that AWS CloudFormation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found