Skip to content

optionalg/slick-migration-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Write typesafe and typo-safe database migrations, using your existing Slick table definitions.

Build Status Coverage Status Download

Dependency

Slick version SBT dependency
3.2.1 "io.github.nafg" %% "slick-migration-api" % "0.4.1"
3.2.0 "io.github.nafg" %% "slick-migration-api" % "0.4.0"
3.1.1 "io.github.nafg" %% "slick-migration-api" % "0.3.0"
3.0.3 "io.github.nafg" %% "slick-migration-api_slick30" % "0.3.0"
2.1.0 "io.github.nafg" %% "slick-migration-api" % "0.1.1"

Artifacts are deployed to bintray and synchronized to JCenter, so add resolvers += Resolver.jcenterRepo to your build.

Example

implicit val dialect = new H2Dialect

val init =
  TableMigration(myTable)
    .create
    .addColumns(_.col1, _.col2)
    .addIndexes(_.index1)
    .renameColumn(_.col03, "col3")
val seed =
  SqlMigration("insert into myTable (col1, col2) values (10, 20)")
  
val migration = init & seed

db.run(migration())

About

Schema manipulation dialects and DSL for Slick

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%