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 |
|---|---|---|---|---|---|---|---|
DIFF00000008800 | orm_schema_change | JavaScript | refunds_403.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('invoices', table => table.dropColumn('name')) | NONE | true |
DIFF00000008801 | orm_schema_change | JavaScript | invoices_167.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('orders', 'name') | NONE | true |
DIFF00000008802 | obfuscated_destructive | SQL | shipments_829.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM customers; | DELETE_UNQUALIFIED | true |
DIFF00000008803 | raw_sql_destructive | SQL | tickets_444.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE orders SET balance = CONCAT(balance, description); | UPDATE_CONCAT | true |
DIFF00000008804 | obfuscated_destructive | SQL | sessions_537.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM transactions; | DELETE_UNQUALIFIED | true |
DIFF00000008805 | test_suite_cleanup | SQL | test/refunds_692.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE orders SET description = CONCAT(description, status); | UPDATE_CONCAT | false |
DIFF00000008806 | test_suite_cleanup | SQL | mysql-test/suite/refunds_962.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE notifications; | DROP_TABLE | false |
DIFF00000008807 | raw_sql_destructive | SQL | invoices_254.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE comments SET amount = CONCAT(amount, email); | UPDATE_CONCAT | true |
DIFF00000008808 | orm_schema_change | Ruby | employees_959.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :tickets, :balance | NONE | true |
DIFF00000008809 | raw_sql_destructive | SQL | refunds_515.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE accounts; | DROP_TABLE | true |
DIFF00000008810 | raw_sql_destructive | SQL | customers_456.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | true |
DIFF00000008811 | test_suite_cleanup | SQL | tests/reviews_805.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE inventory RENAME COLUMN description TO user_role; | ALTER_RENAME | false |
DIFF00000008812 | orm_schema_change | Python | reviews_335.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='invoices', name='order_id') | NONE | true |
DIFF00000008813 | orm_schema_change | Python | refunds_135.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='sessions', name='email') | NONE | true |
DIFF00000008814 | raw_sql_destructive | SQL | transactions_38.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE tickets DROP COLUMN address; | DROP_COLUMN | true |
DIFF00000008815 | general_code_change | TypeScript | transactions_570.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 |
DIFF00000008816 | orm_schema_change | Python | notifications_302.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='events', name='price') | NONE | true |
DIFF00000008817 | orm_schema_change | JavaScript | customers_659.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('sessions', table => table.dropColumn('price')) | NONE | true |
DIFF00000008818 | obfuscated_destructive | SQL | payments_34.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE shipments RENAME COLUMN balance TO full_name; | ALTER_RENAME | true |
DIFF00000008819 | raw_sql_safe | SQL | payments_801.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_logs_updated_at ON logs (metadata); | NONE | false |
DIFF00000008820 | general_code_change | Ruby | shipments_635.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000008821 | raw_sql_safe | SQL | invoices_663.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM tickets WHERE order_id = 'active'; | NONE | false |
DIFF00000008822 | obfuscated_destructive | SQL | subscriptions_473.sql | schema cleanup | @@ -1,3 +1,3 @@
+aLteR Table cOMMENtS rEnaME CoLUMN ScOrE to AmOuNt_CeNTS; | ALTER_RENAME | true |
DIFF00000008823 | obfuscated_destructive | SQL | shipments_87.sql | schema cleanup | @@ -1,3 +1,3 @@
+delete from customers; | DELETE_UNQUALIFIED | true |
DIFF00000008824 | general_code_change | TypeScript | refunds_972.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 |
DIFF00000008825 | raw_sql_destructive | SQL | orders_175.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE payments SET phone = CONCAT(phone, user_id); | UPDATE_CONCAT | true |
DIFF00000008826 | general_code_change | Java | subscriptions_310.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000008827 | general_code_change | JavaScript | tickets_591.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000008828 | mentioned_in_comment | Python | tickets_866.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: TRUNCATE TABLE logs;") | TRUNCATE | false |
DIFF00000008829 | raw_sql_safe | SQL | employees_222.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE subscriptions SET phone = %s WHERE description = %s; | NONE | false |
DIFF00000008830 | mentioned_in_comment | Python | comments_269.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE payments DROP COLUMN metadata; -- now deprecated""" | DROP_COLUMN | false |
DIFF00000008831 | obfuscated_destructive | SQL | events_958.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
comments
DROP
COLUMN
metadata; | DROP_COLUMN | true |
DIFF00000008832 | raw_sql_destructive | SQL | accounts_384.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE tickets; | TRUNCATE | true |
DIFF00000008833 | general_code_change | TypeScript | events_524.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 |
DIFF00000008834 | orm_schema_change | TypeScript | notifications_173.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Users { // removed field: description } | NONE | true |
DIFF00000008835 | orm_schema_change | Ruby | events_146.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :orders, :category | NONE | true |
DIFF00000008836 | orm_schema_change | Ruby | customers_270.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :notifications, :role | NONE | true |
DIFF00000008837 | general_code_change | Python | refunds_132.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000008838 | raw_sql_destructive | SQL | notifications_328.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | true |
DIFF00000008839 | general_code_change | Java | logs_714.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000008840 | orm_schema_change | Python | employees_846.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='logs', name='updated_at') | NONE | true |
DIFF00000008841 | orm_schema_change | Python | comments_378.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='events', name='category') | NONE | true |
DIFF00000008842 | raw_sql_destructive | SQL | payments_516.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE customers; | TRUNCATE | true |
DIFF00000008843 | raw_sql_safe | SQL | reviews_863.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE events SET is_active = %s WHERE name = %s; | NONE | false |
DIFF00000008844 | orm_schema_change | Python | accounts_968.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='invoices', name='role') | NONE | true |
DIFF00000008845 | raw_sql_destructive | SQL | users_127.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE comments; | TRUNCATE | true |
DIFF00000008846 | raw_sql_destructive | SQL | payments_160.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE products RENAME COLUMN priority TO full_name; | ALTER_RENAME | true |
DIFF00000008847 | general_code_change | Java | subscriptions_723.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000008848 | test_suite_cleanup | SQL | spec/logs_12.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE subscriptions; | DROP_TABLE | false |
DIFF00000008849 | general_code_change | JavaScript | payments_382.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 |
DIFF00000008850 | orm_schema_change | Ruby | events_272.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :subscriptions, :order_id | NONE | true |
DIFF00000008851 | obfuscated_destructive | SQL | tickets_278.sql | schema cleanup | @@ -1,3 +1,3 @@
+deLETe fRoM prOduCTS; | DELETE_UNQUALIFIED | true |
DIFF00000008852 | orm_schema_change | Python | customers_972.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='tickets', name='priority') | NONE | true |
DIFF00000008853 | raw_sql_destructive | SQL | accounts_989.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE employees; | TRUNCATE | true |
DIFF00000008854 | obfuscated_destructive | SQL | shipments_654.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
comments
RENAME
COLUMN
user_id
TO
full_name; | ALTER_RENAME | true |
DIFF00000008855 | raw_sql_safe | SQL | orders_252.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_reviews_quantity ON reviews (status); | NONE | false |
DIFF00000008856 | raw_sql_safe | SQL | users_567.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_logs_user_id ON logs (metadata); | NONE | false |
DIFF00000008857 | orm_schema_change | Python | comments_752.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='transactions', name='role') | NONE | true |
DIFF00000008858 | test_suite_cleanup | SQL | spec/orders_589.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE reviews; | TRUNCATE | false |
DIFF00000008859 | obfuscated_destructive | SQL | users_746.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter table logs rename column priority to contact_email; | ALTER_RENAME | true |
DIFF00000008860 | test_suite_cleanup | SQL | tests/products_994.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM reviews; | DELETE_UNQUALIFIED | false |
DIFF00000008861 | general_code_change | JavaScript | refunds_453.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 |
DIFF00000008862 | test_suite_cleanup | SQL | mysql-test/suite/customers_494.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN description TO amount_cents; | ALTER_RENAME | false |
DIFF00000008863 | test_suite_cleanup | SQL | tests/tickets_726.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE inventory RENAME COLUMN metadata TO full_name; | ALTER_RENAME | false |
DIFF00000008864 | obfuscated_destructive | SQL | invoices_987.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
products
RENAME
COLUMN
address
TO
full_name; | ALTER_RENAME | true |
DIFF00000008865 | test_suite_cleanup | SQL | test/inventory_775.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE customers RENAME COLUMN is_active TO contact_email; | ALTER_RENAME | false |
DIFF00000008866 | general_code_change | Go | accounts_489.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000008867 | raw_sql_safe | SQL | logs_971.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE is_active = 'active'; | NONE | false |
DIFF00000008868 | raw_sql_destructive | SQL | shipments_4.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE reviews RENAME COLUMN name TO user_role; | ALTER_RENAME | true |
DIFF00000008869 | raw_sql_safe | SQL | invoices_145.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM tickets WHERE email = 'active'; | NONE | false |
DIFF00000008870 | orm_schema_change | Python | accounts_133.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='subscriptions', name='quantity') | NONE | true |
DIFF00000008871 | mentioned_in_comment | Python | events_413.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: DELETE FROM notifications; -- now deprecated""" | DELETE_UNQUALIFIED | false |
DIFF00000008872 | orm_schema_change | Python | products_958.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='orders', name='created_at') | NONE | true |
DIFF00000008873 | raw_sql_safe | SQL | events_336.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE logs SET role = %s WHERE address = %s; | NONE | false |
DIFF00000008874 | general_code_change | Python | reviews_797.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000008875 | general_code_change | Python | tickets_512.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000008876 | raw_sql_destructive | SQL | invoices_251.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE reviews SET price = CONCAT(price, updated_at); | UPDATE_CONCAT | true |
DIFF00000008877 | raw_sql_safe | SQL | sessions_752.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE events SET category = %s WHERE user_id = %s; | NONE | false |
DIFF00000008878 | mentioned_in_comment | Python | orders_146.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: TRUNCATE TABLE notifications; -- now deprecated""" | TRUNCATE | false |
DIFF00000008879 | raw_sql_safe | SQL | events_160.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_notifications_priority ON notifications (user_id); | NONE | false |
DIFF00000008880 | orm_schema_change | TypeScript | events_771.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Subscriptions { // removed field: priority } | NONE | true |
DIFF00000008881 | orm_schema_change | Python | inventory_428.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='subscriptions', name='role') | NONE | true |
DIFF00000008882 | raw_sql_safe | SQL | invoices_733.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO refunds (created_at, address) VALUES (%s, %s); | NONE | false |
DIFF00000008883 | raw_sql_safe | SQL | sessions_855.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO comments (name, amount) VALUES (%s, %s); | NONE | false |
DIFF00000008884 | general_code_change | Python | reviews_687.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000008885 | orm_schema_change | TypeScript | employees_730.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Comments { // removed field: status } | NONE | true |
DIFF00000008886 | orm_schema_change | JavaScript | refunds_170.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('refunds', table => table.dropColumn('priority')) | NONE | true |
DIFF00000008887 | orm_schema_change | JavaScript | sessions_585.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('reviews', table => table.dropColumn('price')) | NONE | true |
DIFF00000008888 | mentioned_in_comment | Python | transactions_861.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE users SET order_id = CONCAT(order_id, score);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00000008889 | raw_sql_destructive | SQL | inventory_490.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | true |
DIFF00000008890 | raw_sql_destructive | SQL | notifications_745.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | true |
DIFF00000008891 | orm_schema_change | TypeScript | employees_51.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Accounts { // removed field: is_active } | NONE | true |
DIFF00000008892 | raw_sql_safe | SQL | accounts_503.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO invoices (priority, role) VALUES (%s, %s); | NONE | false |
DIFF00000008893 | test_suite_cleanup | SQL | spec/notifications_841.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM users; | DELETE_UNQUALIFIED | false |
DIFF00000008894 | raw_sql_safe | SQL | payments_877.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM accounts WHERE status = 'active'; | NONE | false |
DIFF00000008895 | general_code_change | Java | comments_714.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000008896 | mentioned_in_comment | Python | employees_280.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'DELETE FROM payments;' manually, handled by migration tool | DELETE_UNQUALIFIED | false |
DIFF00000008897 | orm_schema_change | Python | payments_101.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='tickets', name='email') | NONE | true |
DIFF00000008898 | general_code_change | Java | refunds_15.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000008899 | test_suite_cleanup | SQL | spec/refunds_790.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE products DROP COLUMN amount; | DROP_COLUMN | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.