-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Can't add columns to a table with an AUTO_INCREMENT column that isn't primary key #2587
Comments
I believe dolt currently requires that the auto increment column is a primary key column, but it shouldn't be that tricky to fix. Is this blocking you getting dolt into production? |
@zachmu no, I am not blocked I just interested to use Dolt for a local development and generate the diff file to apply by migrations tool on production servers that runs mariadb/mysql. |
Closing this one as a duplicate of: #2981 @jcor11599 just started looking at #2981 today and will have updates on that issue as we make progress. |
Hi @fulghum, @zachmu, To reproduce it just run following query: CREATE TABLE `about` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`uuid` char(36) NOT NULL,
`status` varchar(255) NOT NULL DEFAULT 'draft',
`date_created` timestamp NULL DEFAULT NULL,
`date_updated` timestamp NULL DEFAULT NULL,
`url_key` varchar(255) NOT NULL,
UNIQUE KEY `id` (`id`),
UNIQUE KEY `about_url_key_unique` (`url_key`),
PRIMARY KEY (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
ALTER TABLE `about` ADD `background_color` varchar(255) DEFAULT NULL; |
Thanks for reopening @sergeycherepanov. I was able to repro the error – it looks like there's a bug in the validation logic that won't let us add more columns to a table with non-pk auto_increment column. @jcor11599 – Could you please take a look at this and see what's going on, since you recently looked at the fix for expanding usage of auto_increment columns? |
Hey @sergeycherepanov, the fix for this should be in our latest release |
The following schema works fine in the mysql, but not in the dolt db.
I need the numeric id field in the table to support legacy code, but the primary key which we use is uuid.
The text was updated successfully, but these errors were encountered: