update
This commit is contained in:
30
Backend/src/models/cookie_integration_config.py
Normal file
30
Backend/src/models/cookie_integration_config.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from ..config.database import Base
|
||||
|
||||
|
||||
class CookieIntegrationConfig(Base):
|
||||
"""
|
||||
Stores IDs for well-known integrations (e.g., Google Analytics, Meta Pixel).
|
||||
Does NOT allow arbitrary script injection from the dashboard.
|
||||
"""
|
||||
|
||||
__tablename__ = "cookie_integration_configs"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
||||
|
||||
ga_measurement_id = Column(String(64), nullable=True) # e.g. G-XXXXXXXXXX
|
||||
fb_pixel_id = Column(String(64), nullable=True) # e.g. 1234567890
|
||||
|
||||
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
||||
updated_at = Column(
|
||||
DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False
|
||||
)
|
||||
|
||||
updated_by_id = Column(Integer, ForeignKey("users.id"), nullable=True)
|
||||
updated_by = relationship("User", lazy="joined")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user