[dev] [commits] Horde branch master updated. 395a6e1f5eaf894889892e2d1c58f5bb71a22188

Jan Schneider jan at horde.org
Wed Mar 30 17:31:52 UTC 2011


Zitat von Chuck Hagenbuch <chuck at horde.org>:

> Quoting Michael M Slusarz <slusarz at horde.org>:
>
>> I'm not talking about migration.  I'm talking about recreating the  
>> database.  It may be called Horde_Db_Migration, but the fact is  
>> this is the *ONLY* way to presently create database tables in  
>> Horde.  There is no way to manually create a table.  So if  
>> something goes wrong, and something WILL go wrong, I am SOL without  
>> advanced PHP knowledge?  Because what you are essentially asking  
>> from an admin is that if something goes wrong in a database, they  
>> need to visually parse the contents of a migration script to  
>> determine which tables to drop while also tasking them with the  
>> knowledge that a schema version table exists elsewhere in the  
>> database that also has to be altered.
>
> Seems like another angle at this would be to add some additional  
> tooling and to make db_migrate more general, something like just  
> ./bin/db_schema, with several commands:
>
> - migrate: what it currently does
> - list_tables: list the tables present in the current, or specified,  
> schema version

How would that help? We could only list the tables that should have  
been created by the migration so far, and even that would require  
going through all migration classes and somehow filter out the  
commands that create tables. And how useful would that information be?
The opposite direction doesn't work at all, because there is no way to  
determine to which migration a certain existing table belongs to.

> - show_sql: show the sql to create a schema version, or to migrate  
> between two schema versions

That's not easy either, I already looked at this a few times. The  
problem is that the SQL is created a runtime and depends on live  
information and current state from the database. We already have the  
option to display all SQL queries that are executed during migration.  
This is as much as we can get AFAICS.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list