import uuid

from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy_serializer import SerializerMixin

from ul_db_utils.modules.postgres_modules.db import db, DbModel


class MediaFileType(DbModel, SerializerMixin):
    """
    Model for media-storage-service
    git: /unic-lab/libraries/common-services/media-storage

    mime_type: str, mime_type of file generated by service using Magic library
    name: str, extension of file, or file purpose
    """

    __tablename__ = 'media_file_type'

    id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)

    mime_type = db.Column(db.String(255), nullable=False)
    name = db.Column(db.String(255), nullable=False)
