Efficient way to check table name when changing db schema?

I think this question is several months for my .NET project (winform and webform) or a PHP project.

I am using a Visual Studio 2010 Pro project for .NET and PDT for a PHP project.

Perhaps the best way is to convert the project to ORM (L2S, EF, PHP ActiveRecord, etc.) instead of the classic SQL statement, however, SQL is still worth using, the less every new friend knows what is in my workplace.

I had to search on google to find any existing plugin or software to make reflection, but it does not seem to exist.

So, how do you know which files should be changed when changing the database schema (table name, varchar length, data type, etc.)?

Or just search and replace?

+3
source share
2 answers

Search and replacement is one of the possibilities.

Another would be to keep the table name in constant values ​​and work with them, instead of putting the table name as plain text in an SQL file.

The third solution, and perhaps best, is to use MyBatis (formerly Ibatis), which stores the SQL files in an external XML file, where you can update it in one place, instead of hiding the SQL code in different files.

http://www.mybatis.org/

+1
source

Why just don’t save the current schema somewhere and compare it with http://dev.mysql.com/doc/refman/5.0/en/describe.html

DESCRIBE table;

?

0
source

All Articles