Actualización de GreenDAO

When I update the database version it's not dropping all the tables (thought I'll be the default behaviour). Do I have to do anything else?

preguntado el 05 de septiembre de 12 a las 11:09

You mean you change the schema? If you want to change the DB schema. You should change the schema version in Generator and re-generate the code again. Or you want to do some db migration when you upgrade your DB so you want to customize the onUpgrade part? -

2 Respuestas

Which SQLiteOpenHelper are you using?

Check your generated DaoMaster class. It has an inner class DevOpenHelper which drops all tables on update.

Respondido el 20 de Septiembre de 12 a las 17:09

Please check

        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
            dropAllTables(db, true);

Make Sure dropAllTables(db, true); have true and again problem exist debug here

Respondido el 21 de enero de 15 a las 12:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.