You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ginatrapani edited this page Sep 13, 2010
·
13 revisions
If you need to alter the structure of the ThinkTank database, here’s how.
Create Your Migration Script
In the sql/mysql_migrations/ folder, create a new .sql file. The name should include the date, issue number, and a short description of what you’re doing.
For example, on May 3, 2010, if I’m altering the database to work on Issue #200 to add a field called “my_field” to the posts table, I’d create a file called: 2010-05-03_add-myfield-to-posts_issue21.sql.
In that file, add the SQL alter statements. For example, ALTER TABLE tt_posts ADD myfield.
Re-generate the Database Creation Script
Once you have confirmed that your migration script works, regenerate the sql/build-db_mysql.sql file using the migration script. Never edit the build-db_mysql.sql file by hand.
To do so, run the extras/scripts/migratedb script at the command line. First you’ll need to create and edit your configuration file. Check out the README for instructions on doing that.
To make sure the database creation script works, run ThinkTank’s tests.