Giter Site home page Giter Site logo

Comments (13)

rwakida avatar rwakida commented on May 13, 2024

Questions:

  1. Does data.ChatRoom becomes chat_room or chatroom?
  2. Any other collections besides: data.ChatMessage, data.ChatRoom, data.ChatSubscription, and data.ChatTyping?
  3. Does the solution need to migrate existing data? Meteor doesn't support renaming or deleting a collection as far as I know. Any suggestions?

from rocket.chat.

sampaiodiego avatar sampaiodiego commented on May 13, 2024

I was thinking in to use a prefic like "rocket" for collection names. should be one of these:

  • rocket.chatRoom, rocket.chatMessage, rocket.chatSubscription, ...
  • rocketRoom, rocketMessage, rocketSubscription, ...

I think using a prefix is the best for an existing database with other collections.

What do you others think?

from rocket.chat.

engelgabriel avatar engelgabriel commented on May 13, 2024

I think we should either lose the prefix all together.. and use

  • rooms
  • messages
  • subscriptions

or

  • rocketchat_rooms
  • rocketchat_messages
  • rocketchat_subscriptions

from rocket.chat.

rwakida avatar rwakida commented on May 13, 2024

As an outsider learning the system, the prefix helps to differentiate Rocket.Chat's collections from non-Rocket.Chat collections. I like rocketchat_rooms format.

What about existing data migration?

from rocket.chat.

rodrigok avatar rodrigok commented on May 13, 2024

I agree with @rwakida.

About the data migration we already use one lib to do migrations, you can see here (https://github.com/RocketChat/Rocket.Chat/tree/master/server/startup/migrations)

from rocket.chat.

rwakida avatar rwakida commented on May 13, 2024

Thanks @rodrigok. I saw the migrations, but I think this is a special case. Meteor (from what I know) doesn't support Mongo's renameCollection or drop collection. So we either have to:

  1. Instruct the user to manually run renameCollection from the shell before starting meteor.
    or
  2. Rename the collections in collections.coffee. Create a migration that accesses the old collections and migrates the data to the new collections.

The first option is clean, but requires user intervention. The second option is user-friendly, but leaves the old collections and the user has to manually drop the old collections.

A Google search suggested using a Node package that provides shell access, but only works when NOT using the embedded MongoDB.

I'm relatively new to Meteor so please excuse me if I missed something.

from rocket.chat.

sampaiodiego avatar sampaiodiego commented on May 13, 2024

@rodrigok but using meteor could be painful since you can't rename collections

from rocket.chat.

rodrigok avatar rodrigok commented on May 13, 2024

IMHO, there is no problem in create the new collections, migrate de data from old collections, remove old data and keep this collections empty.

We don't have a stable version yet, this seems to be a very small problem.

from rocket.chat.

marceloschmidt avatar marceloschmidt commented on May 13, 2024

I have merged this PR, but I think we should also change the names of "settings" and "migrations" collections. Also, rename "userSessions" to "user_sessions".

from rocket.chat.

rwakida avatar rwakida commented on May 13, 2024

Hi @marceloschmidt. Sorry, I missed those collections. I noticed you added the "in Progress" label. Does that mean you're taking over and renaming the settings, migrations, and userSessions collections?

from rocket.chat.

engelgabriel avatar engelgabriel commented on May 13, 2024

Thanks for the work @rwakida, you did a great job. @marceloschmidt just labeled as in progress so we know that is half done. Having said, I am not sure you'd have access to control the name of all those collection from our repository. Some are 3rd party packages, other are made by us, but in other repositories... you can give it a try and let us know.

from rocket.chat.

rwakida avatar rwakida commented on May 13, 2024

Thanks and great job on Rocket.Chat!

@engelgabriel @marceloschmidt I did a quick search and found that settings and oembed_cache are under Rocket.Chat control. I added both to the v9 migration and created a new pull request.

from rocket.chat.

marceloschmidt avatar marceloschmidt commented on May 13, 2024

Thank you very much @rwakida

from rocket.chat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.