alembic 1.15.1__py3-none-any.whl → 1.15.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- alembic/__init__.py +1 -1
- alembic/autogenerate/render.py +3 -0
- alembic/ddl/base.py +5 -1
- alembic/ddl/impl.py +1 -2
- alembic/op.pyi +2 -2
- alembic/operations/base.py +4 -2
- alembic/operations/ops.py +5 -3
- {alembic-1.15.1.dist-info → alembic-1.15.2.dist-info}/METADATA +3 -2
- {alembic-1.15.1.dist-info → alembic-1.15.2.dist-info}/RECORD +13 -13
- {alembic-1.15.1.dist-info → alembic-1.15.2.dist-info}/WHEEL +1 -1
- {alembic-1.15.1.dist-info → alembic-1.15.2.dist-info}/entry_points.txt +0 -0
- {alembic-1.15.1.dist-info → alembic-1.15.2.dist-info/licenses}/LICENSE +0 -0
- {alembic-1.15.1.dist-info → alembic-1.15.2.dist-info}/top_level.txt +0 -0
alembic/__init__.py
CHANGED
alembic/autogenerate/render.py
CHANGED
@@ -505,6 +505,7 @@ def _alter_column(
|
|
505
505
|
type_ = op.modify_type
|
506
506
|
nullable = op.modify_nullable
|
507
507
|
comment = op.modify_comment
|
508
|
+
newname = op.modify_name
|
508
509
|
autoincrement = op.kw.get("autoincrement", None)
|
509
510
|
existing_type = op.existing_type
|
510
511
|
existing_nullable = op.existing_nullable
|
@@ -533,6 +534,8 @@ def _alter_column(
|
|
533
534
|
rendered = _render_server_default(server_default, autogen_context)
|
534
535
|
text += ",\n%sserver_default=%s" % (indent, rendered)
|
535
536
|
|
537
|
+
if newname is not None:
|
538
|
+
text += ",\n%snew_column_name=%r" % (indent, newname)
|
536
539
|
if type_ is not None:
|
537
540
|
text += ",\n%stype_=%s" % (indent, _repr_type(type_, autogen_context))
|
538
541
|
if nullable is not None:
|
alembic/ddl/base.py
CHANGED
@@ -299,9 +299,13 @@ def format_server_default(
|
|
299
299
|
compiler: DDLCompiler,
|
300
300
|
default: Optional[_ServerDefault],
|
301
301
|
) -> str:
|
302
|
-
|
302
|
+
# this can be updated to use compiler.render_default_string
|
303
|
+
# for SQLAlchemy 2.0 and above; not in 1.4
|
304
|
+
default_str = compiler.get_column_default_string(
|
303
305
|
Column("x", Integer, server_default=default)
|
304
306
|
)
|
307
|
+
assert default_str is not None
|
308
|
+
return default_str
|
305
309
|
|
306
310
|
|
307
311
|
def format_type(compiler: DDLCompiler, type_: TypeEngine) -> str:
|
alembic/ddl/impl.py
CHANGED
@@ -46,7 +46,6 @@ if TYPE_CHECKING:
|
|
46
46
|
from sqlalchemy.engine.reflection import Inspector
|
47
47
|
from sqlalchemy.sql import ClauseElement
|
48
48
|
from sqlalchemy.sql import Executable
|
49
|
-
from sqlalchemy.sql.elements import ColumnElement
|
50
49
|
from sqlalchemy.sql.elements import quoted_name
|
51
50
|
from sqlalchemy.sql.schema import Constraint
|
52
51
|
from sqlalchemy.sql.schema import ForeignKeyConstraint
|
@@ -440,7 +439,7 @@ class DefaultImpl(metaclass=ImplMeta):
|
|
440
439
|
def drop_table_comment(self, table: Table) -> None:
|
441
440
|
self._exec(schema.DropTableComment(table))
|
442
441
|
|
443
|
-
def create_column_comment(self, column:
|
442
|
+
def create_column_comment(self, column: Column[Any]) -> None:
|
444
443
|
self._exec(schema.SetColumnComment(column))
|
445
444
|
|
446
445
|
def drop_index(self, index: Index, **kw: Any) -> None:
|
alembic/op.pyi
CHANGED
@@ -146,12 +146,12 @@ def alter_column(
|
|
146
146
|
*,
|
147
147
|
nullable: Optional[bool] = None,
|
148
148
|
comment: Union[str, Literal[False], None] = False,
|
149
|
-
server_default:
|
149
|
+
server_default: Union[str, bool, Identity, Computed, TextClause] = False,
|
150
150
|
new_column_name: Optional[str] = None,
|
151
151
|
type_: Union[TypeEngine[Any], Type[TypeEngine[Any]], None] = None,
|
152
152
|
existing_type: Union[TypeEngine[Any], Type[TypeEngine[Any]], None] = None,
|
153
153
|
existing_server_default: Union[
|
154
|
-
str, bool, Identity, Computed, None
|
154
|
+
str, bool, Identity, Computed, TextClause, None
|
155
155
|
] = False,
|
156
156
|
existing_nullable: Optional[bool] = None,
|
157
157
|
existing_comment: Optional[str] = None,
|
alembic/operations/base.py
CHANGED
@@ -705,14 +705,16 @@ class Operations(AbstractOperations):
|
|
705
705
|
*,
|
706
706
|
nullable: Optional[bool] = None,
|
707
707
|
comment: Union[str, Literal[False], None] = False,
|
708
|
-
server_default:
|
708
|
+
server_default: Union[
|
709
|
+
str, bool, Identity, Computed, TextClause
|
710
|
+
] = False,
|
709
711
|
new_column_name: Optional[str] = None,
|
710
712
|
type_: Union[TypeEngine[Any], Type[TypeEngine[Any]], None] = None,
|
711
713
|
existing_type: Union[
|
712
714
|
TypeEngine[Any], Type[TypeEngine[Any]], None
|
713
715
|
] = None,
|
714
716
|
existing_server_default: Union[
|
715
|
-
str, bool, Identity, Computed, None
|
717
|
+
str, bool, Identity, Computed, TextClause, None
|
716
718
|
] = False,
|
717
719
|
existing_nullable: Optional[bool] = None,
|
718
720
|
existing_comment: Optional[str] = None,
|
alembic/operations/ops.py
CHANGED
@@ -1840,14 +1840,16 @@ class AlterColumnOp(AlterTableOp):
|
|
1840
1840
|
*,
|
1841
1841
|
nullable: Optional[bool] = None,
|
1842
1842
|
comment: Optional[Union[str, Literal[False]]] = False,
|
1843
|
-
server_default:
|
1843
|
+
server_default: Union[
|
1844
|
+
str, bool, Identity, Computed, TextClause
|
1845
|
+
] = False,
|
1844
1846
|
new_column_name: Optional[str] = None,
|
1845
1847
|
type_: Optional[Union[TypeEngine[Any], Type[TypeEngine[Any]]]] = None,
|
1846
1848
|
existing_type: Optional[
|
1847
1849
|
Union[TypeEngine[Any], Type[TypeEngine[Any]]]
|
1848
1850
|
] = None,
|
1849
|
-
existing_server_default:
|
1850
|
-
|
1851
|
+
existing_server_default: Union[
|
1852
|
+
str, bool, Identity, Computed, TextClause, None
|
1851
1853
|
] = False,
|
1852
1854
|
existing_nullable: Optional[bool] = None,
|
1853
1855
|
existing_comment: Optional[str] = None,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: alembic
|
3
|
-
Version: 1.15.
|
3
|
+
Version: 1.15.2
|
4
4
|
Summary: A database migration tool for SQLAlchemy.
|
5
5
|
Author-email: Mike Bayer <mike_mp@zzzcomputing.com>
|
6
6
|
License: MIT
|
@@ -32,6 +32,7 @@ Requires-Dist: Mako
|
|
32
32
|
Requires-Dist: typing-extensions>=4.12
|
33
33
|
Provides-Extra: tz
|
34
34
|
Requires-Dist: tzdata; extra == "tz"
|
35
|
+
Dynamic: license-file
|
35
36
|
|
36
37
|
Alembic is a database migrations tool written by the author
|
37
38
|
of `SQLAlchemy <http://www.sqlalchemy.org>`_. A migrations tool
|
@@ -1,4 +1,4 @@
|
|
1
|
-
alembic/__init__.py,sha256=
|
1
|
+
alembic/__init__.py,sha256=PDxLEkRWLmnGm-ZRbHkB5ttYSP5d2jSlESHuNdGYVtQ,63
|
2
2
|
alembic/__main__.py,sha256=373m7-TBh72JqrSMYviGrxCHZo-cnweM8AGF8A22PmY,78
|
3
3
|
alembic/command.py,sha256=HIRFQFUG_A9ZgLBC-MG2WmE_eX0QxvvX2Os-_eL2zBQ,22242
|
4
4
|
alembic/config.py,sha256=BZ7mwFRk2gq8GFNxxy9qvMUFx43YbDbQTC99OnjqiKY,22216
|
@@ -7,26 +7,26 @@ alembic/context.pyi,sha256=fdeFNTRc0bUgi7n2eZWVFh6NG-TzIv_0gAcapbfHnKY,31773
|
|
7
7
|
alembic/environment.py,sha256=MM5lPayGT04H3aeng1H7GQ8HEAs3VGX5yy6mDLCPLT4,43
|
8
8
|
alembic/migration.py,sha256=MV6Fju6rZtn2fTREKzXrCZM6aIBGII4OMZFix0X-GLs,41
|
9
9
|
alembic/op.py,sha256=flHtcsVqOD-ZgZKK2pv-CJ5Cwh-KJ7puMUNXzishxLw,167
|
10
|
-
alembic/op.pyi,sha256=
|
10
|
+
alembic/op.pyi,sha256=_ZlgVwkkhey7kVGgnydFCLvvvFQo2uEofbyNpRXKupA,50180
|
11
11
|
alembic/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
alembic/autogenerate/__init__.py,sha256=ntmUTXhjLm4_zmqIwyVaECdpPDn6_u1yM9vYk6-553E,543
|
13
13
|
alembic/autogenerate/api.py,sha256=L4qkapSJO1Ypymx8HsjLl0vFFt202agwMYsQbIe6ZtI,22219
|
14
14
|
alembic/autogenerate/compare.py,sha256=FKmfogZOLXp4EIx9eQ-q_DzlnI4-jZYqyxw2yOw_84A,44341
|
15
|
-
alembic/autogenerate/render.py,sha256=
|
15
|
+
alembic/autogenerate/render.py,sha256=VFk0RZZ4Db_T2FQdtt2lzuHuE3x6r0VyWgzc_dnimgI,35877
|
16
16
|
alembic/autogenerate/rewriter.py,sha256=uZWRkTYJoncoEJ5WY1QBRiozjyChqZDJPy4LtcRibjM,7846
|
17
17
|
alembic/ddl/__init__.py,sha256=Df8fy4Vn_abP8B7q3x8gyFwEwnLw6hs2Ljt_bV3EZWE,152
|
18
18
|
alembic/ddl/_autogen.py,sha256=Blv2RrHNyF4cE6znCQXNXG5T9aO-YmiwD4Fz-qfoaWA,9275
|
19
|
-
alembic/ddl/base.py,sha256=
|
20
|
-
alembic/ddl/impl.py,sha256=
|
19
|
+
alembic/ddl/base.py,sha256=XlT5XEE6mtn09jfJ3khHmIM8iECmM8rlJEnTQa5vU60,9948
|
20
|
+
alembic/ddl/impl.py,sha256=SYQg-Sz7OGOJi3h0VAC0GIEiJp7TZwUUN2VGshmj0uE,30066
|
21
21
|
alembic/ddl/mssql.py,sha256=ydvgBSaftKYjaBaMyqius66Ta4CICQSj79Og3Ed2atY,14219
|
22
22
|
alembic/ddl/mysql.py,sha256=9OOAmtg4GpEqWSbATT6FCq0xLnU8PMjr0VlRB171-EI,17301
|
23
23
|
alembic/ddl/oracle.py,sha256=669YlkcZihlXFbnXhH2krdrvDry8q5pcUGfoqkg_R6Y,6243
|
24
24
|
alembic/ddl/postgresql.py,sha256=D4oCA2xCrKV-82aAEmXgEe-llyDtL4xc9_tAZgznkuU,29931
|
25
25
|
alembic/ddl/sqlite.py,sha256=9p9dlXbGMZACqeFnSuhm7eSapFDGJNd6WhBhZrdpqFg,7995
|
26
26
|
alembic/operations/__init__.py,sha256=e0KQSZAgLpTWvyvreB7DWg7RJV_MWSOPVDgCqsd2FzY,318
|
27
|
-
alembic/operations/base.py,sha256=
|
27
|
+
alembic/operations/base.py,sha256=xG-pYE3Aw0kU0_7cxSiNpv_U9dSrWy4E5aOsAApOURs,74516
|
28
28
|
alembic/operations/batch.py,sha256=1UmCFcsFWObinQWFRWoGZkjynl54HKpldbPs67aR4wg,26923
|
29
|
-
alembic/operations/ops.py,sha256=
|
29
|
+
alembic/operations/ops.py,sha256=Xjas55xKsOrT_BMLbiF_MpK2bhUMy1nCrI69--Gw1Bk,94983
|
30
30
|
alembic/operations/schemaobj.py,sha256=Wp-bBe4a8lXPTvIHJttBY0ejtpVR5Jvtb2kI-U2PztQ,9468
|
31
31
|
alembic/operations/toimpl.py,sha256=DhydxHxPlPejzFPHsN1VR2tHINUdlJw3eKOjjmJCyu0,7114
|
32
32
|
alembic/runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -75,9 +75,9 @@ alembic/util/langhelpers.py,sha256=LpOcovnhMnP45kTt8zNJ4BHpyQrlF40OL6yDXjqKtsE,1
|
|
75
75
|
alembic/util/messaging.py,sha256=aLF6xbRiOCOEW1UY5vA9AAlfkGeNLqPPGSs-3c8-bfc,3166
|
76
76
|
alembic/util/pyfiles.py,sha256=zltVdcwEJJCPS2gHsQvkHkQakuF6wXiZ6zfwHbGNT0g,3489
|
77
77
|
alembic/util/sqla_compat.py,sha256=SWAL4hJck4XLnUpe-oI3AGiH8w9kgDBe1_oakCfdT_Q,14785
|
78
|
-
alembic-1.15.
|
79
|
-
alembic-1.15.
|
80
|
-
alembic-1.15.
|
81
|
-
alembic-1.15.
|
82
|
-
alembic-1.15.
|
83
|
-
alembic-1.15.
|
78
|
+
alembic-1.15.2.dist-info/licenses/LICENSE,sha256=NeqcNBmyYfrxvkSMT0fZJVKBv2s2tf_qVQUiJ9S6VN4,1059
|
79
|
+
alembic-1.15.2.dist-info/METADATA,sha256=cVL7zyIqMo0m8XWloUHPxkUzUS9jiNq12BMZWm8igfo,7259
|
80
|
+
alembic-1.15.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
81
|
+
alembic-1.15.2.dist-info/entry_points.txt,sha256=aykM30soxwGN0pB7etLc1q0cHJbL9dy46RnK9VX4LLw,48
|
82
|
+
alembic-1.15.2.dist-info/top_level.txt,sha256=FwKWd5VsPFC8iQjpu1u9Cn-JnK3-V1RhUCmWqz1cl-s,8
|
83
|
+
alembic-1.15.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|