From 2d2fe73a3181d05e9d6b222916c73f85b7e4ad54 Mon Sep 17 00:00:00 2001 From: Stewart Stewart Date: Tue, 12 Jun 2018 17:41:50 -0400 Subject: Remove obsolete methods from GeneratedTables type (#95) * remove obselete methods from GeneratedTables type * Deprecate and replace `GeneratedTables` rather than breaking. --- src/main/scala/xyz/driver/core/database/package.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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. -- cgit v1.2.3