diff --git a/src/wuttjamaican/db/util.py b/src/wuttjamaican/db/util.py index 88362c4..30f9f82 100644 --- a/src/wuttjamaican/db/util.py +++ b/src/wuttjamaican/db/util.py @@ -61,10 +61,12 @@ def uuid_column(*args, **kwargs): """ Returns a UUID column for use as a table's primary key. """ + if not args: + args = (sa.String(length=32),) kwargs.setdefault('primary_key', True) kwargs.setdefault('nullable', False) kwargs.setdefault('default', make_uuid) - return sa.Column(sa.String(length=32), *args, **kwargs) + return sa.Column(*args, **kwargs) def uuid_fk_column(target_column, *args, **kwargs): @@ -74,4 +76,6 @@ def uuid_fk_column(target_column, *args, **kwargs): :param target_column: Name of the table column on the remote side, e.g. ``'user.uuid'``. """ - return sa.Column(sa.String(length=32), sa.ForeignKey(target_column), *args, **kwargs) + if not args: + args = (sa.String(length=32), sa.ForeignKey(target_column)) + return sa.Column(*args, **kwargs)