Initial commit
This commit is contained in:
16
backend/app/models.py
Normal file
16
backend/app/models.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from sqlalchemy import Column, Integer, String, Float, DateTime
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from datetime import datetime
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
class Transaction(Base):
|
||||
__tablename__ = "transactions"
|
||||
id = Column(Integer, primary_key=True)
|
||||
firefly_id = Column(Integer, unique=True, index=True)
|
||||
date = Column(DateTime, index=True)
|
||||
amount = Column(Float)
|
||||
description = Column(String)
|
||||
type = Column(String)
|
||||
category_id = Column(Integer, nullable=True)
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
Reference in New Issue
Block a user