From cb11aacb4391cf959542f56b46d2e7fa827198a0 Mon Sep 17 00:00:00 2001 From: giohappy Date: Thu, 6 Feb 2014 15:30:06 -0800 Subject: [PATCH 1/3] Fixes index creation when having a schema --- peewee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peewee.py b/peewee.py index d919b7dde..501c30704 100644 --- a/peewee.py +++ b/peewee.py @@ -1324,7 +1324,7 @@ def _create_index(self, model_class, fields, unique, *extra): SQL(statement), Entity(index), SQL('ON'), - Entity(tbl_name), + Entity(model_class._meta.schema,model_class._meta.db_table), EnclosedClause(*[field._as_entity() for field in fields]), *extra) create_index = return_parsed_node('_create_index') From 35e1a11fb9ab4f90069acf3488af118366aa98b7 Mon Sep 17 00:00:00 2001 From: giohappy Date: Thu, 6 Feb 2014 15:31:44 -0800 Subject: [PATCH 2/3] Update peewee.py --- peewee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peewee.py b/peewee.py index 501c30704..858041eb6 100644 --- a/peewee.py +++ b/peewee.py @@ -1324,7 +1324,7 @@ def _create_index(self, model_class, fields, unique, *extra): SQL(statement), Entity(index), SQL('ON'), - Entity(model_class._meta.schema,model_class._meta.db_table), + Entity(model_class._meta.schema,tbl_name), EnclosedClause(*[field._as_entity() for field in fields]), *extra) create_index = return_parsed_node('_create_index') From 1360bd2fd302188c174c80a0f984bd6d9acd14e0 Mon Sep 17 00:00:00 2001 From: giohappy Date: Fri, 7 Feb 2014 00:44:36 +0100 Subject: [PATCH 3/3] changed to model_class._as_entity() --- peewee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peewee.py b/peewee.py index 858041eb6..71c110e04 100644 --- a/peewee.py +++ b/peewee.py @@ -1324,7 +1324,7 @@ def _create_index(self, model_class, fields, unique, *extra): SQL(statement), Entity(index), SQL('ON'), - Entity(model_class._meta.schema,tbl_name), + model_class._as_entity(), EnclosedClause(*[field._as_entity() for field in fields]), *extra) create_index = return_parsed_node('_create_index')