Skip to content

Commit 1d355c7

Browse files
committed
add uuid to trip
1 parent 017b7e0 commit 1d355c7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

models/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import jwt
22
import datetime
3+
import uuid
34

45
from random import choice
56

67
from passlib.hash import pbkdf2_sha256 as sha256
78
from sqlalchemy import Boolean, Column, ForeignKey, Integer, DATE, String, DateTime, TIMESTAMP, func, \
8-
Numeric, UniqueConstraint
9+
Numeric, UniqueConstraint, UUID
910
from sqlalchemy.ext.declarative import declarative_base, declared_attr
1011
from sqlalchemy.ext.hybrid import hybrid_property
1112
from sqlalchemy.orm import relationship
@@ -239,6 +240,7 @@ class Pack(Base):
239240

240241
class Trip(Base):
241242
id = Column(Integer, primary_key=True, index=True)
243+
uuid = Column(UUID(as_uuid=True), default=uuid.uuid4)
242244
user_id = Column(Integer, ForeignKey("user.id"), nullable=False)
243245

244246
title = Column(String(500), nullable=False)

0 commit comments

Comments
 (0)