fix(models): update Company model to extend existing schema and clean up LineItem model
This commit is contained in:
@@ -21,7 +21,7 @@ class Company(Base, TimestampMixin):
|
||||
"""Información principal de la empresa"""
|
||||
|
||||
__tablename__ = "company"
|
||||
__table_args__ = {"schema": "a76"}
|
||||
__table_args__ = {"schema": "a76", "extend_existing": True}
|
||||
|
||||
# Primary key
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||
|
||||
@@ -11,7 +11,7 @@ from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status, File, UploadFile
|
||||
from fastapi.responses import FileResponse, UploadFile, File
|
||||
from fastapi.responses import FileResponse
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from core.database import get_core_db
|
||||
|
||||
@@ -26,11 +26,6 @@ class LineItem(Base, TenantScopedMixin, TimestampMixin):
|
||||
|
||||
__tablename__ = "item_lines"
|
||||
__table_args__ = (
|
||||
ForeignKeyConstraint(
|
||||
["class_code", "tenant_id", "company_id"],
|
||||
["a76.classes.class_code", "a76.classes.tenant_id", "a76.classes.company_id"],
|
||||
name="fk_item_lines_class"
|
||||
),
|
||||
{"schema": "a76"},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user