fix(db): unify table name prefix to mjk_ for update tables
- Rename app_releases → mjk_app_releases - Rename release_packages → mjk_release_packages - Update ForeignKey reference and migration file - Add pre-commit hook: check_table_prefix.py to prevent future violations
This commit is contained in:
@@ -16,7 +16,7 @@ from app.db.session import Base
|
||||
class AppRelease(Base):
|
||||
"""应用版本发布记录"""
|
||||
|
||||
__tablename__ = "app_releases"
|
||||
__tablename__ = "mjk_app_releases"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
version: Mapped[str] = mapped_column(String(20), unique=True, nullable=False, index=True)
|
||||
@@ -38,12 +38,12 @@ class AppRelease(Base):
|
||||
class ReleasePackage(Base):
|
||||
"""平台安装包信息"""
|
||||
|
||||
__tablename__ = "release_packages"
|
||||
__tablename__ = "mjk_release_packages"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
release_id: Mapped[int] = mapped_column(
|
||||
Integer,
|
||||
ForeignKey("app_releases.id", ondelete="CASCADE"),
|
||||
ForeignKey("mjk_app_releases.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
)
|
||||
platform: Mapped[str] = mapped_column(String(20), nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user