Best strategy to rename tables and columns

Posts   
 
    
Dready
User
Posts: 9
Joined: 25-Oct-2008
# Posted on: 25-Oct-2008 20:33:43   

Hi,

I've got a rather large project running LLBLgen and asp.net 2.0 C#. Lots of code within the .NET project build upon the generated code. Now i'd like to rename some database tables and columns within my SQL server database, while minimising the amount of work to do that. What would be the best strategy to achieve this?

Thanks!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 26-Oct-2008 20:02:18   

Hi Dready,

You can rename the tables and columns at DB but leave unchanged the names at your LLBLGen project. When generate code, the entities will have the same name but mapped to a different DB-names.

Or, refactor your dependent projects. That's maybe a lot of work but you can do that progressively.

David Elizondo | LLBLGen Support Team
Dready
User
Posts: 9
Joined: 25-Oct-2008
# Posted on: 27-Oct-2008 00:10:31   

daelmo wrote:

Hi Dready,

You can rename the tables and columns at DB but leave unchanged the names at your LLBLGen project. When generate code, the entities will have the same name but mapped to a different DB-names.

Or, refactor your dependent projects. That's maybe a lot of work but you can do that progressively.

Hey Daelmo,

Thanks for your reply.

The thing is, i not only want to rename tables and columns in the database, but also change the entitys, properties, relations, etc accordingly within the project.

I guess i'd start with refactoring the generated objects in the .net project, so the refactoring tool renames all dependent code. And then i'd rename the database tables and columns and regenerate the code; and if i didn't make any typing errors, it should be fine?

Dready

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Oct-2008 02:28:24   

Yes, it should be fine wink

David Elizondo | LLBLGen Support Team