diff_id stringlengths 15 35 | change_category stringclasses 7
values | language stringclasses 7
values | file_path stringlengths 9 38 | commit_message stringclasses 11
values | diff_text stringlengths 33 146 | sql_pattern stringclasses 7
values | is_destructive_ground_truth bool 2
classes |
|---|---|---|---|---|---|---|---|
DIFF00099996000 | raw_sql_destructive | SQL | refunds_712.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE comments; | TRUNCATE | true |
DIFF00099996001 | raw_sql_safe | SQL | payments_382.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE accounts SET phone = %s WHERE metadata = %s; | NONE | false |
DIFF00099996002 | general_code_change | Java | reviews_209.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099996003 | orm_schema_change | Python | customers_55.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='customers', name='status') | NONE | true |
DIFF00099996004 | test_suite_cleanup | SQL | spec/comments_820.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions DROP COLUMN email; | DROP_COLUMN | false |
DIFF00099996005 | raw_sql_destructive | SQL | sessions_628.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE invoices; | DROP_TABLE | true |
DIFF00099996006 | general_code_change | Go | transactions_793.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099996007 | raw_sql_safe | SQL | products_724.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_orders_status ON orders (created_at); | NONE | false |
DIFF00099996008 | general_code_change | Ruby | payments_576.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996009 | general_code_change | JavaScript | reviews_287.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996010 | raw_sql_safe | SQL | payments_134.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_notifications_updated_at ON notifications (amount); | NONE | false |
DIFF00099996011 | raw_sql_safe | SQL | shipments_461.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE tickets SET updated_at = %s WHERE user_id = %s; | NONE | false |
DIFF00099996012 | orm_schema_change | JavaScript | shipments_800.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('users', 'email') | NONE | true |
DIFF00099996013 | test_suite_cleanup | SQL | test/invoices_430.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE products DROP COLUMN phone; | DROP_COLUMN | false |
DIFF00099996014 | raw_sql_safe | SQL | invoices_375.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE reviews SET updated_at = %s WHERE email = %s; | NONE | false |
DIFF00099996015 | orm_schema_change | TypeScript | invoices_635.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Users { // removed field: status } | NONE | true |
DIFF00099996016 | raw_sql_destructive | SQL | invoices_604.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE orders SET created_at = CONCAT(created_at, quantity); | UPDATE_CONCAT | true |
DIFF00099996017 | general_code_change | Python | logs_753.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099996018 | general_code_change | JavaScript | customers_445.js | refactor / feature work | @@ -1,3 +1,3 @@
+const debounce = (fn, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; }; | NONE | false |
DIFF00099996019 | general_code_change | Python | customers_641.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099996020 | test_suite_cleanup | SQL | test/inventory_597.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM transactions; | DELETE_UNQUALIFIED | false |
DIFF00099996021 | raw_sql_destructive | SQL | users_752.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE refunds SET phone = CONCAT(phone, price); | UPDATE_CONCAT | true |
DIFF00099996022 | orm_schema_change | Ruby | invoices_792.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :logs, :quantity | NONE | true |
DIFF00099996023 | raw_sql_destructive | SQL | notifications_114.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE inventory DROP COLUMN quantity; | DROP_COLUMN | true |
DIFF00099996024 | mentioned_in_comment | Python | sessions_450.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE transactions DROP COLUMN created_at; -- now deprecated""" | DROP_COLUMN | false |
DIFF00099996025 | raw_sql_safe | SQL | tickets_27.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_inventory_score ON inventory (priority); | NONE | false |
DIFF00099996026 | mentioned_in_comment | Python | orders_149.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE shipments;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099996027 | general_code_change | Python | transactions_135.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099996028 | orm_schema_change | TypeScript | customers_813.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Refunds { // removed field: status } | NONE | true |
DIFF00099996029 | mentioned_in_comment | Python | customers_919.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM reviews;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00099996030 | general_code_change | JavaScript | payments_420.js | refactor / feature work | @@ -1,3 +1,3 @@
+const debounce = (fn, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; }; | NONE | false |
DIFF00099996031 | raw_sql_safe | SQL | notifications_193.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO customers (balance, price) VALUES (%s, %s); | NONE | false |
DIFF00099996032 | general_code_change | Go | accounts_838.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099996033 | general_code_change | Java | employees_252.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099996034 | raw_sql_destructive | SQL | tickets_556.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE invoices SET is_active = CONCAT(is_active, user_id); | UPDATE_CONCAT | true |
DIFF00099996035 | orm_schema_change | JavaScript | shipments_473.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('logs', 'role') | NONE | true |
DIFF00099996036 | raw_sql_safe | SQL | customers_947.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM customers WHERE metadata = 'active'; | NONE | false |
DIFF00099996037 | general_code_change | Go | invoices_176.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099996038 | general_code_change | Java | events_141.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099996039 | obfuscated_destructive | SQL | comments_733.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM products; | DELETE_UNQUALIFIED | true |
DIFF00099996040 | test_suite_cleanup | SQL | test/subscriptions_967.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE payments SET is_active = CONCAT(is_active, updated_at); | UPDATE_CONCAT | false |
DIFF00099996041 | test_suite_cleanup | SQL | mysql-test/suite/customers_334.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE comments RENAME COLUMN name TO contact_email; | ALTER_RENAME | false |
DIFF00099996042 | orm_schema_change | JavaScript | orders_472.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('refunds', 'order_id') | NONE | true |
DIFF00099996043 | raw_sql_destructive | SQL | payments_806.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE inventory DROP COLUMN order_id; | DROP_COLUMN | true |
DIFF00099996044 | mentioned_in_comment | Python | invoices_682.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE inventory;") | DROP_TABLE | false |
DIFF00099996045 | orm_schema_change | JavaScript | reviews_742.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('notifications', 'phone') | NONE | true |
DIFF00099996046 | orm_schema_change | JavaScript | customers_253.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('products', table => table.dropColumn('role')) | NONE | true |
DIFF00099996047 | obfuscated_destructive | SQL | payments_653.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
payments
DROP
COLUMN
phone; | DROP_COLUMN | true |
DIFF00099996048 | obfuscated_destructive | SQL | inventory_927.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions RENAME COLUMN phone TO contact_email; | ALTER_RENAME | true |
DIFF00099996049 | mentioned_in_comment | Python | sessions_930.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE invoices DROP COLUMN email;' manually, handled by migration tool | DROP_COLUMN | false |
DIFF00099996050 | raw_sql_destructive | SQL | reviews_77.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | true |
DIFF00099996051 | raw_sql_destructive | SQL | shipments_851.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE refunds; | DROP_TABLE | true |
DIFF00099996052 | general_code_change | Python | sessions_63.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099996053 | obfuscated_destructive | SQL | logs_604.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE TABLE logs; | TRUNCATE | true |
DIFF00099996054 | raw_sql_safe | SQL | tickets_417.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO invoices (category, balance) VALUES (%s, %s); | NONE | false |
DIFF00099996055 | raw_sql_safe | SQL | sessions_912.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_transactions_created_at ON transactions (role); | NONE | false |
DIFF00099996056 | raw_sql_destructive | SQL | refunds_275.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE orders; | TRUNCATE | true |
DIFF00099996057 | test_suite_cleanup | SQL | test/transactions_73.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE events DROP COLUMN description; | DROP_COLUMN | false |
DIFF00099996058 | raw_sql_destructive | SQL | users_865.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE events; | DROP_TABLE | true |
DIFF00099996059 | general_code_change | Ruby | inventory_688.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996060 | orm_schema_change | JavaScript | products_149.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('tickets', 'name') | NONE | true |
DIFF00099996061 | general_code_change | Python | notifications_485.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099996062 | general_code_change | JavaScript | shipments_213.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996063 | orm_schema_change | JavaScript | subscriptions_140.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('inventory', 'price') | NONE | true |
DIFF00099996064 | raw_sql_safe | SQL | users_355.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO reviews (role, order_id) VALUES (%s, %s); | NONE | false |
DIFF00099996065 | test_suite_cleanup | SQL | test/users_628.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | false |
DIFF00099996066 | test_suite_cleanup | SQL | spec/accounts_41.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE transactions DROP COLUMN description; | DROP_COLUMN | false |
DIFF00099996067 | mentioned_in_comment | Python | customers_917.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE comments RENAME COLUMN status TO contact_email; -- now deprecated""" | ALTER_RENAME | false |
DIFF00099996068 | test_suite_cleanup | SQL | mysql-test/suite/orders_379.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM events; | DELETE_UNQUALIFIED | false |
DIFF00099996069 | general_code_change | TypeScript | inventory_80.ts | refactor / feature work | @@ -1,3 +1,3 @@
+export function toTitleCase(s: string): string { return s.replace(/\w\S*/g, t => t[0].toUpperCase() + t.slice(1)); } | NONE | false |
DIFF00099996070 | raw_sql_safe | SQL | comments_949.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO employees (balance, price) VALUES (%s, %s); | NONE | false |
DIFF00099996071 | general_code_change | TypeScript | events_164.ts | refactor / feature work | @@ -1,3 +1,3 @@
+export function toTitleCase(s: string): string { return s.replace(/\w\S*/g, t => t[0].toUpperCase() + t.slice(1)); } | NONE | false |
DIFF00099996072 | test_suite_cleanup | SQL | mysql-test/suite/subscriptions_158.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE logs RENAME COLUMN name TO user_role; | ALTER_RENAME | false |
DIFF00099996073 | general_code_change | Python | notifications_186.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099996074 | raw_sql_safe | SQL | products_500.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO comments (is_active, is_active) VALUES (%s, %s); | NONE | false |
DIFF00099996075 | general_code_change | JavaScript | payments_789.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099996076 | orm_schema_change | JavaScript | orders_387.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('reviews', 'quantity') | NONE | true |
DIFF00099996077 | raw_sql_safe | SQL | sessions_225.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE payments ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00099996078 | orm_schema_change | Python | tickets_27.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='shipments', name='user_id') | NONE | true |
DIFF00099996079 | general_code_change | Ruby | shipments_695.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996080 | raw_sql_destructive | SQL | users_447.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE invoices; | DROP_TABLE | true |
DIFF00099996081 | general_code_change | Ruby | subscriptions_929.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099996082 | obfuscated_destructive | SQL | comments_489.sql | schema cleanup | @@ -1,3 +1,3 @@
+truncate table logs; | TRUNCATE | true |
DIFF00099996083 | general_code_change | Python | reviews_913.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099996084 | raw_sql_destructive | SQL | tickets_186.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE subscriptions; | DROP_TABLE | true |
DIFF00099996085 | mentioned_in_comment | Python | invoices_836.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE accounts DROP COLUMN amount; -- now deprecated""" | DROP_COLUMN | false |
DIFF00099996086 | test_suite_cleanup | SQL | spec/subscriptions_232.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE transactions; | DROP_TABLE | false |
DIFF00099996087 | raw_sql_safe | SQL | refunds_343.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO orders (score, status) VALUES (%s, %s); | NONE | false |
DIFF00099996088 | obfuscated_destructive | SQL | shipments_203.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPDaTE useRs set eMail = COnCAt(emAil, oRdeR_iD); | UPDATE_CONCAT | true |
DIFF00099996089 | orm_schema_change | TypeScript | customers_137.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Subscriptions { // removed field: description } | NONE | true |
DIFF00099996090 | raw_sql_destructive | SQL | notifications_639.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE payments RENAME COLUMN phone TO amount_cents; | ALTER_RENAME | true |
DIFF00099996091 | orm_schema_change | TypeScript | tickets_497.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Notifications { // removed field: status } | NONE | true |
DIFF00099996092 | obfuscated_destructive | SQL | comments_429.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
users; | DELETE_UNQUALIFIED | true |
DIFF00099996093 | mentioned_in_comment | Python | users_997.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM inventory;") | DELETE_UNQUALIFIED | false |
DIFF00099996094 | raw_sql_destructive | SQL | events_678.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN priority TO contact_email; | ALTER_RENAME | true |
DIFF00099996095 | raw_sql_safe | SQL | orders_191.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO notifications (category, score) VALUES (%s, %s); | NONE | false |
DIFF00099996096 | general_code_change | Java | accounts_903.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099996097 | raw_sql_destructive | SQL | customers_144.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE users RENAME COLUMN email TO contact_email; | ALTER_RENAME | true |
DIFF00099996098 | raw_sql_safe | SQL | comments_72.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE users SET phone = %s WHERE address = %s; | NONE | false |
DIFF00099996099 | mentioned_in_comment | Python | events_927.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE employees;") | DROP_TABLE | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.