GithubHelp home page GithubHelp logo

Comments (11)

edanaher avatar edanaher commented on May 15, 2024

According to http://dev.mysql.com/doc/refman/5.5/en/alter-table.html, you can just

ALTER TABLE t1 ENGINE = InnoDB;

to switch to InnoDB. This wouldn't fix existing brokenness due to triggers/constraints not being enforced, but neither would dumping data and restoring it...

from barkeep.

cespare avatar cespare commented on May 15, 2024

Why wouldn't dumping and restoring fix (or at least reveal) brokenness in constraints? The process I'm imagining is

  • mysqldump all the tables (with the option to not create the tables first)
  • Blow away the DB and run the migrations from scratch (now they will be InnoDB and have constraints)
  • Import all the .sql files.

from barkeep.

edanaher avatar edanaher commented on May 15, 2024

You're right - dumping/restoring would show issues with constraints,
though not with transaction trigger failures that don't have associated
constraints. I have no idea how they're used, so I don't know the
balance of what would be helped or not.

On Thu, Sep 01, 2011 at 04:51:35PM -0700, cespare wrote:

Why wouldn't dumping and restoring fix (or at least reveal) brokenness in constraints? The process I'm imagining is

  • mysqldump all the tables (with the option to not create the tables first)
  • Blow away the DB and run the migrations from scratch (now they will be InnoDB and have constraints)
  • Import all the .sql files.

Reply to this email directly or view it on GitHub:
#20 (comment)

from barkeep.

philc avatar philc commented on May 15, 2024

Innodb is now being used for all tables going forward as of 0f58f63.

from barkeep.

dmac avatar dmac commented on May 15, 2024

Closing per philc's comment.

from barkeep.

cespare avatar cespare commented on May 15, 2024

Reopened until we switch prod to use InnoDB

from barkeep.

cespare avatar cespare commented on May 15, 2024

Actually, we still have all the work left to do on this issue. We still need to modify the old migrations to use InnoDB, and we still need to fix the old migrations to not be broken when using InnoDB. Then we need to make the prod switch.

from barkeep.

cespare avatar cespare commented on May 15, 2024

OK, I think I've done the bulk of the necessary work here. I've pushed major migrations changes to the branch innodb_switch. I can now bring up a mysql db from scratch with InnoDB and run Barkeep. Tomorrow I will work with someone else to make the switch in prod; until then, I will leave this change unmerged.

from barkeep.

cespare avatar cespare commented on May 15, 2024

Alright, I dumped the prod DB and imported on my own local MySQL that had previously had the InnoDB-ified migrations applied to it.

We'll merge that branch and push to prod tonight; for reference, here are the steps:

  1. Dump the database:

    mysqldump -u<user> -p<pw> --no-create-db --no-create-info --ignore-table=barkeep.schema_migrations barkeep > barkeep.sql
    
  2. Manually edit the SQL file to delete the user entry "demo" (primary key 1) from around line 108. (The migration inserts this for us).

  3. Drop the DB and create it again:

    mysql -<user> -p<pw> -e "drop database barkeep; create database barkeep;"
    
  4. Push the new code with the fixed migrations.

  5. Run the migrations.

  6. Verify that we're now using InnoDB by examining the output of this command from the mysql prompt:

    show create table table_name \G
    
  7. Import the data:

    mysql -u<user> -p<pwd> barkeep < barkeep.sql
    
  8. Start up barkeep and verify that the data is there.

from barkeep.

cespare avatar cespare commented on May 15, 2024

Fixed in prod.

from barkeep.

cespare avatar cespare commented on May 15, 2024

OK, the fixed migrations have been merged in and pushed. I think we're good to go now.

from barkeep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.