Giter VIP home page Giter VIP logo

phinxdump's Issues

refactor code generator class

Currently the MigrationCodeGenerator class works but handles all object, column etc. types in the same class resulting in code changes that aren't necessarily more readable just to comply with code complexity rules.

Refactor MigrationCodeGenerator into separate classes. At least extract an abstract column code generator and move column-specific code into its child classes.

make generated code conform to phpcs standard

Currently the generated migration code works but violates a few code style rules (at least commenting and root namespace).

Test as many supported db schemata as possible and change the migration code generator to produce code without styling violations.

do not generate migration file if schema empty

Currently empty schemas result in an empty migration class being generated. This seems useless.

Add a content check: if there's nothing to migrate, don't write the migration file and log a message instead. Add a command line option to still generate the empty migration class.

If the schema consists of views only (which currently result in a comment line in the migration file) consider the schema to be populated and write the migration file as usual.

add help screen and usage docs

Currently the basic usage is documented in README.md, with command line arguments only explained on error.

Add more detailed command line documentation in README.md and a help screen triggered by at least --help and -h.

add support for character sets/collations

Currently character sets and collations are ignored: when running a migration the target server's defaults are used. As a result the original, sometimes purposefully selected, character sets and collations will be lost.

Check if Phinx supports specifying character sets and collations - if so, implement them. If not, see what useful warnings/errors could be emitted.

add support for storage engines

Currently storage engines are completely ignored when reverse-engineering a live database. As a result when executing the migration the newly created tables will use the database's default storage engine.

Add support for keeping storage engines: when creating a migration class the tables' original storage engines should be preserved.

Also add an option to migrate old databases from MyISAM to InnoDB (maybe even make this mode default): storage engines other than MyISAM should be kept, MyISAM should be converted to InnoDB with an appropriate comment in the generated code.

drop zeroes default from TIMESTAMP NOT NULL columns

Currently dumping a TIMESTAMP NOT NULL column results in "0000-00-00 00:00:00" being used as the column's default. This isn't valid, generated migration files will fail because of it.

Drop this default value if encountered. See if the other temporal column types are similarly affected, fix them too if so.

drop column encoding/collation if default

Currently string/text columns always have their character set and collations specified, even if they match the table's defaults.

Make sure Phinx doesn't output any implicit character sets or collations, then implement removing unnecessary character sets and collations from columns.

improve GitHub integration

Currently the files don't contain any links back to this repository and the repository itself isn't particularly easy to find.

Improve this:

  • write a CONTRIBUTING.md file
  • add a link to this repository in README.md
  • add link tags to the source code (enforce in phpcs.xml)
  • add GitHub's topics to the repository (see what's useful)

add copyright year, when appropriate

Currently the copyright year is listed as 2017 and this is OK for now.

There are planned changes, once they are added update the copyright year as well.

add content data handling / seed file creation

Currently the database schema is exported, but there's no built-in way of handling content data.

Add a way. At least implement creating seed file helpers that don't necessarily come with data but include helper functions to generate data fitting the schema easily.

add foreign key support

Currently indices and unique constraints are dumped and included in the migration class, foreign keys are not.

Add foreign key support - make sure the tables are created in order, probably by creating everything first, then adding the foreign keys later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.