Changing Table Name Globally

I have a requirement to change a table name from StudyGroups to Groups. While this seems simple at first look, there are a LOT of things to change, such as function code, libraries, queries, etc.

I also have to change not only the basic tables, but join tables also.

Is there a way to search all function code globally, or must I load each function and edit and save, then repeat for libraries and queries?

Thanks…

Hi Ron,

You can use the menu ‘Code Search’, under the parent menu ‘Tools’, there you are able to search for all the functions/codes that use the word ‘StudyGroups’.

Please, use the image below as a reference.

Regards,

Elton S

Thanks Elton! This is great. Didn’t realize this was available.

It only shows functions and queries, but that is the biggest area to go through. Libraries are not included (unless they are and none of them contain the search term). But even if not, I have a very small number of libraries to go through.

Form Code and Process Code don’t seem to work, they show an error about OnComplete not being there.

But I think I can simply modify table name from StudyGroups to Groups, then also change StudyGroupKey to GroupKey in the join tables, then go through all of the functions and queries using the code search, then finally go through the libraries to find any old references to StudyGroup or StudyGroupKey and change them. Then finally, verify everything works, especially validating all field names in the DataViews.

Can you think of anything I missed in these steps?

Thanks SO much!

PS. It doesn’t seem to allow me to change the table name from StudyGroups to Groups. It says something about a reserved word. More specifically, the table name can be changed but the Data Source ID cannot. Can you advise on this?

Hi Ron,

Thank you for the question.

We do not allow any MySQL reserved words to be used as a Data Source (table name), because MySQL will generate an error for it.

This is part of MySQL’s restrictions.

Regards,

Elton S

Thanks Elton.
Are you saying that “Groups” is a MySQL reserved word? I imagine “Group” is (as in Group By), but I thought “Groups” would work. Strangely it allowed me to change the table name to “Groups”, but wouldn’t let me change the data source name. Why would MySQL let me change the table name if it was a reserved word? It seems more like Five itself won’t let me change the data source name to “Groups”

Is that also true if I tried to create a brand new table and data source called “Groups”?