from sqlmodel import SQLModel, Field, JSON, Relationship, VARCHAR
from pydantic import BaseModel
from datetime import datetime
from typing import List, Optional
from sqlalchemy import String, Column


class ServerCatagoryLink(SQLModel, table=True):
    server_id: Optional[int] = Field(
        default=None, foreign_key="server.id", primary_key=True
    )
    catagory_id: Optional[int] = Field(
        default=None, foreign_key="catagory.id", primary_key=True
    )


class ServerOrganizationLink(SQLModel, table=True):
    server_id: Optional[int] = Field(
        default=None, foreign_key="server.id", primary_key=True
    )
    organization_id: Optional[int] = Field(
        default=None, foreign_key="organization.id", primary_key=True
    )


class Catagory(SQLModel, table=True):
    id: int = 