当我们在Admin的LayOut中修改了某些模块的某些视图后,为了不用再去生产服务器上重做一遍点鼠标敲键盘的“体力活”,我们应该用MyGeneration工具将刚才做的修改生成为脚本,然后去生产服务器执行这个脚本,就可以把做过的更改同步到生产服务器了。
1. 先设置MyGeneration的DB连接字符串,test connection通过后点Save保存。
2.
假设我修改了BPOAuditing.editview, Telamon.TelamonAP.editview,我应当在下图中的Where Clause:栏中写上:
填写后:name in (‘BPOAuditing.editview’,‘Telamon.TelamonAP.editview’) = '' and deleted=0
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
-- BPOAuditing.EditView.
delete from EDITVIEWS where NAME = 'BPOAuditing.EditView';
delete from EDITVIEWS_FIELDS where EDIT_NAME = 'BPOAuditing.EditView' and DELETED = 0 and default_view=0;
if not exists(select * from EDITVIEWS where NAME = 'BPOAuditing.EditView' and DELETED = 0) begin -- then
print 'EDITVIEWS BPOAuditing.EditView';
exec dbo.spEDITVIEWS_InsertOnly N'BPOAuditing.EditView', N'BPOAuditing', N'vwTGS_BPO_AUDITING_Edit', N'15%', N'35%', 2;
exec dbo.spEDITVIEWS_Fields_InsBoundList N'BPOAuditing.EditView', 1, N'BPOAuditing.LBL_AUDITOR', N'AUDITOR_ID', 0, 0, N'AssignedUser', 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'BPOAuditing.EditView', 2, N'BPOAuditing.LBL_AUDITED_NUM', N'AUDITED_NUM', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'BPOAuditing.EditView', 3, N'BPOAuditing.LBL_ERROR_NUM', N'ERROR_NUM', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'BPOAuditing.EditView', 4, N'BPOAuditing.LBL_AUDIT_HOURS', N'AUDIT_HOURS', 0, 0, 10, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsControl N'BPOAuditing.EditView', 5, N'BPOAuditing.LBL_AUDIT_DATE', N'AUDIT_DATE', 0, 0, N'DatePicker', null, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBoundList N'BPOAuditing.EditView', 6, N'BPOAuditing.LBL_USER_ID', N'USER_ID', 0, 0, N'AssignedUser', 0, 0;
end -- if;
GO
-- Telamon.Telamon_CRM.EditView.
delete from EDITVIEWS where NAME = 'Telamon.Telamon_CRM.EditView';
delete from EDITVIEWS_FIELDS where EDIT_NAME = 'Telamon.Telamon_CRM.EditView' and DELETED = 0 and default_view=0;
if not exists(select * from EDITVIEWS where NAME = 'Telamon.Telamon_CRM.EditView' and DELETED = 0) begin -- then
print 'EDITVIEWS Telamon.Telamon_CRM.EditView';
exec dbo.spEDITVIEWS_InsertOnly N'Telamon.Telamon_CRM.EditView', N'TrackingReport', N'vwTGS_BPO_REPORTING_Edit', N'15%', N'35%', 2;
exec dbo.spEDITVIEWS_Fields_InsBound N'Telamon.Telamon_CRM.EditView', 1, N'TrackingReport.LBL_BATCH', N'BATCH', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBoundList N'Telamon.Telamon_CRM.EditView', 2, N'TrackingReport.LBL_SERVICE_TYPE', N'SERVICE_TYPE', 0, 0, N'tgs_service_type_dom', 0, 0;
exec dbo.spEDITVIEWS_Fields_InsControl N'Telamon.Telamon_CRM.EditView', 3, N'TrackingReport.LBL_SERVICE_DATE', N'SERVICE_DATE', 0, 0, N'DatePicker', null, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBoundList N'Telamon.Telamon_CRM.EditView', 4, N'TrackingReport.LBL_DOCUMENT_TYPE', N'DOCUMENT_TYPE', 0, 0, N'tgs_doc_type_dom', 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBoundList N'Telamon.Telamon_CRM.EditView', 5, N'TrackingReport.LBL_UNIT', N'UNIT', 0, 0, N'tgs_unit_dom', 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'Telamon.Telamon_CRM.EditView', 6, N'TrackingReport.LBL_RECEIVED_NUM', N'RECEIVED_NUM', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsControl N'Telamon.Telamon_CRM.EditView', 7, N'TrackingReport.LBL_RECEIVE_DATE', N'RECEIVE_DATE', 0, 0, N'DatePicker', null, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'Telamon.Telamon_CRM.EditView', 8, N'TrackingReport.LBL_PROCESSED_NUM', N'PROCESSED_NUM', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'Telamon.Telamon_CRM.EditView', 9, N'TrackingReport.LBL_EXCEPTION_NUM', N'EXCEPTION_NUM', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'Telamon.Telamon_CRM.EditView', 10, N'TrackingReport.LBL_PRODUCTION_HOURS', N'PRODUCTION_HOURS', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBound N'Telamon.Telamon_CRM.EditView', 11, N'TrackingReport.LBL_SYSTEM_ISSUE_HOURS', N'SYSTEM_ISSUE_HOURS', 0, 0, 0, 0, 0;
exec dbo.spEDITVIEWS_Fields_InsBlank N'Telamon.Telamon_CRM.EditView', 12, 0;
exec dbo.spEDITVIEWS_Fields_InsMultiLine N'Telamon.Telamon_CRM.EditView', 13, N'TrackingReport.LBL_SYSTEM_ISSUE', N'SYSTEM_ISSUE', 0, 0, 4, 70, 1;
exec dbo.spEDITVIEWS_Fields_InsMultiLine N'Telamon.Telamon_CRM.EditView', 14, N'TrackingReport.LBL_COMMENTS', N'COMMENTS', 0, 0, 4, 70, 1;
end -- if;
GO