-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(migrations): rebuild (#1387)
- Loading branch information
Showing
25 changed files
with
169 additions
and
753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
src/bk-user/bkuser/apps/data_source/migrations/0002_inbuild_data_source_plugin.py
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
src/bk-user/bkuser/apps/data_source/migrations/0002_init_builtin_data_source_plugin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Generated by Django 3.2.20 on 2023-11-13 09:47 | ||
from django.conf import settings | ||
from django.db import migrations | ||
|
||
from bkuser.plugins.constants import DataSourcePluginEnum | ||
from bkuser.utils.base64 import load_image_as_base64 | ||
|
||
|
||
def forwards_func(apps, schema_editor): | ||
"""初始化本地数据源插件""" | ||
|
||
DataSourcePlugin = apps.get_model("data_source", "DataSourcePlugin") | ||
|
||
# 本地数据源插件 | ||
# TODO 插件名称,描述国际化 | ||
DataSourcePlugin.objects.get_or_create( | ||
id=DataSourcePluginEnum.LOCAL, | ||
defaults={ | ||
"name": DataSourcePluginEnum.get_choice_label(DataSourcePluginEnum.LOCAL), | ||
"description": "支持用户和部门的增删改查,以及用户的登录认证", | ||
"logo": load_image_as_base64(settings.BASE_DIR / "bkuser/plugins/local/logo.png"), | ||
}, | ||
) | ||
|
||
# Http数据源插件 | ||
# TODO 插件名称,描述国际化 | ||
DataSourcePlugin.objects.get_or_create( | ||
id=DataSourcePluginEnum.GENERAL, | ||
defaults={ | ||
"name": DataSourcePluginEnum.get_choice_label(DataSourcePluginEnum.GENERAL), | ||
"description": "支持对接通用 HTTP 数据源的插件,用户需要在服务方提供 `用户数据` 及 `部门数据` API", | ||
"logo": load_image_as_base64(settings.BASE_DIR / "bkuser/plugins/general/logo.png"), | ||
}, | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('data_source', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forwards_func) | ||
] |
39 changes: 0 additions & 39 deletions
39
src/bk-user/bkuser/apps/data_source/migrations/0003_auto_20230831_1552.py
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...ser/bkuser/apps/data_source/migrations/0004_alter_localdatasourceidentityinfo_password.py
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/bk-user/bkuser/apps/data_source/migrations/0005_auto_20230926_1108.py
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/bk-user/bkuser/apps/data_source/migrations/0006_departmentrelationmptttree.py
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
src/bk-user/bkuser/apps/data_source/migrations/0007_inbuild_data_source_plugin.py
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
src/bk-user/bkuser/apps/data_source/migrations/0008_auto_20231024_0940.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.