from enum import Enum
from typing import Dict, Optional, Union
from sqlmodel import Field, SQLModel, create_engine

# https://stackoverflow.com/questions/65209934/pydantic-enum-field-does-not-get-converted-to-string
class EventType(str, Enum):
    BUILD_IMAGE = 'build_image'
    CREATE_CONTAINER = 'create_container'

class Event(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    event_type: EventType
    event_payload: str
    event_status: Optional[int] = Field(default=None)


sqlmodel.Field
[((378, 415), 'sqlmodel.Field', 'Field', ([], {'default': 'None', 'primary_key': '(True)'}), '(default=None, primary_key=True)\n', (383, 415), False, 'from sqlmodel import Field, SQLModel, create_engine\n'), ((499, 518), 'sqlmodel.Field', 'Field', ([], {'default': 'None'}), '(default=None)\n', (504, 518), False, 'from sqlmodel import Field, SQLModel, create_engine\n')]