sqlite - How to delete a column from requery.io db in Android -
i have table defined as:
@table(name = "rooms") @entity interface irooms : persistable { @get:column(nullable = false) @get:key var roomjid: string @get:column(name = "gameid", nullable = false) @get:manytoone var game: igames @get:column(name = "creatorjid", nullable = false) @get:manytoone var creator: iprofiles @get:column(nullable = false) @get:onetomany(cascade = arrayof(cascadeaction.delete, cascadeaction.save)) val players: mutablelist<iplayers> @get:junctiontable @get:manytomany(cascade = arrayof(cascadeaction.delete, cascadeaction.save)) val invitedcontacts: mutablelist<iinvitedcontacts> @get:column(nullable = false) var lastmodified: long @get:column(nullable = false) var islocked: boolean var nextplayerjid: string? @get:column(nullable = false) var hasgameended: boolean @get:column(nullable = false) var issoloroom: boolean } what want delete issoloroom column , add column matchtype defined as:
@get:convert(matchtype.requeryconverter::class) var matchtype: matchtype? now, want write migration script remove issoloroom column , if issoloroom value true set matchtype solo else null.
what tried:
- i removed
issoloroomcolumn schema above , inonupgrademethod wrote:
db?.execsql("update rooms set ('matchtype') = ('solo') soloroom = 1")
the matchtype column added desired effect issoloroom not removed.
what should in order remove issoloroom column , add matchtype column. should remove schema , onupgrade script via sqlite (which hectic write entire create table) or requery provides alternative it?
Comments
Post a Comment