ó Ò@Qc@sŠddlZddlZddlZddlmZddlmZdefd„ƒYZdefd„ƒYZdefd „ƒYZdS( iÿÿÿÿN(t WizardPage(tWizardProgressPagetMainViewcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCsõtj||dƒ|jj|ddƒtjdƒ}|jj|tt ƒtj tj ƒ}|j dƒ|jj|tt ƒtj tƒ}|j|ƒ|jdƒtjƒ|_|jjdƒ|j|jtt ƒ|jtjdƒtt ƒtjƒ|_|jjdƒ|jj|jƒ|j|jtt ƒtj t ƒ|_|jjd ƒ|jjtjd ƒtt ƒtjƒ|_|jjtjjtjjd ƒd ƒƒ|jj|jt t ƒtjƒ}|jd ƒ|j|jƒ|jj|tt ƒ|j|jtt ƒtj tj ƒ}|j dƒ|jj|tt ƒtj tƒ}|j|ƒ|jdƒ|jdƒtjƒ|_ |j jdƒ|j|j tt ƒ|jj!t ƒ|jƒt |_"dS(NsTarget Creation OptionssOBJECT MIGRATIONspSelect options for the creation of the migrated schema in the target MySQL server and click [Next >] to execute.sSchema Creationi sCreate schema in target RDBMStsCreate a SQL script fileis Script File:t~smigration_script.sqls Browse...tOptionsisaKeep schemata if they already exist. Objects that already exist will not be recreated or updated.(#Rt__init__tmaintadd_wizard_pagetmformstnewLabeltcontenttaddtFalsetTruetnewPaneltTitledBoxPanelt set_titletnewBoxt set_paddingt newCheckBoxt _create_dbtset_textt_create_scripttadd_clicked_callbackt_toggle_sql_scriptt _file_hboxt set_spacingt newTextEntryt_create_script_filet set_valuetostpathtjoint expandusert newButtont _browse_filest _keep_schemat set_activet_check_file_duplicate(tselfRtlabeltpaneltboxtbutton((s'..\modules\migration_schema_creation.pyRsT   +       cCs|jj|jjƒƒdS(N(Rt set_enabledRt get_active(R(((s'..\modules\migration_schema_creation.pyRTscCs t|_dS(N(RR'(R(((s'..\modules\migration_schema_creation.pyt_filename_changedWscCsÍtjtjjƒtjƒ}|jdƒtjj|j j ƒƒ}|j tjj tjj |ƒrm|ntjj|ƒƒrˆ|ntjjdƒƒ|jƒrÉ|j j|jƒƒt|_ndS(NsSave SQL Script AsR(R tnewFileChoosertFormt main_formtSaveFileRRR tabspathRtget_string_valuetset_pathtexiststisdirtdirnameR"t run_modalRtget_pathR R'(R(tformt default_path((s'..\modules\migration_schema_creation.pyR$Zs ' cCs€|jjƒ|jjjjd<|jjƒ|jjjjd<|jjƒr>|jj ƒ}| s‚t j j t j j |ƒƒ r¢tjjdddddƒdSt j j |ƒrØtjjdd|dddƒdSt j j|ƒr%|jr%tjjdd|d d dƒtjkr%dSn||jjjjd ¶scss|]}|jƒVqdS(N(Re(RfRg((s'..\modules\migration_schema_creation.pys ·sisExisting Schemass The %s %s iRgtschematas, sLwill be dropped in the target MySQL Server and all the existing data will bes lost. Do you want to continue?tYestNoR(tgrtt send_progresstsetRRDRbtcatalogRhtmodulest DbMySQLFEtgetSchemaNamest connectiontlistt intersectionRtlenR RGt show_messageR!RIR RZR-(R(t schema_setttarget_schema_settexisting_schemastcontinue_migration((s'..\modules\migration_schema_creation.pyRV³s%1 2 cCsQtjdddƒ|jjjƒ|jjjjƒtjdddƒdS(Nt=iPs (Rkt send_outputRRDt createTargetRbt disconnect(R(((s'..\modules\migration_schema_creation.pyRYÅs( RLRMRR[R\R`RRRTRVRY(((s'..\modules\migration_schema_creation.pyRN…s       tCreationReportViewcBsteZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z RS( cCs”tj||ddtƒ|jj|ddƒd}|jjtj|ƒt tƒtj tƒ}|j dƒ|j tƒtj tjƒ|_|jjtjddt ƒ|jjtjdd t ƒ|jjƒ|jj|jƒ|j|jttƒtjtjƒ|_|jjd ƒtj t ƒ}tjƒ|_|jjtjƒ|jj|jƒ|j|jttƒtj tƒ}|jdƒ|j d ƒtjƒ|_ |j j!d ƒ|j j"|j#ƒ|j|j t tƒtj$ƒ|_%|j%j!d ƒ|j&|j%t tƒ|j%j"|j'ƒtj$ƒ|_(|j(j!dƒ|j&|j(t tƒ|j(j"|j)ƒ|j|t tƒ|jj|ƒ|j*j!dƒ|j|jttƒ|jj|ttƒtjtjƒ|_+|j+jdƒtj t ƒ}|jd ƒtj,tj-ƒ|_.|j|j.ttƒ|j+j|ƒ|jj|j+t tƒ|j+j/ddƒg|_0dS(NsCreate Target ResultstwidesOBJECT MIGRATIONsZScripts to create the target schema were executed. No data has been migrated yet. Review the creation report below for errors or warnings. If there are any errors, you can manually fix the scripts and click [Recreate Objects] to retry the schema creation or return to the Manual Editing page to correct them there and retry the target creation.i tObjectiÈtResultiXs%SQL CREATE Script for Selected Objectis Comment outtDiscardtApplysRecreate ObjectssOutput Messagesiÿÿÿÿ(1RRRRRR R R R R RRtset_homogeneoustnewTreeNodeViewt TreeFlatListt_treet add_columntIconStringColumnTypet end_columnstadd_changed_callbackt_selection_changedRRt_advboxRt newCodeEditort_codet set_languaget LanguageMySQLt _code_changedRRt_comment_checkRRt_comment_clickedR#t _revert_btntadd_endt_discard_clickedt _apply_btnt_apply_clickedtadvanced_buttont_msgboxt newTextBoxtVerticalScrollBart_msgstset_sizet _error_tables(R(RttextthboxR+tvbox((s'..\modules\migration_schema_creation.pyRÏsd      cCsn|jr]tjjdddddƒ}|tjkrVx!|jD]}d|_q@Wq]dSntj|ƒdS(NsTable Creation Errorss“Some tables could not be created in the target database. Would you like to flag them to be skipped and copy the data for the remaining tables only?sSkip Failed TablesRBRi(R¡R RGt show_warningtResultOkt commentedOutRRK(R(trttable((s'..\modules\migration_schema_creation.pyRKs  cCsk|jjƒ}|rg|jƒrg|jƒ}|jj|dƒ}t|tjj ƒrc|j }n|SdS(N( Rˆtget_selected_nodetget_tagt _object_dictR]tNonet isinstanceRktclassest db_Columntowner(R(tselectedtoidtobject((s'..\modules\migration_schema_creation.pyt_selected_log_object$s  cCs|jƒ}|r|jSdS(N(Rµt logObjectR­(R(tlog((s'..\modules\migration_schema_creation.pyt_selected_object/s cCsÃ|jƒ}|r¿|jjtƒ}|jjƒrV|jjd|jddƒƒn2|jdƒrˆ|jj|jddƒdƒn|jj |j ƒ|j j t ƒ|j j t ƒndS(Ns-- s s -- i(R¸Rtget_textR R”R.Rtreplacet startswithR-R§R™RR–(R(R´R¢((s'..\modules\migration_schema_creation.pyR•5s ##cCsê|jƒ}|rg}x×|jD]Ì}|jdkr\|jdj|jjdƒƒƒq"|jdkr”|jddj|jjdƒƒƒq"|jdkrÌ|jddj|jjdƒƒƒq"|jdj|jjdƒƒƒq"W|jjdj|ƒƒn|r|j nd}|r¦t |d ƒr¦|j j |jƒ|j j|j ƒ|jj|jƒ|jjtƒ|jjtƒ|jjtƒdS|j j d ƒ|j jtƒ|jjtƒ|jjtƒdS( Nis s is WARNING: %sis ERROR: %ss ttemp_sqlR(Rµtentriest entryTypetappendR!RdtsplitRŸRR¶R­thasattrRRR¼R-R§R”R&RŽRR™R R–(R(R·R¢tentryR´((s'..\modules\migration_schema_creation.pyREs2 %))&cCs$|jjtƒ|jjtƒdS(N(R™R-RR–(R(txtytz((s'..\modules\migration_schema_creation.pyR“dscCsf|jjtƒ}|jƒ}|rB||_|jjƒ|_n|jj tƒ|j j tƒdS(N( RR¹R R¸R¼R”R.R§R™R-R–(R(R¢R´((s'..\modules\migration_schema_creation.pyRšis  cCs_|jƒ}|r;|jj|jƒ|jj|jƒn|jjt ƒ|j jt ƒdS(N( R¸RRR¼R”R&R§R™R-R R–(R(R´((s'..\modules\migration_schema_creation.pyR˜ss  c Csi|_g|_|jjƒxw|jjjjD]c}|jjƒ}|j }d}x[t j j t j j t j jt j jt j jgD]&}t||ƒrŠ|jd}PqŠqŠW|s×t jdd|jƒq2n|j}|j}x=|r(|jd|}t|t j j ƒrPn|j}qìW|jd|ƒ|jd|ƒ|j|jƒ||j|j|jdd ƒn>| dkr]|jdd ƒn| d kr||jddƒn|jddj |ƒƒq2WdS(NsGrtObject.16x16.pngs .16x16.pngt Migrations-Object creation log '%s' referenced no objectt.iis WARNING: %sis ERROR: %ssScript executed successfullystask_checked.pngstask_warning.pngstask_error.pngs, (!R¬R¡RˆtclearRRDREt creationLogtadd_nodeR¶RkR¯t db_Schematdb_Tabletdb_Viewt db_Routinet db_TriggerR®t__grtclassname__t log_warningRdR±t set_stringt set_icon_pathtset_tagt__id__R­R½tmaxR¾R¿tinsertR!( R(R·tnodetobjticontct full_nametoR¢tworstRÂ((s'..\modules\migration_schema_creation.pytrefresh|sV    :        cCs'|r|jƒntj||ƒdS(N(RßRR\(R(R^((s'..\modules\migration_schema_creation.pyR\¬s cCs|jjƒ}|jƒdS(N(Rtgo_previous_pageR_(R(tpage((s'..\modules\migration_schema_creation.pyt go_advanced²s(RLRMRRKRµR¸R•RR“RšR˜RßR\Râ(((s'..\modules\migration_schema_creation.pyRÎs G      0 ( R RkRt workbench.uiRRRRNR(((s'..\modules\migration_schema_creation.pyts   kI