schematic icon indicating copy to clipboard operation
schematic copied to clipboard

Add a version parameter to the @Table annotation

Open LouisCAD opened this issue 8 years ago • 2 comments

Hi! Today, I am adding a table to my Database I use with Schematic, and I'm metting SQL hassle again to properly add manually the new table in the @OnUpgrade annotated method. I think a version parameter on @Table annotation, with would default to 0, representing the first version which included the table would be a nice way to tell Schematic to add itself the table in the onUpgrade(...) android framework method, following the table contract which for now is only used to access the ContentProvider and when the database is first created.

LouisCAD avatar Mar 24 '16 15:03 LouisCAD

I'd like to have a @Version annotation that can be used on fields annotated with @Table, @DataType and @ExecOnCreate.

For now, the full sql used to create the table is exposed in the generated SQLiteOpenHelper. You can use that directly.

SimonVT avatar Mar 25 '16 10:03 SimonVT

Yep, that's what I used for now, I run the SQL statement field. An @Version annotation would be awesome!

LouisCAD avatar Mar 25 '16 16:03 LouisCAD