Fields¶
TriggerVersionField¶
-
class
concurrency.fields.
TriggerVersionField
¶
This field use a database trigger to update the version field.
Using this you can control external updates (ie using tools like phpMyAdmin, pgAdmin, SQLDeveloper).
The trigger is automatically created during syncdb()
or you can use the triggers management command management command.
Changed in Django-Concurrency 1.0.
Warning
Before django-concurrency 1.0 two triggers per field were created,
if you are upgrading you must manually remove old triggers and recreate them using :ref:`triggers`_ management command
trigger_name¶
New in Django-Concurrency 1.0.
-
TriggerVersionField.
trigger_name
¶
Starting from 1.0 you can customize the name of the trigger created. Otherwise for each TriggerVersionField will be created two triggers named:
'concurrency_[DBTABLENAME]_[FIELDNAME]'
Warning
Any name will be automatically prefixed with concurrency_
triggers management command¶
Helper command to work with triggers:
list
: list existing triggers for each databasedrop
: drop exisitng triggerscreate
: create required triggers
example
sax@: (concurrency) django-concurrency [feature/triggers*] $ ./demo/manage.py triggers create
DATABASE TRIGGERS
default concurrency_concurrency_triggerconcurrentmodel_u