
#######
History
#######


****
NAME
****


Kernel::System::DBCRUD::History

HistoryBackendSet()
===================


This function sets the information for the history DBCRUD module


.. code-block:: perl

     my $Success = $Object->HistoryBackendSet();


Returns:


.. code-block:: perl

     my $Success = 1;



HistoryBackendUnset()
=====================


This function unsets the information for the history DBCRUD module


.. code-block:: perl

     my $Success = $Object->HistoryBackendUnset();


Returns:


.. code-block:: perl

     my $Success = 1;



IsHistoryBackendSet()
=====================


Checks if history backend is currently set.


.. code-block:: perl

     my $HistoryBackendIsSet = $Object->IsHistoryBackendSet();


Returns true value, if history backend is currently set.


HistoryEventDataAdd()
=====================


This functions adds the history based on the information of the event


.. code-block:: perl

     my $Success = $Object->HistoryEventDataAdd(%Event);


Returns:


.. code-block:: perl

     my $Success = 1;



HistoryEventDataDelete()
========================


This functions removes the history based on the information of the event


.. code-block:: perl

     my $Success = $Object->HistoryEventDataDelete(%Event);


Returns:


.. code-block:: perl

     my $Success = 1;



DataHistoryGet()
================


returns a hash of some of the data
calculated based on data history info at the given date.


.. code-block:: perl

     my %DataHistoryGet = $Object->DataHistoryGet(
         [Identifier] => 123,
 
         # get data based on the system time
         SystemTime => 123,
     );
 
     my %DataHistoryGet = $Object->DataHistoryGet(
         [Identifier] => 123,
 
         # get data based on the timestamp
         TimeStamp => '2017-01-01 12:00:00',
     );
 
     my %DataHistoryGet = $Object->DataHistoryGet(
         [Identifier] => 123,
 
         # get data based on the date information
         StopYear   => 2003,
         StopMonth  => 12,
         StopDay    => 24,
         StopHour   => 10, (optional, default 23)
         StopMinute => 0,  (optional, default 59)
         StopSecond => 0,  (optional, default 59)
     );


Returns:


.. code-block:: perl

     my %DataHistoryGet = (...);



IsUUIDHistoryDatabaseTableColumnPresent()
=========================================



.. code-block:: perl

     Checks if the column for the UUID.
 
     my $UUIDColumnPresent = $DBCRUDObject->IsUUIDHistoryDatabaseTableColumnPresent();
 
     Returns true value if column for UUID is present.



CreateUUIDHistoryDatabaseTableColumn()
======================================



.. code-block:: perl

     Creates the UUID database table column.
 
     my $UUIDColumnCreated = $DBCRUDObject->CreateUUIDHistoryDatabaseTableColumn();
 
     Returns true value if column has been created successfully.



CreateMissingUUIDHistoryDatabaseTableColumn()
=============================================



.. code-block:: perl

     Creates missing UUID database table column in backend's history database table.
 
     my $Success = $DBCRUDObject->CreateMissingUUIDHistoryDatabaseTableColumn();
 
     Returns true value on success (also if column already existed).
     Returns false value if something went wrong.



MigrateUUIDHistoryDatabaseTableColumn()
=======================================



.. code-block:: perl

     Renames the UUID column from z4o_database_backend_uuid (used up until Znuny 6.0) or
     database_backend_uuid (used in Znuny 6.1 and 6.2) to dbcrud_uuid (Znuny 6.3 and up).
     Also includes table from history backend, if present.
 
     my $Success = $Object->MigrateUUIDHistoryDatabaseTableColumn();
 
     Returns true value on success.




