Skip to content

Commit f1fa0ea

Browse files
committed
fix: remove all triggers in dbutils_delete_triggers, also triggers from gos algo
1 parent d4c15c5 commit f1fa0ea

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/dbutils.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,15 @@ int dbutils_delete_triggers (sqlite3 *db, const char *table) {
450450
size_t blen = sizeof(buffer);
451451
int rc = SQLITE_ERROR;
452452

453-
char *sql = sqlite3_snprintf((int)blen, buffer, "DROP TRIGGER IF EXISTS cloudsync_after_insert_%w;", table);
453+
char *sql = sqlite3_snprintf((int)blen, buffer, "DROP TRIGGER IF EXISTS cloudsync_before_update_%w;", table);
454+
rc = sqlite3_exec(db, sql, NULL, NULL, NULL);
455+
if (rc != SQLITE_OK) goto finalize;
456+
457+
sql = sqlite3_snprintf((int)blen, buffer, "DROP TRIGGER IF EXISTS cloudsync_before_delete_%w;", table);
458+
rc = sqlite3_exec(db, sql, NULL, NULL, NULL);
459+
if (rc != SQLITE_OK) goto finalize;
460+
461+
sql = sqlite3_snprintf((int)blen, buffer, "DROP TRIGGER IF EXISTS cloudsync_after_insert_%w;", table);
454462
rc = sqlite3_exec(db, sql, NULL, NULL, NULL);
455463
if (rc != SQLITE_OK) goto finalize;
456464

0 commit comments

Comments
 (0)