feat(FN-004): merge fusion/fn-004
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import uuid
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sqlalchemy import ForeignKey, String, Text
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.models.base import Base, TimestampMixin, UUIDMixin
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from app.models.project import Project
|
||||
|
||||
|
||||
class Repository(Base, UUIDMixin, TimestampMixin):
|
||||
__tablename__ = "repository"
|
||||
|
||||
project_id: Mapped[uuid.UUID] = mapped_column(
|
||||
ForeignKey("project.id"), index=True
|
||||
)
|
||||
name: Mapped[str] = mapped_column(String(255))
|
||||
git_url: Mapped[str] = mapped_column(Text)
|
||||
provider_type: Mapped[str] = mapped_column(
|
||||
String(50), default="generic"
|
||||
)
|
||||
default_branch: Mapped[str] = mapped_column(
|
||||
String(100), default="main"
|
||||
)
|
||||
|
||||
project: Mapped["Project"] = relationship(
|
||||
back_populates="repositories"
|
||||
)
|
||||
Reference in New Issue
Block a user