#285 MySQL schema of postfixadmin lacks of foreign keys

v2.3.5
open
nobody
Database (41)
4
2013-01-23
2013-01-23
Anonymous
No

Hi all,

I have recently discovered when migrating some mailboxes to postfixadmin, that schema created by 2.3.5 installer doesn't have any foreign keys (except of on_vacation). This at least causes some caveeats when doing some manual modifications/imports into database. You can end up with mailboxes without domain and similar problems. I recommend adding foreign keys there.

I you want, I can create patch for this.
Please write me if you want it.

Ondrej Kunc

Discussion

  • GingerDog

    GingerDog - 2013-01-23

    I've not looked at the mysql schema lately, but it used to use MyISAM tables, which don't support foreign keys (or never used to).

    I don't think there would be a problem migrating the tables to InnoDB, as there aren't any fulltext indexes (afaik).

     
  • Christian Boltz

    Christian Boltz - 2013-01-23

    Foreign keys have pros and cons.

    Yes, they help to ensure data integrity.

    OTOH they cause lots of "fun" when doing database upgrades. Yes, that's a real-world issue I already had with the vacation and vacation_notification tables (search the forum for various upgrade problems - there's even a note in upgrade.php (upgrade_318_mysql) saying that in some cases dropping and re-creating vacation_notification is the easiest solution.

    Because of this, I seriously thought about removing the foreign keys, and I'm not too keen on adding new ones that might cause new trouble (even if they would be "technically correct" ;-)

    BTW: PostfixAdmin 3.0 will come with a commandline interface, which means you probably can't do mass tasks on the commandline instead of manually changing the database ;-)

     
  • Christian Boltz

    Christian Boltz - 2013-01-23
    • priority: 5 --> 4
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks