Skip to content

导出应用

找到应用

在应用的数据库中执行下面的SQL,找到应用的ID

SQL
SELECT id FROM su_code_apps WHERE NAME='您的应用名称' AND is_deleted=0

执行SQL找到配置数据

把下面SQL语句中的 ?? 替换为前面找到的 su_code_apps 表 ID

SQL
set @appid = ??;

select * from su_code_apps where id = @appid ;
select * from su_code_app_files WHERE app_id =@appid and is_deleted=0;
select * from su_code_tables where app_id =@appid and is_deleted=0;
select t1.* from su_code_resources t1 LEFT JOIN  su_code_tables t2 on t1.source_id = t2.id  where t2.app_id=@appid and t2.is_deleted=0;
select t1.* from su_code_tables_history t1 LEFT JOIN su_code_tables t2 on t1.data_id=t2.id where t2.app_id=@appid and t1.`status`!='draft'  and t2.is_deleted=0;
select * from su_code_pages where app_id =@appid  and is_deleted=0;
select t1.* from su_code_pages_history t1 LEFT JOIN su_code_pages t2 on t1.data_id=t2.id where t2.app_id=@appid and t1.`status`!='draft'  and t2.is_deleted=0;
select * from su_code_components where app_id =@appid  and is_deleted=0;
select t1.* from su_code_components_history t1 LEFT JOIN su_code_components t2 on t1.data_id=t2.id where t2.app_id=@appid and t1.`status`!='draft'  and t2.is_deleted=0;

利用数据库客户端工具将查询结果导出SQL。

找到该应用创建的表并导出为SQL

通常数据库客户端工具提供过滤功能,您在数据库命名时建议用一个统一前缀为开头。以HeidiSQL为例:

在过滤器中输入表的前缀

在数据表上点击鼠标右键,选择“导出数据库为 SQL 脚本(S)”

勾选相关业务数据库表,勾选必要的选项,设置输出路径,点击导出。

导入应用

在您部署的他环境数据库执行上面两步得到的SQL,即可完成应用到导入工作。

由于各个系统的菜单和权限系统数据存在差异。需要清空导入数据中的菜单配置后重新设置菜单。

执行下面的SQL可以清空导入到来的菜单配置。

SQL
UPDATE su_code_pages SET parent_menu_id=NULL, async_menu=0, menu_id=NULL, menu_icon=NULL WHERE app_id = ??;