Docs/installation tutorial (#7)
* [add]修改迁移文件新建空白表结构 * Add installation guide and environment setup Added installation instructions and environment requirements for MemoryBear. * [delete]删除api,web的readme.md。只保留唯一readme.md * Fix database connection example in README Update database connection configuration example in README.
This commit is contained in:
@@ -20,14 +20,21 @@ depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('data_config', 'llm_id',
|
||||
existing_type=sa.VARCHAR(),
|
||||
comment='LLM模型配置ID',
|
||||
existing_nullable=True)
|
||||
op.alter_column('data_config', 'embedding_id',
|
||||
existing_type=sa.VARCHAR(),
|
||||
comment='嵌入模型配置ID',
|
||||
existing_nullable=True)
|
||||
# 检查表和列是否存在再进行操作
|
||||
op.execute("""
|
||||
DO $$
|
||||
BEGIN
|
||||
IF EXISTS (SELECT FROM information_schema.columns
|
||||
WHERE table_name = 'data_config' AND column_name = 'llm_id') THEN
|
||||
COMMENT ON COLUMN data_config.llm_id IS 'LLM模型配置ID';
|
||||
END IF;
|
||||
|
||||
IF EXISTS (SELECT FROM information_schema.columns
|
||||
WHERE table_name = 'data_config' AND column_name = 'embedding_id') THEN
|
||||
COMMENT ON COLUMN data_config.embedding_id IS '嵌入模型配置ID';
|
||||
END IF;
|
||||
END $$;
|
||||
""")
|
||||
op.add_column('workspaces', sa.Column('storage_type', sa.String(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
Reference in New Issue
Block a user