Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Add Column - Not Null (Yes) bug?

Quote Reply
Add Column - Not Null (Yes) bug?
When adding a new column to the links table via admin, if you set NOT NULL to 'Yes',
it gives the following error:

Unable to add column 'Test3': Column Test3 was specified as not null, but has no default value

To add the column, you must enter data in the 'Default' field.
Then the column adds sucessfully.

Once the column has been added, you can edit it and remove the default value.

Hope that helps,
RGB World, Inc. - Software & Web Development.
Quote Reply
Re: [rgbworld] Add Column - Not Null (Yes) bug? In reply to
I took a look at the code and it looks like it's supposed to be like that:
# You are not permitted to add a not_null column without a default to a table -
# the default is required for existing columns. You could, if you really want
# it with no default, create it with a default, then alter it to drop the
# default.