Ktorm migration support

Overview

ktorm-migration

Ktorm migration support

Status

Needs a full tutorial, supporting tools, and more testing, but otherwise complete.

Usage

In your app, use MigratableTable, MigratableBaseTable, MigratableMapTable, or MigratableTableMixin instead of your usual tables.

You now have access to additional extension functions on your types, including

column.size(128)  // For size of varchar, etc
column.default("Default Value")
column.default(otherColumn)  // Can be an expression instead
column.unique()  // Adds a unique constraint
column.foreignKey(OtherTable)  // Adds a foreign key constraint
column.notNull()

Create Migrations

When you first start, create the migrations folder using the function initializeMigrations. This will generate a LatestMigration.kt you can use later.

initializeMigrations(
    folder = File("src/test/kotlin/org/ktorm/testmigrations"),
    packageName = "org.ktorm.testmigrations"
)

Then we can start using makeMigrations to automatically create new migrations for us:

makeMigrations(
    folder = File("src/test/kotlin/org/ktorm/testmigrations"),
    packageName = "org.ktorm.testmigrations",
    latestMigration = LatestMigration,
    tables = arrayOf(
        // All of your tables go here
        Departments,
        Employees,
        Customers
    )
)

This will populate the folder with your migrations.

Run Migrations

myDatabase.migrate(LatestMigration)

Known issues

  • We need a lot more testing
  • Transformed fields are unsupported in automatic migration generation, due to being not being reproducible in source.
  • No specific database Dialect implements SqlSchemaFormatter yet
    • Specific implementations are gonna be annoying. This repo will need a module for every supported one.
You might also like...
Charts/graphs library for Android compatible with API 8+, several chart types with support for scaling, scrolling and animations
Charts/graphs library for Android compatible with API 8+, several chart types with support for scaling, scrolling and animations

HelloCharts for Android Charting library for Android compatible with API 8+(Android 2.2). Works best when hardware acceleration is available, so API 1

An enhanced Guava-based event bus with emphasis on Android support.

Otto - An event bus by Square An enhanced Guava-based event bus with emphasis on Android support. Otto is an event bus designed to decouple different

An OkHttp interceptor which has pretty logger for request and response. +Mock support
An OkHttp interceptor which has pretty logger for request and response. +Mock support

