You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/api/migrations/versions
QuantumGhost 9565fe9b1b
fix(api): fix alembic offline mode (#19285)
Alembic's offline mode generates SQL from SQLAlchemy migration operations,
providing developers with a clear view of database schema changes without
requiring an active database connection.

However, some migration versions (specifically bbadea11becb and d7999dfa4aae)
were performing database schema introspection, which fails in offline mode
since it requires an actual database connection.

This commit:
- Adds offline mode support by detecting context.is_offline_mode()
- Skips introspection steps when in offline mode
- Adds warning messages in SQL output to inform users that assumptions were made
- Prompts users to review the generated SQL for accuracy

These changes ensure migrations work consistently in both online and offline modes.

Close #19284.
9 months ago
..
00bacef91f18_rename_api_provider_description.py bump version to 0.5.3 (#2306) 2 years ago
2a3aebbbf4bb_add_app_tracing.py Feat/add-remote-file-upload-api (#9906) 1 year ago
2beac44e5f5f_add_is_universal_in_apps.py improve: introduce isort for linting Python imports (#1983) 2 years ago
2c8af9671032_add_qa_document_language.py improve: introduce isort for linting Python imports (#1983) 2 years ago
2e9819ca5b28_add_tenant_id_in_api_token.py improve: introduce isort for linting Python imports (#1983) 2 years ago
3b18fea55204_add_tool_label_bings.py feat/enhance the multi-modal support (#8818) 1 year ago
3c7cac9521c6_add_tags_and_binding_table.py Knowledge optimization (#3755) 2 years ago
3ef9b2b6bee6_add_assistant_app.py bump version to 0.5.3 (#2306) 2 years ago
03f98355ba0e_add_workflow_tool_label_and_tool_.py chore: cleanup pycodestyle E rules (#8269) 1 year ago
4bcffcd64aa4_update_dataset_model_field_null_.py improve: introduce isort for linting Python imports (#1983) 2 years ago
04c602f5dc9b_update_appmodelconfig_and_add_table_.py Feat/add-remote-file-upload-api (#9906) 1 year ago
4e99a8df00ff_add_load_balancing.py feat/enhance the multi-modal support (#8818) 1 year ago
4ff534e1eb11_add_workflow_to_site.py feat: option to hide workflow steps (#5436) 2 years ago
5fda94355fce_custom_disclaimer.py fix: workaround db migration error when adding custom_disclaimer column to recommended_apps (#4518) 2 years ago
6dcb43972bdc_add_dataset_retriever_resource.py improve: introduce isort for linting Python imports (#1983) 2 years ago
6e2cfb077b04_add_dataset_collection_binding.py improve: introduce isort for linting Python imports (#1983) 2 years ago
6e957a32015b_add_embedding_cache_created_at_index.py update clean embedding cache query logic (#6483) 2 years ago
7b45942e39bb_add_api_key_auth_binding.py feat/enhance the multi-modal support (#8818) 1 year ago
7bdef072e63a_add_workflow_tool.py feat/enhance the multi-modal support (#8818) 1 year ago
7ce5a52e4eee_add_tool_providers.py improve: introduce isort for linting Python imports (#1983) 2 years ago
7e6a8693e07a_add_table_dataset_permissions.py feat/enhance the multi-modal support (#8818) 1 year ago
8ae9bc661daa_add_tool_conversation_variables_idx.py enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366) 2 years ago
8d2d099ceb74_add_qa_model_support.py improve: introduce isort for linting Python imports (#1983) 2 years ago
8e5588e6412e_add_environment_variable_to_workflow_.py Feat/environment variables in workflow (#6515) 2 years ago
8ec536f3c800_rename_api_provider_credentails.py bump version to 0.5.3 (#2306) 2 years ago
8fe468ba0ca5_add_gpt4v_supports.py improve: introduce isort for linting Python imports (#1983) 2 years ago
9e98fbaffb88_add_workflow_tool_version.py chore: cleanup pycodestyle E rules (#8269) 1 year ago
9f4e3427ea84_add_created_by_role.py improve: introduce isort for linting Python imports (#1983) 2 years ago
9fafbd60eca1_add_message_file_belongs_to.py bump version to 0.5.3 (#2306) 2 years ago
16fa53d9faec_add_provider_model_support.py improve: introduce isort for linting Python imports (#1983) 2 years ago
17b5ab037c40_add_keyworg_table_storage_type.py add keyword table s3 storage support (#3065) 2 years ago
23db93619b9d_add_message_files_into_agent_thought.py bump version to 0.5.3 (#2306) 2 years ago
42e85ed5564d_conversation_columns_set_nullable.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
47cc7df8c4f3_modify_default_model_name_length.py fix: system default model name length (#4245) (#4246) 2 years ago
53bf8af60645_update_model.py Fix/6615 40 varchar limit on model name (#6623) 2 years ago
053da0c1d756_add_api_tool_privacy.py bump version to 0.5.3 (#2306) 2 years ago
63f9175e515b_merge_branches.py FR: #4048 - Add color customization to the chatbot (#4885) 2 years ago
64a70a7aab8b_add_workflow_run_index.py fix: workflow run sequence number slow sql (#4737) 2 years ago
64b051264f32_init.py Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 9 months ago
77e83833755c_add_app_config_retriever_resource.py improve: introduce isort for linting Python imports (#1983) 2 years ago
89c7899ca936_.py bump version to 0.5.3 (#2306) 2 years ago
114eed84c228_remove_tool_id_from_model_invoke.py bump version to 0.5.3 (#2306) 2 years ago
161cadc1af8d_add_dataset_permission_tenant_id.py fix dataset operator (#6064) 2 years ago
246ba09cbbdb_add_app_anntation_setting.py improve: introduce isort for linting Python imports (#1983) 2 years ago
380c6aa5a70d_add_tool_labels_to_agent_thought.py bump version to 0.5.3 (#2306) 2 years ago
563cf8bf777b_enable_tool_file_without_conversation_id.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
614f77cecc48_add_last_active_at.py improve: introduce isort for linting Python imports (#1983) 2 years ago
675b5321501b_add_node_execution_id_into_node_.py feat: Parallel Execution of Nodes in Workflows (#8192) 1 year ago
714aafe25d39_add_anntation_history_match_response.py improve: introduce isort for linting Python imports (#1983) 2 years ago
853f9b9cd3b6_add_message_price_unit.py enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366) 2 years ago
968fff4c0ab9_add_api_based_extension.py improve: introduce isort for linting Python imports (#1983) 2 years ago
2024_08_09_0801-1787fbae959a_update_tools_original_url_length.py Feat/update tools length (#7141) 2 years ago
2024_08_13_0633-63a83fcf12ba_support_conversation_variables.py Feat: conversation variable & variable assigner node (#7222) 2 years ago
2024_08_14_1354-8782057ff0dc_add_conversations_dialogue_count.py feat(api/workflow): Add `Conversation.dialogue_count` (#7275) 1 year ago
2024_08_15_0956-0251a1c768cc_add_tidb_auth_binding.py add tidb on qdrant type (#9831) 1 year ago
2024_08_15_1001-a6be81136580_app_and_site_icon_type.py feat: custom app icon (#7196) 1 year ago
2024_08_20_0455-2dbe42621d96_rename_workflow__conversation_variables_.py chore(database): Rename table name from `workflow__conversation_variables` to `workflow_conversation_variables`. (#7432) 1 year ago
2024_08_25_0441-d0187d6a88dd_add_created_by_and_updated_by_to_app_.py feat: store created_by and updated_by for apps, modelconfigs, and sites (#7613) 1 year ago
2024_09_01_1255-030f4915f36a_add_use_icon_as_answer_icon_fields_for_.py feat: allow users to use the app icon as the answer icon (#7888) 1 year ago
2024_09_11_1012-d57ba9ebb251_add_parent_message_id_to_messages.py feat: regenerate in `Chat`, `agent` and `Chatflow` app (#7661) 1 year ago
2024_09_24_0922-6af6a521a53e_update_retrieval_resource.py external knowledge api (#8913) 1 year ago
2024_09_25_0434-33f5fac87f29_external_knowledge_api.py external knowledge api (#8913) 1 year ago
2024_09_29_0835-ddcc8bbef391_increase_max_length_of_builtin_tool_provider.py Introduce Plugins (#13836) 12 months ago
2024_10_09_1329-d8e744d88ed6_fix_wrong_service_api_history.py fix(migrations): correct schema reference in service API history migration (#10452) 1 year ago
2024_10_10_0516-bbadea11becb_add_name_and_size_to_tool_files.py fix(api): fix alembic offline mode (#19285) 9 months ago
2024_10_22_0959-43fa78bc3b7d_add_white_list.py add tidb on qdrant type (#9831) 1 year ago
2024_10_28_0720-08ec4f75af5e_add_tenant_plugin_permisisons.py Introduce Plugins (#13836) 12 months ago
2024_11_01_0434-d3f6769a94a3_add_upload_files_source_url.py Feat/add-remote-file-upload-api (#9906) 1 year ago
2024_11_01_0449-93ad8c19c40b_rename_conversation_variables_index_name.py Feat/add-remote-file-upload-api (#9906) 1 year ago
2024_11_01_0540-f4d7ce70a7ca_update_upload_files_source_url.py Feat/add-remote-file-upload-api (#9906) 1 year ago
2024_11_01_0622-d07474999927_update_type_of_custom_disclaimer_to_text.py Feat/add-remote-file-upload-api (#9906) 1 year ago
2024_11_01_0623-09a8d1878d9b_update_workflows_graph_features_and_.py refactor(migration/model): update column types for workflow schema (#10160) 1 year ago
2024_11_12_0925-01d6889832f7_add_created_at_index_for_messages.py Feat/clean message records (#10588) 1 year ago
2024_11_22_0701-e19037032219_parent_child_index.py Feat/support parent child chunk (#12092) 1 year ago
2024_11_28_0553-cf8f4fc45278_add_exceptions_count_field_to_.py Feat: continue on error (#11458) 1 year ago
2024_12_19_1746-11b07f66c737_remove_unused_tool_providers.py chore(db): use a better way to export models and remove unused table (#11838) 1 year ago
2024_12_20_0628-e1944c35e15e_add_retry_index_field_to_node_execution_.py Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 9 months ago
2024_12_23_1154-d7999dfa4aae_remove_workflow_node_executions_retry_.py fix(api): fix alembic offline mode (#19285) 9 months ago
2024_12_25_1137-923752d42eb6_add_auto_disabled_dataset_logs.py Feat/support parent child chunk (#12092) 1 year ago
2025_01_01_2000-a91b476a53de_change_workflow_runs_total_tokens_to_.py fix(models): use bigint on workflow_runs.total_tokens (#12279) 1 year ago
2025_01_14_0617-f051706725cc_add_rate_limit_logs.py fix db migration (#15422) 11 months ago
2025_02_27_0917-d20049ed0af6_add_metadata_function.py Support knowledge metadata filter (#15982) 11 months ago
2025_03_03_0304-4413929e1ec2_extend_provider_name_column.py fix: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(40) Fixes #14593 (#14597) 11 months ago
2025_03_03_1436-ee79d9b1c156_add_marked_name_and_marked_comment_in_.py feat(workflow_service): workflow version control api. (#14860) 11 months ago
2025_03_07_0315-5511c782ee4c_extend_provider_column.py Fix: psycopg2.errors.StringDataRightTruncation value too long for type character varying(40) (#15179) 11 months ago
2025_03_29_2227-6a9f914f656c_change_documentsegment_and_childchunk_.py Fix Performance Issues: (#17083) 10 months ago
4823da1d26cf_add_tool_file.py bump version to 0.5.3 (#2306) 2 years ago
4829e54d2fee_change_message_chain_id_to_nullable.py enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366) 2 years ago
16830a790f0f_.py enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366) 2 years ago
46976cc39132_add_annotation_histoiry_score.py improve: introduce isort for linting Python imports (#1983) 2 years ago
88072f0caa04_add_custom_config_in_tenant.py improve: introduce isort for linting Python imports (#1983) 2 years ago
187385f442fc_modify_provider_model_name_length.py enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366) 2 years ago
408176b91ad3_add_max_active_requests.py feat: app rate limit (#5844) 2 years ago
5022897aaceb_add_model_name_in_embedding.py improve: introduce isort for linting Python imports (#1983) 2 years ago
a5b56fb053ef_app_config_add_speech_to_text.py improve: introduce isort for linting Python imports (#1983) 2 years ago
a8d7385a7b66_add_embeddings_provider_name.py add embedding cache and clean embedding cache job (#3087) 2 years ago
a8f9b3c45e4a_add_tenant_id_db_index.py add tenant id index for document and document_segment table (#2873) 2 years ago
a45f4dfde53b_add_language_to_recommend_apps.py improve: introduce isort for linting Python imports (#1983) 2 years ago
a9836e3baeee_add_external_data_tools_in_app_model_.py enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366) 2 years ago
ab23c11305d4_add_dataset_query_variable_at_app_model_.py improve: introduce isort for linting Python imports (#1983) 2 years ago
ad472b61a054_add_api_provider_icon.py bump version to 0.5.3 (#2306) 2 years ago
b3a09c049e8e_add_advanced_prompt_templates.py improve: introduce isort for linting Python imports (#1983) 2 years ago
b24be59fbb04_.py bump version to 0.5.3 (#2306) 2 years ago
b69ca54b9208_add_chatbot_color_theme.py FR: #4048 - Add color customization to the chatbot (#4885) 2 years ago
b289e2408ee2_add_workflow.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
b2602e131636_add_workflow_run_id_index_for_message.py fix: slow sql of ops tracing (#5749) 2 years ago
b5429b71023c_messages_columns_set_nullable.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
bf0aec5ba2cf_add_provider_order.py improve: introduce isort for linting Python imports (#1983) 2 years ago
c031d46af369_remove_app_model_config_trace_config_.py Feat/add-remote-file-upload-api (#9906) 1 year ago
c3311b089690_add_tool_meta.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
c71211c8f604_add_tool_invoke_model_log.py bump version to 0.5.3 (#2306) 2 years ago
cc04d0998d4d_set_model_config_column_nullable.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
d3d503a3471c_add_is_deleted_to_conversations.py improve: introduce isort for linting Python imports (#1983) 2 years ago
de95f5c77138_migration_serpapi_api_key.py Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 9 months ago
dfb3b7f477da_add_tool_index.py enhancement: introduce Ruff for Python linter for reordering and removing unused imports with automated pre-commit and sytle check (#2366) 2 years ago
e2eacc9a1b63_add_status_for_message.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
e32f6ccb87c6_e08af0a69ccefbb59fa80c778efee300bb780980.py improve: introduce isort for linting Python imports (#1983) 2 years ago
e35ed59becda_modify_quota_limit_field_type.py improve: introduce isort for linting Python imports (#1983) 2 years ago
e1901f623fd0_add_annotation_reply.py improve: introduce isort for linting Python imports (#1983) 2 years ago
e8883b0148c9_add_dataset_model_name.py improve: introduce isort for linting Python imports (#1983) 2 years ago
eeb2e349e6ac_increase_max_model_name_length.py Fix/6615 40 varchar limit on DatasetCollectionBinding and Embedding model name (#6723) 2 years ago
f2a6fc85e260_add_anntation_history_message_id.py improve: introduce isort for linting Python imports (#1983) 2 years ago
f9107f83abab_add_desc_for_apps.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
f25003750af4_add_created_updated_at.py bump version to 0.5.3 (#2306) 2 years ago
fca025d3b60f_add_dataset_retrival_model.py external knowledge api (#8913) 1 year ago
fecff1c3da27_remove_extra_tracing_app_config_table .py Feat/add-remote-file-upload-api (#9906) 1 year ago