Revising usage of NULL columns

1 view
Skip to first unread message

Alexander Obuhovich

unread,
Jul 20, 2010, 7:18:52 AM7/20/10
to In-Portal Development
I think, that we should review how we use NULL columns in system.

For example we INT field can't have empty value unless it is NULL. VARCHAR fields can have empty value and in most cases are NOT NULL.

What I propose is at least to convert all columns, that contain DATE and USER_ID in them to NULL. We also have ModifiedById field for topics set to 0 in database, but to -1 (root) in unit config, which will make topic always modified by "root", once it is created on front-end.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Alexander Obuhovich

unread,
Aug 9, 2010, 9:15:32 AM8/9/10
to In-Portal Development
Nobody of our big community not interested?

Phil -- wbtc.fr --

unread,
Aug 9, 2010, 1:18:10 PM8/9/10
to in-por...@googlegroups.com
sorry, I would be surely interested if I'd understand the point :)

2010/8/9 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Aug 9, 2010, 4:31:07 PM8/9/10
to in-por...@googlegroups.com
In database we have a lot of data. Data is stored in tables (like in Excel). Each table has columns and rows and when they cross, then we will have cell of data, e.g. one data unit.

That particular data unit can be in following states:
  • have value = NOT NULL value
  • have no value = NULL value
In most cases values in integer cells have 0 as their value to indicate, that value isn't entered. But that's not completely true. What if 0 also means something. For such cases all such problematic cells should be normalized to represent one logic across all database.

That's what I'm proposing here.

Phil -- wbtc.fr --

unread,
Aug 9, 2010, 8:17:11 PM8/9/10
to in-por...@googlegroups.com
thank you for details !

and "normalize" sounds good indeed.

2010/8/9 Alexander Obuhovich <aik....@gmail.com>

S.G.

unread,
Aug 10, 2010, 3:56:06 AM8/10/10
to In-Portal Development Team
I don't agree that all date fields need to be null. Some date fields
always have value (for ex. CreatedOn). Make field NULL only in case if
in any circumstances it may have "no value"!

But I agree that storing 0 in INT field as "no value" is incorrect.

Alexander Obuhovich

unread,
Aug 31, 2010, 2:21:37 PM8/31/10
to in-por...@googlegroups.com

Dmitry Andrejev

unread,
Aug 31, 2010, 2:47:23 PM8/31/10
to in-por...@googlegroups.com
Isn't this related to this task http://tracker.in-portal.org/view.php?id=707 ?


DA.
--


Best regards,

Dmitry A.

Alexander Obuhovich

unread,
Sep 1, 2010, 4:57:02 AM9/1/10
to in-por...@googlegroups.com
Seems it is. Moved it to 5.1.1 as well.
Reply all
Reply to author
Forward
0 new messages