LoggingInterceptor - Interceptor for OkHttp3 with pretty logger Usage val client = OkHttpClient.Builder() client.addInterceptor(LoggingInterceptor

Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.

ijkplayer Platform Build Status Android iOS Video player based on ffplay Download Android: Gradle # required allprojects { repositories {

Support for Spring's RestTemplate within native Android applications

Spring for Android Spring for Android is a library that is designed to provide components of the Spring Framework family of projects for use in native

Kommunicate.io Android Chat SDK for Customer Support
Kommunicate.io Android Chat SDK for Customer Support

Kommunicate Android Chat SDK for Customer Support An Open Source Android Live Chat SDK for Customer Support Overview Kommunicate provides open source

Ultra Pull to Refresh for Android. Support all the views.

Welcome to follow me on GitHub or Twitter GitHub: https://github.com/liaohuqiu Twitter: https://twitter.com/liaohuqiu 中文版文档 Wanna auto-load-more? This

Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Android Library to make it easy to create CodeEditor or IDE that support any languages and themes
Android Library to make it easy to create CodeEditor or IDE that support any languages and themes

CodeView Android Library to make it easy to create your CodeEditor or IDE for any programming language even for your programming language, just config

A simple material-based support library to bring consistent SeekBars on Android 14 and above
A simple material-based support library to bring consistent SeekBars on Android 14 and above

SeekBarCompat A support library for the material design SeekBar in Android for API 14 and above. Screenshot On APIs 14 and above - Seekbars would look

A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.

AnimatedBottomBar A customizable and easy to use bottom bar view with sleek animations. Examples Playground app Download the playground app from Googl

:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Android - A ListView adapter with support for multiple choice modal selection
Android - A ListView adapter with support for multiple choice modal selection

MultiChoiceAdapter MultiChoiceAdapter is an implementation of ListAdapter which adds support for modal multiple choice selection as in the native Gmai

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.

PhotoEditor A Photo Editor library with simple, easy support for image editing using Paints, Text, Filters, Emoji and Sticker like stories. Features D

A simple and customizable Android full-screen image viewer with shared image transition support,
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures

Stfalcon ImageViewer A simple and customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" g

3D animation examples for support-v4 Fragment transition.
3D animation examples for support-v4 Fragment transition.

FragmentAnimations Animation examples for support.v4.Fragment transition. These animations do not depends on any external libraries. Usage Example In

Support Floating Action Button transformation for Android
Support Floating Action Button transformation for Android

Fab Transformation This library supports Floating Action Button transformation in Material Design Guideline. Screenshot Sample App Installation Add th

Deprecated in favour of https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html

Deprecated: use https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html instead. android-cubic-bezier-in

Comments
  • Publish the package

    Publish the package

    Hi and thanks a lot to the Ktorm authors and maintainers for the amazing work.

    Was wondering if this package is published somewhere or if there is any plan to do so. I understand it is incomplete but maybe an alpha/dev release can be a reasonable solution.

    opened by SimoneStefani 0
Owner
KTORM.ORG
Kotlin ORM framework with strong-typed SQL DSL and sequence APIs.
KTORM.ORG
Cache support for any video player with help of single line

Video cache support for Android Table of Content Why AndroidVideoCache? Features Get started Recipes Disk cache limit Listen caching progress Providin

Alexey Danilov 5.1k Jan 6, 2023
A gradle plugin for getting java lambda support in java 6, 7 and android

Gradle Retrolambda Plugin This plugin will automatically build your java or android project with retrolambda, giving you lambda goodness on java 6 or

Evan Tatarka 5.3k Jan 5, 2023
****. Use the native and support library variants instead - https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html. An android library that makes it easy to add custom fonts to edittexts and textviews

Add to your project Add this line to your dependencies in build.gradle compile 'in.workarounds.typography:typography:0.0.8' Using the views There are

Workarounds 43 Nov 6, 2021
Ktorm KSP extension to help generate boilerplate code.

Ktorm KSP extension to help generate boilerplate code. It can automatically generate Table objects through entity classes, while making entities defined by data classes easier to use, and supports custom extension code generation logic.

KTORM.ORG 24 Dec 30, 2022
An unofficial migration requirements checking tool for University of Tsukuba - School of Comprehension Studies faculty.

scs-migration-checker (English) An unofficial migration requirements checking tool for University of Tsukuba - School of Comprehension Studies faculty

Itsu 4 Mar 25, 2022
MangaDex V5 migration tool for Tachiyomi

Tachi Dex Migrator MangaDex V5 migration tool for Tachiyomi Download Make a backup of your backup! You have been warned… Get the app on the latest rel

Ivan Iskandar 22 Jun 11, 2022
Migrate - custom ROM migration tool

Migrate - custom ROM migration tool Branch version Version: 5.0 (Apollo) Compilation guide. Clone the three repositories. git clone https://github.com

null 107 Jan 2, 2023
1aingenieriaygas native base android - Project base for the migration of the Flutter App of 1A Ingenieria y Gas

1A Ingenieria y Gas App Versión Wordpress Backend Este proyecto se encuentra sol

Paul Osinga 1 Jan 26, 2022
HH Synthetic -- plugin for automated migration from Kotlin synthetics to View Binding.

HH Synthetic -- plugin for automated migration from Kotlin synthetics to View Binding.

HeadHunter 17 Dec 22, 2022
Android cutout screen support Android P. Android O support huawei, xiaomi, oppo and vivo.

CutoutScreenSupport Android cutout screen support Android P. Android O support huawei, xiaomi, oppo and vivo. Usage whether the mobile phone is cutout

hacket 5 Nov 3, 2022