updated the course index part
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"""added index in course
|
||||
|
||||
Revision ID: 55b5303d6c3c
|
||||
Revises: e77992962f85
|
||||
Create Date: 2025-01-21 13:13:39.309350
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel.sql.sqltypes
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '55b5303d6c3c'
|
||||
down_revision = 'e77992962f85'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('course', sa.Column('index', sa.Integer(), nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('course', 'index')
|
||||
# ### end Alembic commands ###
|
@@ -38,7 +38,7 @@ if settings.BACKEND_CORS_ORIGINS:
|
||||
CORSMiddleware,
|
||||
allow_origins=[
|
||||
str(origin).strip("/") for origin in settings.BACKEND_CORS_ORIGINS
|
||||
] + ["http://localhost:3000"]+["http://localhost:5173"]+["http://localhost:5173/aboutUs"]+["https://cms.oneandallmusic.net"]+["https://oneandallmusic.net"],
|
||||
] + ["http://localhost:3000"]+["http://cms.localhost:3000"]+["http://localhost:5173"]+["http://localhost:5173/aboutUs"]+["https://cms.oneandallmusic.net"]+["https://oneandallmusic.net"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
@@ -236,6 +236,7 @@ class CourseBase(SQLModel):
|
||||
title: str = Field(max_length=255)
|
||||
sort_description: str = Field(max_length=32768)
|
||||
long_description: str = Field(max_length=32768)
|
||||
index: int = Field(default=10)
|
||||
information: str = Field(max_length=32768)
|
||||
contant: str = Field(max_length=32768)
|
||||
remark: str = Field(max_length=32768)
|
||||
@@ -264,6 +265,7 @@ class Course(CourseBase, table=True):
|
||||
class CoursePublic(CourseBase):
|
||||
id: uuid.UUID
|
||||
title: str
|
||||
index: int
|
||||
images: list["Image"]
|
||||
info_images: list["Info_Image"]
|
||||
schedule: list["Schedule"]
|
||||
|
Reference in New Issue
Block a user