|
Posted by Lorenzo Bettini on 01/22/07 13:23
J.O. Aho wrote:
> Lorenzo Bettini wrote:
>
>> What I do now is change the structure from phpmyadmin, copy the sql code
>> that phpmyadmin writes into a an sql file and tell the users to update
>> the database with that file (using a mysql command line).
>
>> I was looking for a more friendly way (say a page update.php) that
>> automatically checks the difference between the current version of the
>> database structure and the new one (when a new release of the software
>> is shipped).
>
> This is a page you have to write yourself, you can check if the tables
> has those changes you are supposed to have if the tables are up to date,
> if there is a fail, then you know you need to make the update, to make
> the update.php to handle different versions of your db design you have
> to check things one at the time.
>
>
>> Possibly, I'd like to avoid writing these things manually, and have
>> these procedures generated automatically.
>
> As there are so many small things you can change, it's difficult to make
> a good general script (don't say it's impossible or anything like that),
> it's a lot easier to make your own update scripts. Myself I have always
> done a php file that can be run easily without any sql skills.
that was exactly my point: since it can be done automatically (but not
easily) I was wondering whether some one already did that
>
> You can even take this a level higher and include checks in the regular
> php code that checks if the database is up to date if a sql query fails,
> if it notice that the database isn't of the right format, it updates the
> database and then redo the sql query, this way the user don't have to
> run any update.php or run a sql file.
>
yes, but this would perform the check for every sql query... it might
have too much overhead...
--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
[Back to original message]
|