Permalink
Browse files

codegen: schema: Handle case of no tables

  • Loading branch information...
nafg committed Sep 1, 2015
1 parent 53cb788 commit 04ca00dc37e46c540fb15fdab665990dafdf7eb5
Showing with 3 additions and 1 deletion.
  1. +3 −1 slick-codegen/src/main/scala/slick/codegen/AbstractSourceCodeGenerator.scala
@@ -29,8 +29,10 @@ abstract class AbstractSourceCodeGenerator(model: m.Model)
(
if(tables.length > 5)
"\nlazy val schema: profile.SchemaDescription = Array(" + tables.map(_.TableValue.name + ".schema").mkString(", ") + ").reduceLeft(_ ++ _)"
else
else if(tables.nonEmpty)
"\nlazy val schema: profile.SchemaDescription = " + tables.map(_.TableValue.name + ".schema").mkString(" ++ ")
else
"\nlazy val schema: profile.SchemaDescription = profile.DDL(Nil, Nil)"
) +
"\n@deprecated(\"Use .schema instead of .ddl\", \"3.0\")"+
"\ndef ddl = schema" +

0 comments on commit 04ca00d

Please sign in to comment.