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

not able to do alter the schema with autoload feature #220

Closed sreelakshmitvvdn closed 4 years ago

sreelakshmitvvdn commented 4 years ago

i tried to alter the schema and autoload the schema using migration set to alter. But am getting the following error : Given Schema does not match existing DB Table device migration suspended, please apply the change manually

my requiremnet i will explain: i have a table with some values added into it. But in between i modified the schema . i want that changes to apply into my existing datas. how can i do this, please help me

masumsoft commented 4 years ago

Are you trying with NODE_ENV=production?

sreelakshmitvvdn commented 4 years ago

no. am giving only migration:safe

masumsoft commented 4 years ago

Safe migration does not alter tables, just throws this warning if the schema does not match with db tables. This is done intentionally to make sure production data is not accidentally deleted. To enable altering the database tables automatically, you need to use migration: alter or drop.

Please also have a look at the docs related to migration for a clear understanding of the options: https://express-cassandra.readthedocs.io/en/stable/usage/#explanations-for-the-options-used-to-initialize