Johnpg82 Posted July 11, 2008 Share Posted July 11, 2008 We are having an argument at my work right now. All of the tables in our database are all scattered so I need to take the time to rename them. I was telling them that it might be a good idea to put the tables in a constants file so we might be able to change the table name at a later time. We may have to move some of the tables to its own shared database between all of the systems at once. So I will have to change some of the tables to database_name.table_name. Does anyone have an experience w/ this. Is it going to slow my system down a lot are there any pros or cons to doing things this way? Let me know so I can know if I should pursue this. -John Quote Link to comment Share on other sites More sharing options...
Wolphie Posted July 11, 2008 Share Posted July 11, 2008 I personally don't see any problem with storing them in CONSTANTS, however you really don't want this file being viewable/accessible by users. If I were you, i'd just store them in a database table for convenience. Quote Link to comment Share on other sites More sharing options...
vikramjeet.singla Posted July 11, 2008 Share Posted July 11, 2008 yes it is a good practice to take table names in constants.... as in later stages of development if you need to change the table names, it will be easy to change only one place.... Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 11, 2008 Share Posted July 11, 2008 If you change to constants now when you rename tables later it take 1 updating of a constants file to update all just don't be skimpy on nameing them I like to be very specific on my constants if its a mysql table its called SQL_USERS_TABLE as example so I know exactly what it is, yes it is longer than probably the table's true name of "users" but needless to say its specific enough that I know exactly what it is. Constants should be used for any application that might travel from server to server or db to db so SQL login info can be constants also. Quote Link to comment Share on other sites More sharing options...
Johnpg82 Posted July 11, 2008 Author Share Posted July 11, 2008 I personally don't see any problem with storing them in CONSTANTS, however you really don't want this file being viewable/accessible by users. If I were you, i'd just store them in a database table for convenience. Wolphie I'd prefer not storing my constants in the DB as that will be one less query I have to run. I believe a constant is more secure then a variable and it is not accessible from the outside. Regardless I'll be putting them in secure folder and make sure my permissions are right. Thanks for the tips. -John Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.