model-service/model_service/model/aimodel.py
marcsello 38509c5a39
All checks were successful
continuous-integration/drone/push Build is passing
Revised API endpoints
2020-10-02 03:28:40 +02:00

22 lines
666 B
Python

#!/usr/bin/env python3
from .db import db
from sqlalchemy.sql import func
from sqlalchemy.dialects.postgresql import UUID
import uuid
import enum
class AIModelType(enum.Enum):
# Optimally this would be upper case (as a convention for enums) But we want this to be the same as in the url schema
svm = 1
cnn = 2
class AIModel(db.Model):
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, unique=True, nullable=False)
timestamp = db.Column(db.TIMESTAMP, nullable=False, server_default=func.now())
type = db.Column(db.Enum(AIModelType), nullable=False)
target_class_name = db.Column(db.String(50), nullable=False)