Open gsri4 opened 9 years ago
I followed the wiki instructions: https://github.com/pardom/ActiveAndroid/wiki/Schema-migrations and tried to add a column to a pre-existing db table but that's not working.
My inital Model class
@Table(name = "Person") public class Person extends Model {
@Column private String name;
}
All fine.
Then I added a new field called age:
@Column private String name; @Column private int age;
} and changed the manifest flag + created the required assets/migrations/2.sql script
ALTER TABLE Person ADD COLUMN age INTEGER;
Where i have to provide this migration script in androidstudio environment. Any clues
You have to put it in app/src/main/assets/migrations/$version.sql
app/src/main/assets/migrations/$version.sql
No assests folder in androidstudio project code
Then create it
I followed the wiki instructions: https://github.com/pardom/ActiveAndroid/wiki/Schema-migrations and tried to add a column to a pre-existing db table but that's not working.
My inital Model class
@Table(name = "Person") public class Person extends Model {
}
All fine.
Then I added a new field called age:
@Table(name = "Person") public class Person extends Model {
} and changed the manifest flag + created the required assets/migrations/2.sql script
ALTER TABLE Person ADD COLUMN age INTEGER;
Where i have to provide this migration script in androidstudio environment. Any clues