Merge pull request 'Running migrations.' (#118) from fix-migration into master
Reviewed-on: https://gitea.amine-louveau.fr/Louvorg/ReaderForSelfoss-multiplatform/pulls/118
This commit is contained in:
commit
417a33eb25
@ -35,7 +35,6 @@ steps:
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
|
@ -3,10 +3,7 @@ package bou.amine.apps.readerforselfossv2.android
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.widget.ImageView
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.DefaultLifecycleObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
@ -18,8 +15,6 @@ import bou.amine.apps.readerforselfossv2.dao.DriverFactory
|
||||
import bou.amine.apps.readerforselfossv2.dao.ReaderForSelfossDB
|
||||
import bou.amine.apps.readerforselfossv2.repository.Repository
|
||||
import bou.amine.apps.readerforselfossv2.service.AppSettingsService
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.github.ln_12.library.ConnectivityStatus
|
||||
import io.github.aakira.napier.DebugAntilog
|
||||
import io.github.aakira.napier.Napier
|
||||
@ -83,6 +78,8 @@ class MyApp : MultiDexApplication(), DIAware {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repository.migrate(driverFactory)
|
||||
}
|
||||
|
||||
override fun attachBaseContext(base: Context?) {
|
||||
|
@ -576,4 +576,8 @@ class Repository(
|
||||
fun getReaderItems(): ArrayList<SelfossModel.Item> {
|
||||
return _readerItems
|
||||
}
|
||||
|
||||
fun migrate(driverFactory: DriverFactory) {
|
||||
ReaderForSelfossDB.Schema.migrate(driverFactory.createDriver(), 0, 1)
|
||||
}
|
||||
}
|
@ -1 +1,6 @@
|
||||
ALTER TABLE ITEM ADD COLUMN `author` TEXT NOT NULL;
|
||||
CREATE TABLE ITEM_BACKUP AS SELECT `id`, `datetime`, `title`, `content`,
|
||||
`unread`, `starred`, `thumbnail`, `icon`, `link`, `sourcetitle`,
|
||||
`tags` FROM ITEM;
|
||||
ALTER TABLE ITEM_BACKUP ADD COLUMN `author` TEXT;
|
||||
DROP TABLE ITEM;
|
||||
ALTER TABLE ITEM_BACKUP RENAME TO ITEM;
|
@ -1,6 +0,0 @@
|
||||
CREATE TABLE ITEM_BACKUP AS SELECT `id`, `datetime`, `title`, `content`,
|
||||
`unread`, `starred`, `thumbnail`, `icon`, `link`, `sourcetitle`,
|
||||
`tags` FROM ITEM;
|
||||
ALTER TABLE ITEM_BACKUP ADD COLUMN `author` TEXT;
|
||||
DROP TABLE ITEM;
|
||||
ALTER TABLE ITEM_BACKUP RENAME TO ITEM;
|
Loading…
Reference in New Issue
Block a user