初始提交:极码 GeekCode 全栈项目(FastAPI + Vue3)
This commit is contained in:
13
backend/models/category.py
Normal file
13
backend/models/category.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""帖子分类模型"""
|
||||
from sqlalchemy import Column, Integer, String, Boolean
|
||||
from database import Base
|
||||
|
||||
|
||||
class Category(Base):
|
||||
"""帖子分类表"""
|
||||
__tablename__ = "categories"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String(50), unique=True, nullable=False)
|
||||
sort_order = Column(Integer, default=0) # 排序,越小越靠前
|
||||
is_active = Column(Boolean, default=True) # 是否启用
|
||||
Reference in New Issue
Block a user