mardi 2 juin 2015

Adding new table after version exist on actviteandroid trows no such table exception

i want to add new table to my project and i get no such table exception :

i have added this to my application class :

configurationBuilder.addModelClasses(Report.class);

and in the manifest :

  <meta-data
            android:name="AA_MODELS"
            android:value="....Report"/>
    <!-- Notice this tag which provides the database name -->
    <meta-data
            android:name="AA_DB_NAME"
            android:value="mydatabase.db"/>

    <!-- Notice this tag which provides the database version -->
    <meta-data
            android:name="AA_DB_VERSION"
            android:value="2"/>

as you can see i have changed the version to 2 .

and after this doesn't work i have added folder and file :

assets/migrations/2.sql

ALTER TABLE Report;

but i still get this exception , if if removed old version from device everything works fine , my problem is to update the data base with new table .

Aucun commentaire:

Enregistrer un commentaire