From 322bbaedb0817e656538bdf94b718701b151c48f Mon Sep 17 00:00:00 2001 From: itsumura-h <39766805+itsumura-h@users.noreply.github.com> Date: Thu, 9 Sep 2021 15:37:04 +0900 Subject: [PATCH] remove unique in foreign (#170) --- src/allographer/schema_builder/generators/mysql_generators.nim | 1 - .../schema_builder/generators/postgres_generators.nim | 1 - src/allographer/schema_builder/generators/sqlite_generators.nim | 1 - 3 files changed, 3 deletions(-) diff --git a/src/allographer/schema_builder/generators/mysql_generators.nim b/src/allographer/schema_builder/generators/mysql_generators.nim index c3c14f74..9f1e05d5 100644 --- a/src/allographer/schema_builder/generators/mysql_generators.nim +++ b/src/allographer/schema_builder/generators/mysql_generators.nim @@ -369,7 +369,6 @@ proc foreignColumnGenerator*(name:string, isDefault:bool, default:int):string = proc strForeignColumnGenerator*(name:string, maxLength:int, isDefault:bool, default:string):string = result = &"`{name}` VARCHAR({maxLength})" - result.add(" UNIQUE") if isDefault: result.add(&" DEFAULT {default}") diff --git a/src/allographer/schema_builder/generators/postgres_generators.nim b/src/allographer/schema_builder/generators/postgres_generators.nim index e265fa70..22d3b642 100644 --- a/src/allographer/schema_builder/generators/postgres_generators.nim +++ b/src/allographer/schema_builder/generators/postgres_generators.nim @@ -393,7 +393,6 @@ proc foreignColumnGenerator*(name:string, isDefault:bool, default:int):string = proc strForeignColumnGenerator*(name:string, maxLength:int, isDefault:bool, default:string):string = result = &"\"{name}\" VARCHAR({maxLength})" - result.add(" UNIQUE") if isDefault: result.add(&" DEFAULT {default}") diff --git a/src/allographer/schema_builder/generators/sqlite_generators.nim b/src/allographer/schema_builder/generators/sqlite_generators.nim index 38f5744d..622a356b 100644 --- a/src/allographer/schema_builder/generators/sqlite_generators.nim +++ b/src/allographer/schema_builder/generators/sqlite_generators.nim @@ -278,7 +278,6 @@ proc foreignColumnGenerator*(name:string, isDefault:bool, default:int):string = proc strForeignColumnGenerator*(name:string, isDefault:bool, default:string):string = result = &"'{name}' VARCHAR" - result.add(" UNIQUE") if isDefault: result.add(&" DEFAULT {default}")