diff --git a/pyproject.toml b/pyproject.toml index 9c2a9b2..8cb6a6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ requires-python = ">= 3.8" dependencies = [ "SQLAlchemy-Continuum", - "WuttJamaican[db]", + "WuttJamaican[db]>=0.17.0", ] diff --git a/src/wutta_continuum/db/alembic/versions/71406251b8e7_first_versioning_tables.py b/src/wutta_continuum/db/alembic/versions/71406251b8e7_first_versioning_tables.py index fe54b41..1cc4c20 100644 --- a/src/wutta_continuum/db/alembic/versions/71406251b8e7_first_versioning_tables.py +++ b/src/wutta_continuum/db/alembic/versions/71406251b8e7_first_versioning_tables.py @@ -9,6 +9,7 @@ from typing import Sequence, Union from alembic import op import sqlalchemy as sa +import wuttjamaican.db.util # revision identifiers, used by Alembic. @@ -25,7 +26,7 @@ def upgrade() -> None: sa.Column('issued_at', sa.DateTime(), nullable=True), sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), sa.Column('remote_addr', sa.String(length=50), nullable=True), - sa.Column('user_id', sa.String(length=32), nullable=True), + sa.Column('user_id', wuttjamaican.db.util.UUID(), nullable=True), sa.ForeignKeyConstraint(['user_id'], ['user.uuid'], name=op.f('fk_transaction_user_id_user')), sa.PrimaryKeyConstraint('id', name=op.f('pk_transaction')) ) @@ -33,7 +34,7 @@ def upgrade() -> None: # person op.create_table('person_version', - sa.Column('uuid', sa.String(length=32), autoincrement=False, nullable=False), + sa.Column('uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False), sa.Column('full_name', sa.String(length=100), autoincrement=False, nullable=True), sa.Column('first_name', sa.String(length=50), autoincrement=False, nullable=True), sa.Column('middle_name', sa.String(length=50), autoincrement=False, nullable=True), @@ -49,10 +50,10 @@ def upgrade() -> None: # user op.create_table('user_version', - sa.Column('uuid', sa.String(length=32), autoincrement=False, nullable=False), + sa.Column('uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False), sa.Column('username', sa.String(length=25), autoincrement=False, nullable=True), sa.Column('password', sa.String(length=60), autoincrement=False, nullable=True), - sa.Column('person_uuid', sa.String(length=32), autoincrement=False, nullable=True), + sa.Column('person_uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True), sa.Column('active', sa.Boolean(), autoincrement=False, nullable=True), sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), @@ -65,7 +66,7 @@ def upgrade() -> None: # role op.create_table('role_version', - sa.Column('uuid', sa.String(length=32), autoincrement=False, nullable=False), + sa.Column('uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False), sa.Column('name', sa.String(length=100), autoincrement=False, nullable=True), sa.Column('notes', sa.Text(), autoincrement=False, nullable=True), sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), @@ -79,9 +80,9 @@ def upgrade() -> None: # user_x_role op.create_table('user_x_role_version', - sa.Column('uuid', sa.String(length=32), autoincrement=False, nullable=False), - sa.Column('user_uuid', sa.String(length=32), autoincrement=False, nullable=True), - sa.Column('role_uuid', sa.String(length=32), autoincrement=False, nullable=True), + sa.Column('uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False), + sa.Column('user_uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True), + sa.Column('role_uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True), sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), sa.Column('operation_type', sa.SmallInteger(), nullable=False), @@ -93,7 +94,7 @@ def upgrade() -> None: # permission op.create_table('permission_version', - sa.Column('role_uuid', sa.String(length=32), autoincrement=False, nullable=False), + sa.Column('role_uuid', wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False), sa.Column('permission', sa.String(length=254), autoincrement=False, nullable=False), sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), sa.Column('end_transaction_id', sa.BigInteger(), nullable=True),