sgruhier / capistrano-db-tasks

Add capistrano tasks for syncing remote and local database
Other
374 stars 177 forks source link

Add support for specifying extra command line options during database dump and load #138

Open someonewithpc opened 9 months ago

someonewithpc commented 9 months ago

I'm running into an error that can be solved by adding --complete-insert to the mysqldump command, caused by having a structure where a non-unique identifier follows the actual identifier:

CREATE TABLE `amendment_events` (
  `id` int NOT NULL AUTO_INCREMENT,
  `amendment_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  # ...
) #...

And the generated dump has

INSERT INTO `amendment_events` VALUES
(44,'2014-06-06 06:42:40',NULL,44,'new',18),

i.e., the columns are not specified, but 44 actually refers to amendment_id, not id, which is leading to errors when importing.

Note: We're using a relatively old version of MySQL, so I don't know if this is a known bug