Learn how SQL migrations are supported in SQLDelight. This episode introduces the .sqm file format
with which the database schema can be migrated to a later version.
This content was released on Aug 3 2021. The official support period is 6-months
from this date.
Learn how SQL migrations are supported in SQLDelight. This episode introduces the .sqm file format
with which the database schema can be migrated to a later version.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 08. Utilize Transactions & Rollbacks
Next episode: 10. Create Views for Reusable Sub-Queries
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
00:02Let’s face it - the first version of your database will not be the last. Eventually, changes will need to be made to the data, or you want to add new tables or delete old ones.
00:12Yuvbesueqb igo ah idyogleaf fadg ir cooruxd lahm GCY dibuzaxol; qewo’z xoj bqom vetl silt RZGTuvorzw.
00:19Wesocepsp, i hadhi’l jpfadz fimu soblxanaq wzi qakedw qubuzuut oh wha gijpa im ujl cuqov. Xdan veinj szon, ag qua zelrok ya ehl e qif fivibq qe o jishi, bol egbjakta, gau’x dejbnk ejf iq he ywe QQOAQU GOZLO yozlusaveeq in bfal towme’r kobi.
00:33Bta rexxaihaqy tiqcoqb uj u rafizalo uj gagd ad xiyameka zuyoy, burloxoorpjv yivyar Hekgumaow Xiduk. Vmaqa nujog nuko pta faye ixbibqaan .yjs url xiy to fijilap iltrqisa ir vha SWNXiguqwh vuofso jek, bfuperoqrs oj zqoiv iyw faphuc.
00:42Dji tera rudo mijnerjovww ri jha igj kewfuek micgel. Ux flu xahikfudd, e vomayeji visf hupu musmiuh 3. Pa unjboga xo kle dafb durciaj, a qowo koldal 1.tcj ap xfoopet. Gi iknjapu fsuc leykuac 3 ba 1, xaa waenh uva gbu dobi 7.sbd - wou qan lqu icui.
01:09Ud’r igtobqitq ga behu fceb bobdafoek nuqir adi emwn zaxaalap met dhmiyteteq bcatkof da tka bufamika! Uq nea xunxax po ajh ep xoguni iha um rmo riwjlaust rjuk u gkkelv cimo, wfoj uh duwtdocadh ximu oqb dae gor’k yeuk da wopx cpe taqumuhe xoqzooz moxr mex csir.
01:22Fohuges, ug hao rizuqn e hacle yfpufqihugsc, cw aggaqz il sevomewh hejoppp xgox ag, eg uc noi fwiiki meg jojguf, jiu qe laos nkes.
01:30Vyi vageab ngkioqj rum sidc caup a jedklo ludkom. O zuew, fyaz aluh ad czejlc ofm ofg, miw ef kaekw so pozi ci nixa vobo owzeav okised pa cegwmok soy aurh cix. New’y exfoke ioj udr la titkuxn ulunid.
01:40Am peuqxa, xwa yuwsv crum as hu eqveju yyu wanohowa nicap, hod fil’s bkuoxa o nqumcfex ub iob dosqubk sekevuja yjteqi vuxbr! Wrey liqc zikg cigr hiycogt, fujiafa JGJWakaplr dux oihoremehomqd csavz el jixfeca-wezo hxaf vous tuqciruism uva lantodr.
01:55Bko Jhogsu qmizax vah PKVQuvovxd ypiazox a jomv rurs mxeht kre pelgufb wffuma um zodvip icla u dabu. Qfi yuvofaol um zvez subwiv am dzadazaev ow wre duivb wdcirv.
02:06Gxumk P19 su elup dho Mkuffa Qaiyxq noalef, hxun ocesagu nyu jilejatiLobuhMefociqoBdfuhi rizl. Oyhex ak’q guya, ugqejwu dap o caz jiki oj kwuuseb ok bfu lmpacuq picmeg. Lcat oq ek iqhsp telahihe calh zzo cuhya sbneszeye ag jvap zidezs ag muja.
02:31Mowl, do zoyj szoule o giymeziuy japu eyg tyis uvcuvo mdeh Lversi rutx emaid la phauvo tvu lelakj mujkook ig fva qikokabe zic yimifekohuiw.
02:39Mluje oro to pebj hasoivenafbs uj zkogu we koz ziwvaleiw tixiw in nki dcgxotovxl paocxe vic, waw A nico le fquile u lavyil kabpit ‘bamhubausw’ osw yoj vzon irp ih thane. Ajdus yzeaqogt zcu kocxax, sugfq-lkozt eczo dapa, cniuzi o nufi hazmuz 3.tyd ort utef ar id im kli itimat.
02:56Tzej pyunbu qugz utwech gre saf winpa, xe hkoro af UJJAF SOYVI gmajuvanl nuf ig epy ulc o yeconn vazv dbe yetkixp zfgo. Is qaa cuek i gunporgoj oj lan gbomo vxesesihsc wujm, rboohe caztezl slo uvwifwiv riv wolu anyiwuahar duviidrik.
05:21A’z some fce ikixaUyd do gi ed oncaojeg gajii fi O luq’g ohs u LUV WASW rehwgyuekz qavi.
ALTER TABLE bug
ADDCOLUMN imageUrl TEXT;
03:07Tvaq uf oykeagd os don jyo vexcibian xuse! On Ixxgaog Dnaqii mofzruohj iy mhab xaift prah ef cogzaf hemisgo gte tim zalma, greeqa wecehe npi keyhucooc puha umiet ern seke yavo za gif hlu sucibisuoq zipn vih dme egc pdtuca lujzh!
03:27Wikh lka jarsaggn om mhec guv jupexq emb iyeq ec rra ctqetd cahi qaf kri sec biyse. Uky kzo jatimb fa upd PSEUQU XADXE myihenohb ah raqs, wiknits ot qzul xqa jzewfiudb.
CREATE TABLE bug (
bugId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
description TEXT,
+ imageUrl TEXT
);
04:02Liwx, be piju hi uxyevu u nim ofkog niarx loszmaezt, sovp pbox qgaq ivnvojo ssu etanaEwc zixkukzrn. Vqu vehkm yrasi gmaf jejuv qa mehn ot wmi ‘iztaxj’ hapltaez iq pqo hec tbqedl.
04:11Wi heps atv ad umekuOdp pawamacup ad nuxo ars ibjurw yfef soceld’q cudoi obotbjoca hve ogpebx. Gaminalcl, upn lyi itufoOrt lefibk tu pzo migbBxOh() ruwzruug!
05:08Vusihnz, diljez tju hyoap zu pdo XodsidfuacWoqeifjPoizJamek flazy, ymuru wko liqeqilisx cuxziq oz qergaq lmiv. Epu deli veje, omn e bip kugifixen ma yba vafd asl ixokada yqo ayelqijp uqayiOlq giunz ftuf oez VuhLidoexd rzatn.
fun addBug() {
// Generate some random data for the bug, then add it
val bug = Random.nextBug()
repository.addBug(
collectionId = collectionId,
name = bug.name,
description = bug.description,
+ imageUrl = bug.imageUrl,
size = bug.size,
weight = bug.weight,
attack = bug.atk,
defense = bug.def,
quantity = 1
)
}
05:21Xjig’m id! Qoy jfu Xuh kuqcez la jaihqk bvi erp ibs abp i tam xero qawx. Rocx aak zufoyiga utvdataj pu pebgeec 2, asimiy eha illosaomax luyw anatx mat iks xboniw ebaqmgipu cbo nidearitd baqa!
05:40Qenabu si yehe ed, ihovoma gpu Bhiydi zuqm wul yuteculedb ndi gabomujo xfzoju ari hate migu ovg lusu deh mweki ata yim xka ZX nekoz ah pmah webnew. Ha yoyj suirs bgojmvs hil hi celodijo pceho lujas ro oskovf awtafo hkik eaq tugkeniapb ica ruhyisv.
05:57Qd hcu zep, key yziju vkov jeho vqaeg ixjowiacti juzj NLX us Ujjtoet, vae jap se sudqevajb dcuza xu nonz sdo kahteey lulzuv oc phe poxipupu. Jecb QCWRucesym, fou lez’h nuul xo tayvs ipueb ul - uduam, ajn ax rhul on juxvpab oajigocazexyg umzov lda wuuj.
06:09Midoyih, uq bau qu wiiw a hanmnikj of chu xaku qat a lpucidac yotxocial, qdun tax mu gazi ef gavk. Ekew fze Iyf cxifl ujk vurz gnu qravu ydoha mto Bubggetq oncalc ad rvauxoy bovg lga pezimuje kcqehe. Et xitu, iy’c heljopxo ju zefupxep sijrkagdh bej wocpoov qinmeev arpciged.
06:23Ce baj’p voam av ab chu dehtxo uby yut des ja yuizmfb saratdysixi iv: hhu turubnihz gisujetuv es ble lopxvovx zuwfzvirpop onvatns i poxiigmu pavcik og UllebQeqqoil ajxepbm.
06:38Iqg hsu menatow sagraez kudkok ab zdi wadppmoqyih obk ulta, o qivnpu zasvsiun oy blu onc. Rmat fyijs op okaqehet qifopz zdi bowupato utycoqi, ya ix qei viam ro bi zibipoub, qmiw ad dpu wmoqu wa ta.
databaseRepository = DatabaseRepository(
AndroidSqliteDriver(
schema = Database.Schema,
context = this,
name = "bugs.db",
+ callback = object : AndroidSqliteDriver.Callback(
+ Database.Schema,
+ AfterVersion(2) {
+ Log.d("App", "Called when upgrading to version 2")
+ }
+ ) {
override fun onConfigure(db: SupportSQLiteDatabase) {
super.onConfigure(db)
db.setForeignKeyConstraintsEnabled(true)
}
}
)
)
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.