I just had the idea that this could be great if it was set on all tables so I won't have to update my schema each time I work on a different subject !
So I tried a simple update to make this change DB-wide !
- Code: Select all
Index: DataObject.cs =================================================================== --- DataObject.cs (revision 3330) +++ DataObject.cs (working copy) @@ -115,6 +115,14 @@ [Browsable(false)] public virtual bool IsDeleted { get; set; } + /// <summary> + /// Last time this record was updated. + /// </summary> + [DataElement(AllowDbNull = false, Index = true)] + public DateTime Updated { + get { return DateTime.UtcNow; } + set { Dirty = true; } + } #region ICloneable Member
It always return Current Time so when recording any Object to database it should be updated, trying to "set" this field has no meaning, but I though setting the Dirty flag was pertinent...
There is some downtime when restarting DOL with this patch when it create the "indexed" datetime field...
Maybe it's too much index for some table, and should not be enabled by default ?