Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Robert Carroll edited this page Sep 20, 2019 · 3 revisions

CREATE TABLES

rake create_tables will generate a SQL table creation script to initiate your database.

Always review SQL statements before running against your database.

ALTER TABLES

rake alter_tables will compare a current and prior version of the create_tables output and attempt to highlight the necessary changes. Changes will be listed as add, modify, rename, and drop, and create.

  • add columns that have been added
  • modify columns that have been modified, likely just the datatype length
  • create highlights that a new table was added, and needs to be run from the newer create_tables output.
  • rename makes an effort to determine if a column was renamed. However, index changes in the hash can confuse this operation, therefore you should always review all statements returned.
  • drop columns that have been removed
  • double_check is provided to whenever rename is possible

Always review SQL statements before running against your database.

Consider that the accuracy of alter_tables goes down when the number of changes between files goes up. It's best to stay up to date with master

REDUCE LOGS

rake reduce_logs reduces the lines of log files to provide samples of missing data to stream line updating and maintaining the schema.

RESET LOGS

rake reset_logs will clear the log files.

Clone this wiki locally