Autoload indexes in mysql

Issue #663 resolved
Former user created an issue

The mysql table autoload currently does not load the indexes.

The attached patch provide this feature. I have tested it on a 140+ tables database with various indexes (unique, non unique, single or multi columns).

Comments (8)

  1. Mike Bayer repo owner

    just curious, what are you using this feature for ? are you using it to make a "copy" of a schema elsewhere ?

  2. Former user Account Deleted

    Replying to zzzeek:

    just curious, what are you using this feature for ? are you using it to make a "copy" of a schema elsewhere ?

    Basically yes.

    I have a legacy db in mysql, and I want to make, with an improved autocode.py (which I'll post on the group after a little code cleaning), a complete definition so I can work on a new backend in python.

    Since there is a lot of foreign keys and I need to support MSSQL, a lot of indexes are mandatory... and I don't want to do this manually.

    The remaining indexes are here for performances, so keeping them at no cost is a good thing.

  3. Mike Bayer repo owner

    Replying to guest:

    Basically yes.

    I have a legacy db in mysql, and I want to make, with an improved autocode.py (which I'll post on the group after a little code cleaning), a complete definition so I can work on a new backend in python.

    you might have more problems with that, since the reflected table is going to have all MySQL TypeEngine objects embedded into it. they wont create on MS-SQL properly.

  4. Former user Account Deleted

    Replying to zzzeek:

    Replying to guest:

    Basically yes.

    I have a legacy db in mysql, and I want to make, with an improved autocode.py (which I'll post on the group after a little code cleaning), a complete definition so I can work on a new backend in python.

    you might have more problems with that, since the reflected table is going to have all MySQL TypeEngine objects embedded into it. they wont create on MS-SQL properly.

    My modified autocode.py (I'll post it by the next hour now) does replace the MsSQL Types by the standards ones. The overall process works and I successfully created the MSSQL version of my database, with foreign keys and indexes, from the generated definition. One thing though, I couldn't use create_all() because of the foreign keys, I had to customize the creation order of the tables.

  5. Log in to comment