mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
* feat: add persistence field * feat: add basic extension page in pipeline config * Merge pull request #1751 from langbot-app/copilot/add-plugin-extension-tab Implement pipeline-scoped plugin binding system * fix: i18n keys --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
21 lines
669 B
Python
21 lines
669 B
Python
import sqlalchemy
|
|
from .. import migration
|
|
|
|
|
|
@migration.migration_class(9)
|
|
class DBMigratePipelineExtensionPreferences(migration.DBMigration):
|
|
"""Pipeline extension preferences"""
|
|
|
|
async def upgrade(self):
|
|
"""Upgrade"""
|
|
|
|
sql_text = sqlalchemy.text(
|
|
"ALTER TABLE legacy_pipelines ADD COLUMN extensions_preferences JSON NOT NULL DEFAULT '{}'"
|
|
)
|
|
await self.ap.persistence_mgr.execute_async(sql_text)
|
|
|
|
async def downgrade(self):
|
|
"""Downgrade"""
|
|
sql_text = sqlalchemy.text('ALTER TABLE legacy_pipelines DROP COLUMN extensions_preferences')
|
|
await self.ap.persistence_mgr.execute_async(sql_text)
|