How can I add "AUTO_INCREMENT" for a field?
But I found that if I used "create field...", the check-box of the AutoIncrement is un-available.
If I create a filed, then try to add the property by "edit field...", then I will be prompt that the default value is invalid.
How can I solve this problem?
*snip*
If I create a filed, then try to add the property by "edit field...", then I will be prompt that the default value is invalid.
*snip*
For the second issue, if i remove the default value, it will be OK.
like this:
ALTER TABLE `recipes` CHANGE `id` `id` INT(32) UNSIGNED AUTO_INCREMENT
I found that if I used "create field...", the check-box of the AutoIncrement is un-available.
An auto_increment field needs to be defined as a key. So, first you have to create the field, then define it as your primary key and then you can set it to auto_increment
If I create a filed, then try to add the property by "edit field...", then I will be prompt that the default value is invalid.
How can I solve this problem?
For the second issue, if i remove the default value, it will be OK.
like this:
ALTER TABLE `recipes` CHANGE `id` `id` INT(32) UNSIGNED AUTO_INCREMENT
You must have (accidentally) defined is as your primary key as well, otherwise that query wouldn't work.
Can someone explain how to make a field a primary key please? Ive searched and found no definitive answers, yet you refer to creating one.
Many thanks.
Just click on the "Manage Indexes" button with the flash on it (left to the field list)
I saw that but thought it was for an index, not a primary key. Am I missing something here? They are different.
In any case I did manage to get my field defined as a primary key. I had to drop the table first, then in my SQL import script, add the proper command to make my field a primary key and auto_increment.
But it does seem strange that Heidi doesn't have a feature to alter a field dynamically. I'm coming from a phpMySQL GUI so this is a little different. But I definitely like it a lot.
:) I saw that but thought it was for an index, not a primary key. Am I missing something here? They are different.
A primary key can be seen as an index, so the index editor has these tasks gathered.
Ah. Thank you. I see that 'Primary Key' is now an option in the select list for managing indexes (indices?).
btw, any idea why my sig is not being attached. I have it set ON in my profile.
Ah. Thank you. I see that 'Primary Key' is now an option in the select list for managing indexes (indices?).
Hehe. I'm nearly sure that it's "indexes", not "indices". I looked it up some time.
btw, any idea why my sig is not being attached. I have it set ON in my profile.
I disabled displaying signatures due to spamming problems. Sorry for any inconveniance.
http://svn.sourceforge.net/heidisql/?rev=629&view=rev
Please login to leave a reply, or register at first.