-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up migrations and schema #34
Comments
I think we should use a migration to remove old tables... but can we first check if they exist? That way the migrations will work for both a bootstrapped and a Drupal legacy database. Also, perhaps the drupal table dropping migration could go at the current timestamp but the original one could be based on this one, which was originally an attempt to manually reconstruct the Drupal schema in the first migration? https://github.com/publiclab/plots2/blob/master/db/migrate/20120101000000_drupal_schema.rb |
@jywarren That's awesome and easily doable and it'll help keep things tidy. Thanks! |
awesome. On Tue, Apr 15, 2014 at 2:38 PM, sirMackk notifications@github.com wrote:
|
I created a migration on my fork here that sits nicely on top of all the previous migrations and allows both the dev server and tests to run smoothly after doing a fresh |
Well, I'm imagining someone coming along with an empty database... vs. the On Wed, Apr 16, 2014 at 2:48 PM, sirMackk notifications@github.com wrote:
|
It'll work for the empty database scenario, but I didn't check it against the empty.sql file scenario. I'll make it work for both and report back :). Thanks for clearing that up for me. |
no, thank you! Perhaps we can ping Andrey to test it out, since he was On Wed, Apr 16, 2014 at 3:11 PM, sirMackk notifications@github.com wrote:
|
I just sent you a pull request. The migrations now work for both scenarios and the tests pass as well. I tested out the application hands-on as well and all seems to be well, although I have to say there might be places/features I'm not aware of yet and haven't tested. I wonder what @aawray thinks about this, I hope it will help a bit with getting things up and running. |
Tested (whee!) And merged, many thanks!
|
My pleasure! |
Thanks! Nice stuff! 👍 |
OK, just to keep this in one place, I'm reopening here. I believe there were a couple issues with the pull request which I didn't catch. The Thoughts? |
Ah, you are entirely correct! I can't believe I let that slip, but it's my fault. It shouldn't have deleted any actual uploaded files, but it probably deleted the database entries related to them. Great news that you did a backup before running the migrations. I removed the I thought a little bit more about the |
True. I think removing ENGINE option won't produce any harm, I don't remember any MyISAM-specific lines in code. |
Thanks! Yes, we prefer InnoDB, which I think is the default... the On Thu, Apr 24, 2014 at 12:41 PM, Andrey notifications@github.com wrote:
|
It's default for MySQL servers with version higher than 5.5.5, if no changes made in server configuration file. |
As per my message here: https://groups.google.com/forum/#!topic/plots-dev/QkKfqKStq88
I want to take a go at cleaning up the migrations and schema, which should provide these two benefits:
git clone
torake test
orrails s
to run smoothly.At the moment, the best solution I've found is to add a migration that will add missing tables/columns as well as add/remove columns from what's already in the migrations.
This will update the schema to reflect the used database tables and it should allow for a smooth running application and tests. Finally, it'll shift development over to using migrations exclusively.
By the way, do you guys think the migration should additionally remove the unused tables or should they be left as they are?
The text was updated successfully, but these errors were encountered: