-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/fix fields in CREATE MIGRATION
#4550
Conversation
Also I've noted that you can't do
This is a bug, right? But I'm not sure if it's fixable, as it conflicts with |
6c3a70b
to
ba3fbfc
Compare
1. `message` field is now reflected in `schema::Migration` 2. Added `generated_by` field to the migration
ba3fbfc
to
2b40f25
Compare
It's probably fixable, in this specific case of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all fairly reasonable but I think that there is a simpler way that leverages our generic mechanisms for handling SET
. Try to use that and follow up with me if it doesn't work?
edb/edgeql/parser/grammar/ddl.py
Outdated
self.val = qlast.CreateMigration( | ||
name=kids[2].val.name, | ||
parent=kids[2].val.parent, | ||
body=kids[3].val.body, | ||
message=message, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that if we populate the commands
field here with kids[3].val.fields
, the generic mechanisms for handling SET field := ...
should pick up the commands and work without needing to have a message
or generated_by
field in qlast.CreateMigration
, without needing to pick them out in the parser, and thus also without needing to handle them in _cmd_from_ast
It works. Thanks! Feels a bit too magical for someone not familiar enough with the codebase, though. |
Oh, by the way, I've just noticed that I've added uniqueness check into the quite generic check. Please double check that it's fine (looks like it's only used in two places, but I'm not sure). Maybe some |
Yeah, that seems right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought I approved this yesterday!
message
field is now reflected inschema::Migration
generated_by
field to the migrationgenerated_by := MigrationGeneratedBy.DDLStatement
.