nextcloud / ocsms

📱 Nextcloud/ownCloud PhoneSync server application
https://play.google.com/store/apps/details?id=fr.unix_experience.owncloud_sms
GNU Affero General Public License v3.0
189 stars 52 forks source link

Database cleanup #341

Open floss4good opened 3 years ago

floss4good commented 3 years ago

While working on pull request #340 I noticed that:

  1. The ocsms_sendmessage_queue tables is not used. Based on the table name and the description of the Android client:

    Sending SMS from a Nextcloud instance will be coming in a future release.

    I can assume that this table was added in advance, but the functionality for sending SMS was not implemented until now. Under these circumstances I think it would be better to remove the table for now in order to avoid creating useless migrations.

  2. The ocsms_user_datas table is only used within the ConversationStateMapper::migrate() method that is only called by FixConversationReadStates repair step class. Checking the implementation of this method and the git history I’ve found out that the table was used before ocsms_conversation_read_states table was added back in November 2016 (see commit 26df3a5) and the repair step is actually migrating the data to the new table. Again, I think it is now safe enough to drop this table, the repair step and related legacy code.

At the time of writing the most recent Phone Sync (ocsms) version is 2.2.0 (released on Dec 16, 2020) and the above remarks are also valid for current master codebase.