DBTableSchema ignoring ColumnProperty.NotNull

I’m having a problem with the DBTableSchema.addRequiredColumn() method. The block below is the output of logger.info("Column " + colName + properties.toString()); However, none of the columns are created as null, instead of not null. The bottom section is the SQL from Script Table as -> CREATE

code 12:10:11 PM ProductionOrderRepository Database is initialized for ProductionOrder.
(I) 12:10:11 PM ProductionOrderRepository Column Key[NotNull, AutoIncrement, PrimaryKey]
(I) 12:10:11 PM ProductionOrderRepository Column OrderItems[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column BillOfMaterials[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column InitialSerialNumber[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column DmrNumber[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column ErpStatus[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column MesStatus[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column DueDate[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column ScheduledStartDate[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column TargetQuantity[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column PartGmid[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column Part[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column Comment[NotNull]
(I) 12:10:11 PM ProductionOrderRepository Column Number[NotNull, Unique][/code]

CREATE TABLE [dbo].[ProductionOrder]( [Number] [varchar](255) NULL, [Comment] [varchar](255) NULL, [Part] [bigint] NULL, [PartGmid] [varchar](255) NULL, [TargetQuantity] [bigint] NULL, [ScheduledStartDate] [datetime] NULL, [DueDate] [datetime] NULL, [MesStatus] [int] NULL, [ErpStatus] [int] NULL, [DmrNumber] [varchar](255) NULL, [InitialSerialNumber] [varchar](255) NULL, [BillOfMaterials] [bigint] NULL, [OrderItems] [bigint] NULL, [Key] [bigint] IDENTITY(1,1) NOT NULL, PRIMARY KEY CLUSTERED ( [Key] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]

Is this expected? If so, how does it manage ColumnProperty.NotNull?

Looks like you’re right- that constraint isn’t properly being applied. We’ll have to fix this.

Regards,

[quote=“Colby.Clegg”]Looks like you’re right- that constraint isn’t properly being applied. We’ll have to fix this.[/quote]Was this resolved with 7.4?

[quote=“bryan_cook”]Was this resolved with 7.4?[/quote]I’ll answer my own question here, looks like no.

Eh, you’re right, it wasn’t. I’ll take a look at it right now. I’m pretty sure all databases handle it the same, so it shouldn’t be a problem.

Regards,

I’ve committed it in for 7.4.2. The “not null” constraint will be added on new tables. Unfortunately we can’t currently add it to existing tables as, for various reasons (biggest one is probably that detecting an existing constraint would be unreliable). However, at least this should get you a bit further.

Regards,

[quote=“Colby.Clegg”]I’ve committed it in for 7.4.2. The “not null” constraint will be added on new tables. Unfortunately we can’t currently add it to existing tables as, for various reasons (biggest one is probably that detecting an existing constraint would be unreliable). However, at least this should get you a bit further.[/quote]Ah, good man! I’m fine with it being only on new tables, works for me!