I have a project that has evolved over the years. This project is only for use by one client.
For example, when I first deployed the project, table SSGNCR had 10 columns. Over time, I’ve added fields and even changed field sizes/types.
I now have this project with the original Custom Table Schema and a bunch of DB scripts that update the original schema.
I had a case this week where the client went to publish an update to the project and they accidentally published a previous project. Somehow, this deleted data from some of the fields in the table. I am assuming one or more of the sql scripts was run even though it had already been applied. To change a field size, there are scripts that create a temp column, drop the original, recreate the column with the new size, copy the data back into the revised column, and delete the temp column. This may have been the culprit. We are now trying to recover the lost data from those fields. I am somewhat surprised that any of the previous scripts would have been run as I think they would be seen as already applied, but I’ve not published old projects overtop of new ones.
I would like to simply delete all the Custom Table Schemas and DB Scripts and re-add Custom Table Schemas with what is currently in the DB. “Nice and clean”.
What do others do in cases like this? Do you do “clean up” on tables and scripts?