Skip to content

Commit 3084fa5

Browse files
authored
Add a WHERE clause to delete statement
Spanner (https://github.com/googleapis/ruby-spanner-activerecord) requires a WHERE clause to execute DELETE statements, this change is all that seems to be required for this gem to work with that database type.
1 parent b750ac7 commit 3084fa5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/database_cleaner/active_record/deletion.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def delete_tables(connection, table_names)
2323
end
2424

2525
def delete_table connection, table_name
26-
connection.execute("DELETE FROM #{connection.quote_table_name(table_name)}")
26+
connection.execute("DELETE FROM #{connection.quote_table_name(table_name)} WHERE 1=1")
2727
end
2828

2929
def tables_to_truncate(connection)

0 commit comments

Comments
 (0)