mirror of
https://github.com/Rainyy21/URL_shortener.git
synced 2026-10-11 00:30:13 -04:00
add database but need to test it
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy.sql.traversals import ColIdentityComparatorStrategy
|
||||
from .database import Base
|
||||
|
||||
|
||||
class URL(Base):
|
||||
__tablename__ = "urls"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
short_code = Column(String, unique=True, index=True)
|
||||
long_url = Column(String)
|
||||
create_at = Column(DateTime, default=datetime.utcnow)
|
||||
Reference in New Issue
Block a user