Skip to content
Permalink
Browse files

Fix name collision with columns named 'tag' in codegen

  • Loading branch information
cvogt committed Mar 25, 2014
1 parent 0233507 commit b86cd4bf5ae8ec57527f5bc65cac3dd47b07e3c1
@@ -201,7 +201,7 @@ class Tables(val profile: JdbcProfile){
val all = TableQuery[all]

/** Tests slick term name collision */
class X(tag: Tag) extends Table[(Int,Int,Option[Int],Int,Double,String,Option[Int],Option[Int])](tag, "X") {
class X(tag: Tag) extends Table[(Int,Int,Option[Int],Int,Double,String,Option[Int],Option[Int],Option[String])](tag, "X") {
def pk = column[Int]("pk")
def pk2 = column[Int]("pk2")
def pkpk = primaryKey( "", (pk,pk2) ) // pk column collision
@@ -211,7 +211,8 @@ class Tables(val profile: JdbcProfile){
def a = column[Option[Int]]("val") // scala keyword collision
def s = column[Double]("schema_name") // slick Table no-arg method collision
def sx = column[String]("schema_name_x") // column name collision after disambiguation
def * = (pk,pk2,a,c, s, sx,i1,p)
def t_ag = column[Option[String]]("tag") // column name collision after disambiguation
def * = (pk,pk2,a,c,s,sx,i1,p,t_ag)
def idx1 = index("",i1) // idx column collision
def idx2 = index("i2",i1) // idx column collision
def categoryFK1 = foreignKey("fk1", pk, categories)(_.id) // dup FK collision
@@ -394,7 +394,9 @@ trait GeneratorHelpers[Code,TermName,TypeName]{
// AbstractTable
Seq("*","tableIdentitySymbol","create_*","foreignKeys","indexes","primaryKeys","schemaName","tableConstraints","tableName","tableNode","tableTag"),
// Table
Seq("O","tableIdentitySymbol","tableProvider")
Seq("O","tableIdentitySymbol","tableProvider"),
// generated code
Seq("tag")
).flatten
/* currently disambiguated using overloading
/** Existing term member names in Table[_] that take parameters */

0 comments on commit b86cd4b

Please sign in to comment.
You can’t perform that action at this time.