Rails Exporter Plugin
Migration files
http://rails.kirschekreativ.de/migration-files.html

Copyright © 2013 Joerg Kirschstein

 

Details

Migration files are named by current time minus one hour. If the schema contains more than 60 tables, a counter replaces the hour value.

COMMENTS
Table and field comments are converted into ruby comments.

DEFAULT VALUES
Sets all default values, if valid.

PRIMARY KEY
If the primary key is different from "id", and the primary key force switch is off, the additonal ":primary_key" attribute is set. If the primary key is empty, and the force switch is off, the ":id => false" attribute is set.

FOREIGN KEY
If a table contains referenced columns different from "_id", they are converted to that rails default if the foreign key force switch is on [default].

TIMESTAMPS
If the schema contains columns named "updated_at" or "created_at", they are converted to one rails column ":timestamps".
If the corresponding force switch is on [default], ":timestamps" is once created for every table [default].

LIMIT
If a field length is smaller or equal "g_iMaxLengthForLimit" [default: 16 ], than a ":limit" is set.

NOT NULL
If a field contains the NOTNULL attribute, it`s set to ":null => false".

DEFAULT
The default value is transfered to ":default =>".
Some values are checked and corrected, like "0000-00-00 ..." is converted to "1899-01-01 00:00:00".

FOREIGN KEYS
n:m: creates additional join tables.

INDEX
If on, an index is added for each foreign key.