File tree Expand file tree Collapse file tree
src/main/java/org/tailormap/api/geotools/featuresources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -454,12 +454,15 @@ public static AttachmentMetadata insertAttachment(
454454 }
455455
456456 public static void deleteAttachment (UUID attachmentId , TMFeatureType featureType ) throws IOException , SQLException {
457- String deleteSql = MessageFormat .format ("""
458- DELETE FROM {0}_attachments WHERE attachment_id = ?
459- """ , featureType .getName ());
460457 JDBCDataStore ds = null ;
461458 try {
462459 ds = (JDBCDataStore ) new JDBCFeatureSourceHelper ().createDataStore (featureType .getFeatureSource ());
460+
461+ String deleteSql = MessageFormat .format (
462+ """
463+ DELETE FROM {1}{0}_attachments WHERE attachment_id = ?
464+ """ , featureType .getName (), ds .getDatabaseSchema ().isEmpty () ? "" : ds .getDatabaseSchema () + "." );
465+
463466 try (Connection conn = ds .getDataSource ().getConnection ();
464467 PreparedStatement stmt = conn .prepareStatement (deleteSql )) {
465468 if (featureType
You can’t perform that action at this time.
0 commit comments