Skip to content

Commit 05bd5d5

Browse files
committed
feat: remove custom gen_random_uuid implementation
1 parent 0a2175e commit 05bd5d5

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/notora/v2/models/base.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
mapped_column,
1313
relationship,
1414
)
15-
from sqlalchemy.sql.functions import GenericFunction
1615

1716
POSTGRES_NAMING_CONVENTION = {
1817
'ix': '%(column_0_label)s_idx',
@@ -28,12 +27,6 @@ class Base(DeclarativeBase):
2827
metadata = metadata
2928

3029

31-
class GenerateUUID(GenericFunction[uuid.UUID]):
32-
type = UUID()
33-
name = 'gen_random_uuid'
34-
identifier = 'gen_random_uuid'
35-
36-
3730
class CreatableMixin:
3831
created_at: Mapped[datetime] = mapped_column(
3932
DateTime(timezone=False),
@@ -72,7 +65,7 @@ class GenericBaseModel(Base, CreatableMixin):
7265
id: Mapped[uuid.UUID] = mapped_column(
7366
UUID,
7467
primary_key=True,
75-
server_default=GenerateUUID(),
68+
server_default=func.gen_random_uuid(),
7669
)
7770

7871
def __repr__(self) -> str:

0 commit comments

Comments
 (0)