-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Backend functions to modify table primary keys #4331
Conversation
@mathemancer can you please sync this up with (I'd merge develop into this branch myself, but since it's still in draft state I want to leave this choice up to you. Personally sometimes I like to retain the ability to easily rebase PRs when in draft state.) For #4313, I need to base my work on this PR plus some of my work from #4327 (which is now in |
It's merged in now. |
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.
Looks great! I added a code suggestion, should be good to merge after that.
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've now opened #4353 on top of this. This PR seems to give me everything I need. Thanks @mathemancer!
Fixes #4334
Fixes #4335
Fixes #4336
This PR adds
TableMetaData
to track the attnum of the most recent Mathesar-added primary key column,drop_existing_primary_key_column
parameter to thecolumns.add_primary_key_column
RPC function.data_modeling.change_primary_key
function that lets a user set a current column of a table as its primary key.Technical details
mathesar_added_pkey_attnum
attribute ofTableMetaData
is automatically maintained by any back end RPC function that adds a primary key column:tables.add
tables.import
columns.add_primary_key_column
mathesar_added_pkey_attnum
attribute is available through any table-metadata-listing RPC function.Checklist
Update index.md
).develop
branch of the repositoryvisible errors.
Developer Certificate of Origin
Developer Certificate of Origin