mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-12 00:40:07 +08:00
Added column to post table for lang with US english set to default. Included alembic migration
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
"""Added lang column for ISO-639-1 codes
|
||||
|
||||
Revision ID: ef0b52902560
|
||||
Revises: 3358eb6834e6
|
||||
Create Date: 2022-12-28 18:24:21.393973
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ef0b52902560'
|
||||
down_revision = '3358eb6834e6'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('post', sa.Column('lang', sqlmodel.sql.sqltypes.AutoString(length=200), nullable=False, default="en-US"))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('post', 'lang')
|
||||
# ### end Alembic commands ###
|
||||
@@ -31,3 +31,4 @@ class Post(SQLModel, table=True):
|
||||
)
|
||||
payload_type: str = Field(nullable=False, max_length=200)
|
||||
payload: PayloadContainer = Field(sa_column=sa.Column(payload_column_type(PayloadContainer), nullable=True))
|
||||
lang: str = Field(nullable=False, max_length=200, default="en-US")
|
||||
Reference in New Issue
Block a user