From 374ce91af9838938ccd4f9fc7e8a281452c4cf99 Mon Sep 17 00:00:00 2001 From: mentegy Date: Wed, 4 Apr 2018 18:01:42 +0300 Subject: [PATCH] wip --- .../getquill/context/sql/ConflictSpec.scala | 14 ++++++++ quill-sql/src/test/sql/mysql-schema.sql | 34 ++----------------- quill-sql/src/test/sql/postgres-schema.sql | 5 ++- 3 files changed, 20 insertions(+), 33 deletions(-) create mode 100644 quill-sql/src/test/scala/io/getquill/context/sql/ConflictSpec.scala diff --git a/quill-sql/src/test/scala/io/getquill/context/sql/ConflictSpec.scala b/quill-sql/src/test/scala/io/getquill/context/sql/ConflictSpec.scala new file mode 100644 index 0000000000..cd74655a70 --- /dev/null +++ b/quill-sql/src/test/scala/io/getquill/context/sql/ConflictSpec.scala @@ -0,0 +1,14 @@ +package io.getquill.context.sql + +trait ConflictSpec { + val ctx: SqlContext[_, _] + + + case class Address(id: Int, street: String, zip: Int) + + import ctx._ + val q = quote { + query[Address] + } + +} diff --git a/quill-sql/src/test/sql/mysql-schema.sql b/quill-sql/src/test/sql/mysql-schema.sql index eb2cfb618b..6af50973cf 100644 --- a/quill-sql/src/test/sql/mysql-schema.sql +++ b/quill-sql/src/test/sql/mysql-schema.sql @@ -115,38 +115,8 @@ CREATE TABLE Contact( ); CREATE TABLE Address( - id int, + id int primary key, street VARCHAR(255), zip int, otherExtraInfo VARCHAR(255) -); - -CREATE TABLE Contact( - firstName VARCHAR(255), - lastName VARCHAR(255), - age int, - addressFk int, - extraInfo VARCHAR(255) -); - -CREATE TABLE Address( - id int, - street VARCHAR(255), - zip int, - otherExtraInfo VARCHAR(255) -); - -CREATE TABLE Contact( - firstName VARCHAR(255), - lastName VARCHAR(255), - age int, - addressFk int, - extraInfo VARCHAR(255) -); - -CREATE TABLE Address( - id int, - street VARCHAR(255), - zip int, - otherExtraInfo VARCHAR(255) -); +); \ No newline at end of file diff --git a/quill-sql/src/test/sql/postgres-schema.sql b/quill-sql/src/test/sql/postgres-schema.sql index a337b5f98f..f9ab6524c0 100644 --- a/quill-sql/src/test/sql/postgres-schema.sql +++ b/quill-sql/src/test/sql/postgres-schema.sql @@ -129,8 +129,11 @@ CREATE TABLE Contact( ); CREATE TABLE Address( - id int, + id int primary key, street VARCHAR(255), zip int, otherExtraInfo VARCHAR(255) ); + + +CREATE UNIQUE INDEX address_index on Contact (firstName, lastName) where age > 18; \ No newline at end of file