GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - prithvibhola/room: Example to demonstrate the Room migration in Android

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Room

This is a simple example to demonstrate the Room migration in case in which we want to

  1. Change the datatype of a column in table
  2. Make fields either nullable or non-nullable
  3. Rename the column name
  4. Add or remove columns from the table

Migration

First build the project with the commit : 05204801051367f1796d74e98dbc7982ad9af7e5

In this commit we have customer model as:

data class Customer(
        @PrimaryKey @ColumnInfo(name = "id") @Json(name = "id") val id: Long = 0,
        @ColumnInfo(name = "name") val name: String,
        @ColumnInfo(name = "gender") val gender: String,
        @ColumnInfo(name = "mobile") val mobile: String,
        @ColumnInfo(name = "landline") val landLine: String,
        @ColumnInfo(name = "email") val email: String,
        @ColumnInfo(name = "user_name") val userName: String,
        @ColumnInfo(name = "language") val languagePreference: String,
        @ColumnInfo(name = "wallet_amount") val walletAmount: Long,
        @ColumnInfo(name = "profile_image_url") val profileImageUrl: String,
        @ColumnInfo(name = "current_location") val currentLocation: String
)

Then over this commit build this commit : 4835eb2b26a7e8e27ed266d487f8acf6e41034ef

Which has customer model as:

data class Customer(
        @PrimaryKey @ColumnInfo(name = "id") val id: Long = 0,
        @ColumnInfo(name = "name") val name: String,
        @ColumnInfo(name = "gender") val gender: String,
        @ColumnInfo(name = "mobile") val mobile: String,
        @ColumnInfo(name = "landline") val landLine: String?,
        @ColumnInfo(name = "email") val email: String?,
        @ColumnInfo(name = "user_name") val userName: String,
        @ColumnInfo(name = "language") val languagePreference: String,
        @ColumnInfo(name = "wallet_amount") val walletAmount: Double?,
        @ColumnInfo(name = "profile_image_url") val profileImageUrl: String?,
        @ColumnInfo(name = "current_location") val currentLocation: String?,
        @ColumnInfo(name = "source") val source: String?
)

Project uses:

  • Koltin
  • RxJava2, RxAndroid and RxKotlin
  • Android Architecture Components
  • Retrofit / OkHttp
  • Moshi
  • Dagger 2
  • Google Play Services
  • Timber
  • Glide 3
  • Stetho
  • Chuck
  • Progress Activity

About

Example to demonstrate the Room migration in Android

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.