Fixed -- Fixed spaces in WITH SQL for indexes on PostgreSQL.
@@ -330,9 +330,14 @@ class SchemaTests(PostgreSQLTestCase):
name=index_name,
fastupdate=True,
gin_pending_list_limit=64,
+ db_tablespace="pg_default",
)
with connection.schema_editor() as editor:
editor.add_index(IntegerArrayModel, index)
+ self.assertIn(
+ ") WITH (gin_pending_list_limit = 64, fastupdate = on) TABLESPACE",
+ str(index.create_sql(IntegerArrayModel, editor)),
+ )
constraints = self.get_constraints(IntegerArrayModel._meta.db_table)
self.assertEqual(constraints[index_name]["type"], "gin")
self.assertEqual(
