Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Designer> Refactoring DB Table Names
 

Pages: 1
Designer
Refactoring DB Table Names
Page:1/1 

  Print all messages in this thread  
Poster Message
Marcus
User



Location:
Dublin, Ireland
Joined on:
23-Apr-2004 11:49:41
Posted:
747 posts
# Posted on: 12-Nov-2005 11:20:14.  
Frans,

What happens when I change a table name in the database and refresh the catalog?

I have some refactoring to do which includes changing some table names. I seem to remember that the designer simply removes the Entities mapped to the removed table from the list... Shocked and hence removes all my hard work in renaming and hiding the related fields etc...

Can you recommend a way to do this which has the least impact on the project file?

Can I hack the project file itself by simple directly changing the table / entity names and then do a refresh (remember DiskDoctor) ? Laugh

[edit] Could I use the ProjectInspector code to help make these changes?

Marcus
Blog: http://www.styledesign.biz/weblogs/macinnesm/
Website http://pix.ie
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37375 posts
# Posted on: 12-Nov-2005 13:16:09.  
Marcus wrote:
Frans,

What happens when I change a table name in the database and refresh the catalog?

I have some refactoring to do which includes changing some table names. I seem to remember that the designer simply removes the Entities mapped to the removed table from the list... Shocked and hence removes all my hard work in renaming and hiding the related fields etc...

I think it's good that you check out the new features added to the preferences in 1.0.2005.1 Regular Smiley Especially the settings which will show you a dialog in which you can select the targets for entities which targets are apparently not available (e.g. renamed Wink). LLBLGen Pro can find renamed tables btw, though if you don't want to rely on that, simply use that new feature. You should also take a look into the refresher preference which will sync names with target element names, like table/view names and field names automatically.

Quote:

Can you recommend a way to do this which has the least impact on the project file?

Well, for everything: switch on the backup creation preference for the refresher. That way, you always have a backup for the situation when things go wrong.

Quote:

Can I hack the project file itself by simple directly changing the table / entity names and then do a refresh (remember DiskDoctor) ? Laugh

[edit] Could I use the ProjectInspector code to help make these changes?
Marcus

The projectinspector shows you the objectmodel indeed, the point is though that your catalog should be migrated as well. It's in general easier to rely on the features offered by the designer to get the mappings migrated. With the new preference (it's called 'ManuallySelectRenamedTargetsAfterRefresh') it's even easier and you won't run into the risk that entities got removed because the refresher can't find the target Regular Smiley

You can also do your refactorings of the db in multiple steps:
- first rename the tables, refresh
- check the mappings in the entity overview listing (rightclick on 'Entities', select 'View entity list')
- if ok, proceed by removing/adding fields, fks etc. refresh.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Marcus
User



Location:
Dublin, Ireland
Joined on:
23-Apr-2004 11:49:41
Posted:
747 posts
# Posted on: 12-Nov-2005 13:48:09.  
Thanks I'll let you know how I get on... Regular Smiley
Blog: http://www.styledesign.biz/weblogs/macinnesm/
Website http://pix.ie
 
Top
LukeO
User



Location:
Portland, OR USA
Joined on:
23-Jul-2007 19:43:05
Posted:
58 posts
# Posted on: 15-Oct-2008 21:18:37.  
I'm trying to do the same but with a typed view. I want to rename four typed views and just want to to tweak the db names as referenced in LLBLGEN. The LLBLGEN names will stay the same as well as the other custom settings. I just want to change the view name.

Is it possible?

Thanks,
-Luke

Marcus wrote:
Thanks I'll let you know how I get on... Regular Smiley





  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14464 posts
# Posted on: 16-Oct-2008 12:29:07.  
Curently you'll have to re-add the TypedViews after renaming the database views and doing a catalog refresh.
Then if you want to keep the old TypedView names, you'll have to rename them back.

P.S. Next time please open a new thread.
  Top
LukeO
User



Location:
Portland, OR USA
Joined on:
23-Jul-2007 19:43:05
Posted:
58 posts
# Posted on: 16-Oct-2008 17:50:47.  
Thanks. I will do that.

There is probably a fine line between adding to an existing thread (which I thought was related) and making a new thread. I tried to do my due dilgence and search all existing forums for an answer to my question before posing another one.

-Luke



Walaa wrote:
Curently you'll have to re-add the TypedViews after renaming the database views and doing a catalog refresh.
Then if you want to keep the old TypedView names, you'll have to rename them back.

P.S. Next time please open a new thread.



  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.