InternalServerError: cannot alter type
See original GitHub issue- EdgeDB Version: EdgeDB 1.0-alpha.2+g16f75ece5.d20200122
- OS Version: Windos 10 Educational, Version: 1909, Build: 18363.778
Steps to Reproduce:
START TRANSACTION;
CREATE MIGRATION m2 TO {
module default {
type User {
required property scopes -> array<scope>;
}
scalar type scope extending str {
constraint one_of (
'1', '2'
);
}
}
};
COMMIT MIGRATION m2;
COMMIT;
Error log:
InternalServerError: cannot alter type ""edgedb_e1d3ab02-7c59-11ea-9cc7-f7e49d2fb386"."87c9d94a-87f0-11ea-b4ba-db2bb9dbfd2b_domain"" because column "6716f2a1-87ef-11ea-bb56-fd1198a88276.scopes" uses it
May be related to this issue #1369.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
ERROR: cannot alter type of a column used by a view or rule ...
The only possible way is to drop and re-create the view. But that is no problem, you can easily get the view definition...
Read more >Internal Server Error when updating a Sales or Support ...
Select a Record type 3. Click on Edit 4. Change the Sales process. Result: "Error: Duplicate Developer Name". Workaround 1. Change name of ......
Read more >ERROR: cannot alter type of a column used in a trigger definition
This is the situation: I've a table with a column of type "geometry" which is used in a trigger. There is no constraint...
Read more >Azure Event Hubs - Resource Manager exceptions
Error code Error subcode Error message
BadRequest 40000 PartitionCount can't be changed for an event hub.
BadRequest none The specified name isn't available.
BadRequest none Can't...
Read more >How to Fix the 500 Internal Server Error in WordPress
Do you have the HTTP 500 internal server error in WordPress? Step by step troubleshooting guide on how to fix the internal server...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Right, so then the only way around is to use DDL commands directly (and in correct order):
This particular manifestation of the issue should be easy to fix: because of the vagaries of the priority system, pgsql/delta.py just happens to be creating the constraint late, in a way that puts it after the table and column are created.
The trickier thing is when we need to do a bona-fide alter that adds a constraint. I think the approach is going to have to be:
That is nasty, but definitely doable.