Skip to content
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

Remove the Postgres function REPLACE_OLD_USER_ID_WITH_NEW #1155

Open
yoganandaness opened this issue Aug 29, 2024 · 4 comments · May be fixed by UserOfficeProject/user-office-core#866
Open
Assignees
Labels
area: uop/stfc An issue relating to the STFC user office project.

Comments

@yoganandaness
Copy link

The PR UserOfficeProject/user-office-core#508 contains the migration which is more STFC specific and it creates an additional table MERGING_TABLE_REGISTRY and function REPLACE_OLD_USER_ID_WITH_NEW. These will not be completely useful for other facilities including ESS. If this is completely STFC specific, i think it is a better idea to have it created in private, so that it does not get created for other facilities.

If this make sense, i would recommend dropping this in a new migration.

Steps to reproduce (if it's a bug).

@yoganandaness yoganandaness added the area: uop/stfc An issue relating to the STFC user office project. label Aug 29, 2024
@yoganandaness
Copy link
Author

@bashanlam Reach out to me in case of any concerns.

@bashanlam
Copy link

bashanlam commented Oct 2, 2024

@bashanlam Reach out to me in case of any concerns.

@yoganandaness REPLACE_OLD_USER_ID_WITH_NEW is not an STFC-specific function; it is designed to update user_id values in tables throughout the schema.

The process involves identifying columns in tables with a foreign key constraint on the USER_ID field of the USERS table and storing them in the MERGING_TABLE_REGISTRY. Each column is then checked for its inclusion in primary or unique key constraints, and the fields are updated accordingly.

@yoganandaness
Copy link
Author

yoganandaness commented Oct 2, 2024

@bashanlam Thanks for detailed explanation of the process. I think i would know about this better if i understand the Merge User Tool(https://github.com/isisbusapps/merge-user-tool/issues/227) for which i dont have the access.

I can see that you have deleted the user and replaced with a new one with all empty details. I am still trying to forecast, if this will be a requirement for us at all.

But let me also have a word with @bolmsten and we can discuss about this, when we meet.

@bashanlam
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: uop/stfc An issue relating to the STFC user office project.
Projects
None yet
2 participants