Skip to content

Commit

Permalink
Merge pull request #4230 from esl/fix_duplicate_migrations
Browse files Browse the repository at this point in the history
Fix duplicate migration files
  • Loading branch information
jacekwegr authored Feb 27, 2024
2 parents 880776f + 5ba68f2 commit b7ce0f9
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 31 deletions.
7 changes: 0 additions & 7 deletions doc/migrations/6.2.0_6.2.1.md

This file was deleted.

8 changes: 8 additions & 0 deletions doc/migrations/6.2.0_x.x.x.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Database migration

There is a new column in the `mam_message` table in the database, which is used to support including or excluding groupchat results in a user archive. See the migrations for Postgres, MySQL and MSSQL in the [`priv/migrations`](https://github.com/esl/MongooseIM/tree/master/priv/migrations) directory. Please be aware that the filtering process will only be effective for new messages and will not apply to those messages that have already been stored in the database.

## Presences

`mod_presences` was internally refactored to modernise and improve the performance of the code, but as a side-effect, code for [XEP-0018](https://xmpp.org/extensions/xep-0018.html) was removed. Note that this XEP was not advertised and as a matter of fact was deprecated already in 2003, so if your client was depending on it, it is high time to update.

## Roster

`mod_roster` was internally refactored to modernise and improve the performance of the code, but as a side-effect, some database migrations need to be carried. See the migrations for Postgres, MySQL and MSSQL in the [`priv/migrations`](https://github.com/esl/MongooseIM/tree/master/priv/migrations) directory.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ nav:
- '5.1.0 to 6.0.0': 'migrations/5.1.0_6.0.0.md'
- '6.0.0 to 6.1.0': 'migrations/6.0.0_6.1.0.md'
- '6.1.0 to 6.2.0': 'migrations/6.1.0_6.2.0.md'
- '6.2.0 to 6.x.x': 'migrations/6.2.0_x.x.x.md'
- 'MAM MUC migration helper': 'migrations/jid-from-mam-muc-script.md'
- 'Contributions to the Ecosystem': 'Contributions.md'
- 'MongooseIM History': 'History.md'
10 changes: 0 additions & 10 deletions priv/migrations/mssql_6.2.0_6.2.1.sql

This file was deleted.

12 changes: 12 additions & 0 deletions priv/migrations/mssql_6.2.0_x.x.x.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
-- Update roster schema
DROP INDEX i_rosteru_server_user_jid ON rosterusers;
DROP INDEX i_rosteru_server_user ON rosterusers;
DROP INDEX i_rosteru_jid ON rosterusers;
ALTER TABLE rosterusers
ADD CONSTRAINT PK_rosterusers PRIMARY KEY CLUSTERED (server ASC, username ASC, jid ASC);

DROP INDEX i_rosteru_jid ON rostergroups;
ALTER TABLE rostergroups
ALTER COLUMN grp VARCHAR(250),
ADD CONSTRAINT PK_rostergroups PRIMARY KEY CLUSTERED (server ASC, username ASC, jid ASC, grp ASC);

-- Store information whether the message is of type "groupchat" in the user's archive
ALTER TABLE mam_message
ADD is_groupchat smallint NOT NULL DEFAULT 0;
7 changes: 0 additions & 7 deletions priv/migrations/mysql_6.2.0_6.2.1.sql

This file was deleted.

9 changes: 9 additions & 0 deletions priv/migrations/mysql_6.2.0_x.x.x.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-- Update roster schema
DROP INDEX i_rosteru_server_user_jid ON rosterusers;
DROP INDEX i_rosteru_server_user ON rosterusers;
DROP INDEX i_rosteru_jid ON rosterusers;
ALTER TABLE rosterusers ADD PRIMARY KEY(server, username, jid);

DROP INDEX i_rosterg_server_user_jid ON rostergroups;
ALTER TABLE rostergroups MODIFY COLUMN grp VARCHAR(255), ADD PRIMARY KEY(server, username, jid, grp);

-- Store information whether the message is of type "groupchat" in the user's archive
ALTER TABLE mam_message
ADD COLUMN is_groupchat boolean NOT NULL DEFAULT false;
7 changes: 0 additions & 7 deletions priv/migrations/pgsql_6.2.0_6.2.1.sql

This file was deleted.

9 changes: 9 additions & 0 deletions priv/migrations/pgsql_6.2.0_x.x.x.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-- Update roster schema
DROP INDEX i_rosteru_server_user_jid;
DROP INDEX i_rosteru_server_user;
DROP INDEX i_rosteru_jid;
ALTER TABLE rosterusers ADD PRIMARY KEY (server, username, jid);

DROP INDEX i_rosterg_server_user_jid;
ALTER TABLE rostergroups ADD PRIMARY KEY (server, username, jid, grp);

-- Store information whether the message is of type "groupchat" in the user's archive
ALTER TABLE mam_message
ADD COLUMN is_groupchat boolean NOT NULL DEFAULT false;

0 comments on commit b7ce0f9

Please sign in to comment.