From aaec1bdedfc73ead3aef3a3e4d835a8df339e2dd Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Sun, 19 Apr 2020 20:09:39 +0200 Subject: Support `ARRAY` of `Enum`, `JSON` or `JSONB` Added support for columns or type :class:`.ARRAY` of :class:`.Enum`, :class:`.JSON` or :class:`_postgresql.JSONB` in PostgreSQL. Previously a workaround was required in these use cases. Raise an explicit :class:`.exc.CompileError` when adding a table with a column of type :class:`.ARRAY` of :class:`.Enum` configured with :paramref:`.Enum.native_enum` set to ``False`` when :paramref:`.Enum.create_constraint` is not set to ``False`` Fixes: #5265 Fixes: #5266 Change-Id: I83a2d20a599232b7066d0839f3e55ff8b78cd8fc --- lib/sqlalchemy/dialects/postgresql/ranges.py | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/ranges.py') diff --git a/lib/sqlalchemy/dialects/postgresql/ranges.py b/lib/sqlalchemy/dialects/postgresql/ranges.py index 76d0aeaeb..d4f75b494 100644 --- a/lib/sqlalchemy/dialects/postgresql/ranges.py +++ b/lib/sqlalchemy/dialects/postgresql/ranges.py @@ -4,7 +4,6 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -from .base import ischema_names from ... import types as sqltypes @@ -108,9 +107,6 @@ class INT4RANGE(RangeOperators, sqltypes.TypeEngine): __visit_name__ = "INT4RANGE" -ischema_names["int4range"] = INT4RANGE - - class INT8RANGE(RangeOperators, sqltypes.TypeEngine): """Represent the PostgreSQL INT8RANGE type. @@ -119,9 +115,6 @@ class INT8RANGE(RangeOperators, sqltypes.TypeEngine): __visit_name__ = "INT8RANGE" -ischema_names["int8range"] = INT8RANGE - - class NUMRANGE(RangeOperators, sqltypes.TypeEngine): """Represent the PostgreSQL NUMRANGE type. @@ -130,9 +123,6 @@ class NUMRANGE(RangeOperators, sqltypes.TypeEngine): __visit_name__ = "NUMRANGE" -ischema_names["numrange"] = NUMRANGE - - class DATERANGE(RangeOperators, sqltypes.TypeEngine): """Represent the PostgreSQL DATERANGE type. @@ -141,9 +131,6 @@ class DATERANGE(RangeOperators, sqltypes.TypeEngine): __visit_name__ = "DATERANGE" -ischema_names["daterange"] = DATERANGE - - class TSRANGE(RangeOperators, sqltypes.TypeEngine): """Represent the PostgreSQL TSRANGE type. @@ -152,15 +139,9 @@ class TSRANGE(RangeOperators, sqltypes.TypeEngine): __visit_name__ = "TSRANGE" -ischema_names["tsrange"] = TSRANGE - - class TSTZRANGE(RangeOperators, sqltypes.TypeEngine): """Represent the PostgreSQL TSTZRANGE type. """ __visit_name__ = "TSTZRANGE" - - -ischema_names["tstzrange"] = TSTZRANGE -- cgit v1.2.1