@@ -365,12 +365,12 @@ private void initImportButton() {
365365 confirmationAlert .setHeaderText ("Do you want to Override current Data ?" );
366366 confirmationAlert .getDialogPane ()
367367 .setContent (new Label (
368- """
369- Import previously exported .sql file. This will overwrite the currently used database contents - all current data will be lost!
370-
371- If you do not have a .sql file yet you need to open the previous version of KeepTime and in the settings dialog press "Export".
372-
373- You will need to restart the application after this action. If you proceed you need to select the previous exported .sql file.\
368+ """
369+ Import previously exported .sql file. This will overwrite the currently used database contents - all current data will be lost!
370+
371+ If you do not have a .sql file yet you need to open the previous version of KeepTime and in the settings dialog press "Export".
372+
373+ You will need to restart the application after this action. If you proceed you need to select the previous exported .sql file.\
374374 """ ));
375375 confirmationAlert .showAndWait ();
376376
@@ -391,10 +391,14 @@ private void initImportButton() {
391391 final String url = applicationProperties .getSpringDataSourceUrl ();
392392 final String username = applicationProperties .getSpringDataSourceUserName ();
393393 final String password = applicationProperties .getSpringDataSourcePassword ();
394- // TODO: add an option at the next release to make the "FROM_1X flag" configurable. E.g. if we upgrade (in
395- // the release after) from H2 version 2.x to 2.x we must not set the "FROM_1X flag".
396- new RunScript ().runTool ("-url" , url , "-user" , username , "-password" , password , "-script" , file .toString (),
397- "-options" , "FROM_1X" );
394+
395+ if (file .getName ().contains ("H2-version-1" )) {
396+ new RunScript ().runTool ("-url" , url , "-user" , username , "-password" , password , "-script" , file .toString (),
397+ "-options" , "FROM_1X" );
398+ LOG .info ("FROM_1X feature is used" );
399+ }else {
400+ new RunScript ().runTool ("-url" , url , "-user" , username , "-password" , password , "-script" , file .toString ());
401+ }
398402
399403 Alert informationDialog = new Alert (AlertType .INFORMATION );
400404
@@ -404,9 +408,9 @@ private void initImportButton() {
404408 informationDialog .setTitle ("Import done" );
405409 informationDialog .setHeaderText ("The data was imported." );
406410 informationDialog .getDialogPane ()
407- .setContent (new Label ("""
408- KeepTime will now be CLOSED!
409- You have to RESTART it again to see the changes\
411+ .setContent (new Label ("""
412+ KeepTime will now be CLOSED!
413+ You have to RESTART it again to see the changes\
410414 """ ));
411415 informationDialog .showAndWait ();
412416 Platform .exit ();
@@ -525,8 +529,8 @@ private void showLicense(final Licenses license) {
525529 final Alert alert = new Alert (AlertType .ERROR );
526530 alert .setTitle ("Ooops" );
527531 alert .setHeaderText ("Could not find the license file" );
528- alert .setContentText (
529- "We could not find the license file at \" %s\" . Did you remove it?%nPlease redownload or visit \" %s\" ." .formatted (
532+ alert .setContentText (
533+ "We could not find the license file at \" %s\" . Did you remove it?%nPlease redownload or visit \" %s\" ." .formatted (
530534 license .getPath (), license .getUrl ()));
531535
532536 alert .getDialogPane ().setMinHeight (Region .USE_PREF_SIZE );
0 commit comments