Rails Exporter Plugin
Schema file
http://rails.kirschekreativ.de/schema-file.html

Copyright © 2013 Joerg Kirschstein

 

Schema file

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 force switch is off, the ":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 force switch is on, ":timestamps" is created for every table [default].

LIMIT
If a field length is smaller 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" [if the column not part of a foreign key!].

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.