diff --git a/src/ImportCsvDialog.cpp b/src/ImportCsvDialog.cpp index 79d90249..daa5ad3d 100644 --- a/src/ImportCsvDialog.cpp +++ b/src/ImportCsvDialog.cpp @@ -415,8 +415,8 @@ sqlb::FieldVector ImportCsvDialog::generateFieldList(const QString& filename) fieldList.push_back(sqlb::FieldPtr(new sqlb::Field(fieldname, ""))); } - // Try to find out a data type for each column - if(!(rowNum == 0 && ui->checkboxHeader->isChecked())) + // Try to find out a data type for each column. Skip the header row if there is one. + if(!ui->checkNoTypeDetection->isChecked() && !(rowNum == 0 && ui->checkboxHeader->isChecked())) { for(size_t i=0;ilabelNoTypeDetection->setVisible(show); + ui->checkNoTypeDetection->setVisible(show); ui->labelFailOnMissing->setVisible(show); ui->checkFailOnMissing->setVisible(show); ui->labelIgnoreDefaults->setVisible(show); diff --git a/src/ImportCsvDialog.ui b/src/ImportCsvDialog.ui index fe24d725..ebf08fc0 100644 --- a/src/ImportCsvDialog.ui +++ b/src/ImportCsvDialog.ui @@ -275,14 +275,14 @@ - + When importing an empty value from the CSV file into an existing table with a default value for this column, that default value is inserted. Activate this option to insert an empty value instead. - + Ignore default &values @@ -292,14 +292,14 @@ - + Activate this option to stop the import when trying to import an empty value into a NOT NULL column without a default value. - + Fail on missing values @@ -309,6 +309,20 @@ + + + + Disable data type detection + + + + + + + Disable the automatic data type detection when creating a new table. + + +