bug: updating schema with BIT NOT NULL columns

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

bug: updating schema with BIT NOT NULL columns

Post by mindplay » Mon 27 Feb 2012 16:46

With the latest release, it appears the Update Database Wizard now sees every BIT NOT NULL column as changed, every time - generating redundant updates like these:

Code: Select all

ALTER TABLE dbo.Role
   ALTER COLUMN IsExternal BIT NOT NULL
I'm several hundred similar statements when I run the update wizard - all of these columns are BIT and NOT NULL already, and it appears every BIT NOT NULL column in the schema is causing this statement...

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Sat 03 Mar 2012 12:43

We cannot reproduce the problem with Entity Developer v 4.2.138 using the following table:

Code: Select all

create table bitnotnull(
Id int primary key,
IsExternal BIT NOT NULL
);
If upgrade to 4.2.138 doesn't help, please post here the DDL script of the table for reproducing the issue.

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Mon 05 Mar 2012 13:57

It looks like it's the default value causing this problem, not the column-type.

Try setting your Column Default Value to 0 or 1 - when reviewing the change actions in the Update to Database Wizard, I now see a description like this:

Code: Select all

DefaultValue(old="0", new='0') was changed.
Looks like a problem with single vs double quotes?

mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

Post by mindplay » Mon 05 Mar 2012 14:02

Actually, forget that - it looks like the default value isn't generated at all:

Code: Select all

ALTER TABLE dbo.Contact
   ALTER COLUMN Active BIT NOT NULL
GO
It looks like the default value is only generated by the Create Schema Wizard - the Update Schema Wizard does not output default values at all.

Post Reply