masumsoft / express-cassandra

Cassandra ORM/ODM/OGM for NodeJS with support for Apache Cassandra, ScyllaDB, Datastax Enterprise, Elassandra & JanusGraph.
http://express-cassandra.readthedocs.io
GNU Lesser General Public License v3.0
227 stars 67 forks source link

i cant find the documentation about migration #157

Closed arnaz06 closed 6 years ago

vgjenks commented 6 years ago

Yes - migrations seems to be completely undocumented. No idea how to use it. Please help.

masumsoft commented 6 years ago

Migration is an experimental feature and kind of automatic at this moment. You just set the migration behaviour in the configuration and express-cassandra tries to do the rest for you. As cassandra is more restrictive compared to popular sql databases in terms of schema modifications, so it's difficult to implement a full fledged migration system as supported by popular SQL ORMs.

Express cassandra currently does automatic migration based on the differences between the current database schema and the schema defined in the code. It migrates the database automatically when it's "safe" and "possible" to do so. Otherwise it throws an error and requires manual migration by the developer.