def upgrade():
op.add_column(
'dataset',
sa.Column(
'meta',
postgresql.JSONB(),
nullable=True
)
)
op.execute('''
UPDATE "dataset" SET
meta = jsonb_set(coalesce(meta, '{}'), '{organization_id}', to_jsonb(organization_id))
WHERE
organization_id IS NOT NULL
''')
op.drop_column('dataset', 'organization_id')
889fee1f3c80_add_meta_to_dataset.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录