Worth ejabberd 2.1.11 from rep. To store the history in the database set:

 {mod_archive_odbc, [{database_type, "pgsql"}, {default_auto_save, true}, {enforce_default_auto_save, true}, {default_expire, infinity}, {enforce_min_expire, 0}, {enforce_max_expire, infinity}, {replication_expire, 31536000}, {session_duration, 1800}, {wipeout_interval, 86400}, {mod_archive_webview, []}]} 

The problem is that the story writes as follows:

  id | coll_id | utc | dir | body | name -----+---------+---------------------+-----+---------------+------ 1 | 1 | 2015-10-09 16:19:57 | 1 | test1 | 2 | 1 | 2015-10-09 16:19:57 | 0 | test1 | 3 | 1 | 2015-10-09 16:20:00 | 1 | test2 | 4 | 1 | 2015-10-09 16:20:00 | 0 | test2 | 5 | 2 | 2015-10-09 16:20:11 | 1 | test3 | 6 | 2 | 2015-10-09 16:20:11 | 0 | test3 | 7 | 3 | 2015-10-09 16:20:38 | 1 | test4 | 8 | 4 | 2015-10-09 16:20:38 | 0 | test4 | 

and the dialog table itself with the definition of users: archive_collections with the following structure:

 id prev_id next_id us with_user with_server with_resource utc change_by change_utc deleted subject thread crypt extra 

How to immediately write in one table all?

  • If you are not satisfied with the data scheme used by ejabberd, you will have to write your own module that writes the data according to you. - Dmitry Belyaev

1 answer 1

response from comment:


If you are not satisfied with the data scheme used by ejabberd , you will have to write your own module that writes the data according to you.