diff options
author | Stewart Stewart <stewinsalot@gmail.com> | 2018-06-12 17:41:50 -0400 |
---|---|---|
committer | Zach Smith <zach@driver.xyz> | 2018-06-12 14:41:50 -0700 |
commit | 2d2fe73a3181d05e9d6b222916c73f85b7e4ad54 (patch) | |
tree | cdee23d552a00dd47a531f638e273d584b9f5e0d /src/main/scala/xyz/driver | |
parent | b03d1c53802862bba9dd068735469f4819fe09b7 (diff) | |
download | driver-core-2d2fe73a3181d05e9d6b222916c73f85b7e4ad54.tar.gz driver-core-2d2fe73a3181d05e9d6b222916c73f85b7e4ad54.tar.bz2 driver-core-2d2fe73a3181d05e9d6b222916c73f85b7e4ad54.zip |
Remove obsolete methods from GeneratedTables type (#95)v1.11.0
* remove obselete methods from GeneratedTables type
* Deprecate and replace `GeneratedTables` rather than breaking.
Diffstat (limited to 'src/main/scala/xyz/driver')
-rw-r--r-- | src/main/scala/xyz/driver/core/database/package.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/core/database/package.scala b/src/main/scala/xyz/driver/core/database/package.scala index 98fd5bd..aee14c6 100644 --- a/src/main/scala/xyz/driver/core/database/package.scala +++ b/src/main/scala/xyz/driver/core/database/package.scala @@ -6,6 +6,7 @@ import java.util.Calendar import date.{Date, Month} import slick.dbio._ import slick.jdbc.JdbcProfile +import slick.relational.RelationalProfile package object database { @@ -14,6 +15,9 @@ package object database { def drop: DBIOAction[Unit, NoStream, Effect.Schema] } + @deprecated( + "sbt-slick-codegen 0.11.0+ no longer needs to generate these methods. Please use the new `CodegenTables` trait when upgrading.", + "driver-core 1.8.12") type GeneratedTables = { // structure of Slick data model traits generated by sbt-slick-codegen val profile: JdbcProfile @@ -23,6 +27,15 @@ package object database { def dropNamespaceSchema: StreamingDBIO[Vector[Unit], Unit] } + /** A structural type for schema traits generated by sbt-slick-codegen. + * This will compile with codegen versions before 0.11.0, but note + * that methods in [[GeneratedTables]] are no longer generated. + */ + type CodegenTables[Profile <: RelationalProfile] = { + val profile: Profile + def schema: profile.SchemaDescription + } + private[database] def sqlDateToDate(sqlDate: SqlDate): Date = { // NOTE: SQL date does not have a time component, so this date // should only be interpreted in the running JVMs timezone. |