Added support for writing (unique) rules tags to database.