Software /
code /
prosody-modules
Comparison
mod_mam_sql/README.markdown @ 1820:8de50be756e5
Various README files: Correct indentation levels, fix syntax and other small fixes
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 02 Sep 2015 17:30:33 +0200 |
parent | 1803:4d73a1a6ba68 |
child | 1821:79b9bd84b91c |
comparison
equal
deleted
inserted
replaced
1819:1b08597b5e6f | 1820:8de50be756e5 |
---|---|
30 | 30 |
31 First copy the module to the prosody plugins directory. | 31 First copy the module to the prosody plugins directory. |
32 | 32 |
33 Then add "mam\_sql" to your modules\_enabled list: | 33 Then add "mam\_sql" to your modules\_enabled list: |
34 | 34 |
35 modules_enabled = { | 35 ``` lua |
36 -- ... | 36 modules_enabled = { |
37 "mam_sql", | 37 -- ... |
38 -- ... | 38 "mam_sql", |
39 } | 39 -- ... |
40 } | |
41 ``` | |
40 | 42 |
41 You should probably run the SQL to create the archive table/indexes: | 43 You should probably run the SQL to create the archive table/indexes: |
42 | 44 |
43 CREATE TABLE `prosodyarchive` ( | 45 ``` sql |
44 `host` TEXT, | 46 CREATE TABLE `prosodyarchive` ( |
45 `user` TEXT, | 47 `host` TEXT, |
46 `store` TEXT, | 48 `user` TEXT, |
47 `id` INTEGER PRIMARY KEY AUTOINCREMENT, | 49 `store` TEXT, |
48 `when` INTEGER, | 50 `id` INTEGER PRIMARY KEY AUTOINCREMENT, |
49 `with` TEXT, | 51 `when` INTEGER, |
50 `resource` TEXT, | 52 `with` TEXT, |
51 `stanza` TEXT | 53 `resource` TEXT, |
54 `stanza` TEXT | |
52 ); | 55 ); |
53 CREATE INDEX `hus` ON `prosodyarchive` (`host`, `user`, `store`); | 56 CREATE INDEX `hus` ON `prosodyarchive` (`host`, `user`, `store`); |
54 CREATE INDEX `with` ON `prosodyarchive` (`with`); | 57 CREATE INDEX `with` ON `prosodyarchive` (`with`); |
55 CREATE INDEX `thetime` ON `prosodyarchive` (`when`); | 58 CREATE INDEX `thetime` ON `prosodyarchive` (`when`); |
59 ``` | |
56 | 60 |
57 (**NOTE**: I ran the following SQL to initialize the table/indexes on | 61 (**NOTE**: I ran the following SQL to initialize the table/indexes on |
58 MySQL): | 62 MySQL): |
59 | 63 |
60 CREATE TABLE prosodyarchive ( | 64 ``` sql |
61 `host` VARCHAR(1023) NOT NULL, | 65 CREATE TABLE prosodyarchive ( |
62 `user` VARCHAR(1023) NOT NULL, | 66 `host` VARCHAR(1023) NOT NULL, |
63 `store` VARCHAR(1023) NOT NULL, | 67 `user` VARCHAR(1023) NOT NULL, |
64 `id` INTEGER PRIMARY KEY AUTO_INCREMENT, | 68 `store` VARCHAR(1023) NOT NULL, |
65 `when` INTEGER NOT NULL, | 69 `id` INTEGER PRIMARY KEY AUTO_INCREMENT, |
66 `with` VARCHAR(2047) NOT NULL, | 70 `when` INTEGER NOT NULL, |
67 `resource` VARCHAR(1023), | 71 `with` VARCHAR(2047) NOT NULL, |
68 `stanza` TEXT NOT NULL | 72 `resource` VARCHAR(1023), |
69 ); | 73 `stanza` TEXT NOT NULL |
70 CREATE INDEX hus ON prosodyarchive (host, user, store); | 74 ); |
71 CREATE INDEX `with` ON prosodyarchive (`with`); | 75 CREATE INDEX hus ON prosodyarchive (host, user, store); |
72 CREATE INDEX thetime ON prosodyarchive (`when`); | 76 CREATE INDEX `with` ON prosodyarchive (`with`); |
77 CREATE INDEX thetime ON prosodyarchive (`when`); | |
78 ``` | |
73 | 79 |
74 You may want to tweak the column sizes a bit; I did for my own purposes. | 80 You may want to tweak the column sizes a bit; I did for my own purposes. |
75 | 81 |
76 Configuration | 82 Configuration |
77 ============= | 83 ============= |