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 |
|---|---|---|---|---|---|---|---|
DIFF00000009000 | orm_schema_change | TypeScript | customers_708.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Payments { // removed field: role } | NONE | true |
DIFF00000009001 | raw_sql_destructive | SQL | subscriptions_571.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE refunds DROP COLUMN phone; | DROP_COLUMN | true |
DIFF00000009002 | orm_schema_change | JavaScript | notifications_381.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('subscriptions', table => table.dropColumn('user_id')) | NONE | true |
DIFF00000009003 | raw_sql_destructive | SQL | products_404.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE employees; | TRUNCATE | true |
DIFF00000009004 | general_code_change | JavaScript | inventory_169.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 |
DIFF00000009005 | orm_schema_change | Ruby | subscriptions_648.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :accounts, :balance | NONE | true |
DIFF00000009006 | test_suite_cleanup | SQL | spec/customers_938.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions DROP COLUMN user_id; | DROP_COLUMN | false |
DIFF00000009007 | raw_sql_safe | SQL | shipments_594.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM users WHERE priority = 'active'; | NONE | false |
DIFF00000009008 | orm_schema_change | Python | shipments_998.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='events', name='description') | NONE | true |
DIFF00000009009 | raw_sql_safe | SQL | users_80.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE role = 'active'; | NONE | false |
DIFF00000009010 | obfuscated_destructive | SQL | sessions_433.sql | schema cleanup | @@ -1,3 +1,3 @@
+droP TaBLe sHipmeNTS; | DROP_TABLE | true |
DIFF00000009011 | test_suite_cleanup | SQL | spec/notifications_744.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE logs RENAME COLUMN is_active TO state; | ALTER_RENAME | false |
DIFF00000009012 | general_code_change | Go | subscriptions_838.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000009013 | mentioned_in_comment | Python | refunds_644.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DROP TABLE inventory;") | DROP_TABLE | false |
DIFF00000009014 | obfuscated_destructive | SQL | users_700.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE TABLE users; | TRUNCATE | true |
DIFF00000009015 | orm_schema_change | JavaScript | notifications_992.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('products', table => table.dropColumn('updated_at')) | NONE | true |
DIFF00000009016 | raw_sql_destructive | SQL | payments_790.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE reviews SET description = CONCAT(description, phone); | UPDATE_CONCAT | true |
DIFF00000009017 | orm_schema_change | Ruby | events_176.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :events, :score | NONE | true |
DIFF00000009018 | raw_sql_destructive | SQL | invoices_755.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE logs; | DROP_TABLE | true |
DIFF00000009019 | raw_sql_destructive | SQL | transactions_233.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE transactions SET score = CONCAT(score, phone); | UPDATE_CONCAT | true |
DIFF00000009020 | orm_schema_change | Ruby | tickets_791.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :accounts, :created_at | NONE | true |
DIFF00000009021 | mentioned_in_comment | Python | comments_466.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE products SET category = CONCAT(category, priority);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00000009022 | general_code_change | Python | logs_312.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000009023 | mentioned_in_comment | Python | customers_636.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE events DROP COLUMN description;") | DROP_COLUMN | false |
DIFF00000009024 | general_code_change | TypeScript | reviews_91.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 |
DIFF00000009025 | general_code_change | Java | reviews_864.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000009026 | general_code_change | Java | transactions_981.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000009027 | general_code_change | Go | notifications_514.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000009028 | general_code_change | JavaScript | reviews_102.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000009029 | raw_sql_safe | SQL | accounts_423.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE orders ADD COLUMN full_name VARCHAR(255); | NONE | false |
DIFF00000009030 | raw_sql_destructive | SQL | reviews_277.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE logs RENAME COLUMN address TO contact_email; | ALTER_RENAME | true |
DIFF00000009031 | orm_schema_change | JavaScript | invoices_604.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('customers', table => table.dropColumn('amount')) | NONE | true |
DIFF00000009032 | mentioned_in_comment | Python | reviews_86.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: TRUNCATE TABLE inventory; -- now deprecated""" | TRUNCATE | false |
DIFF00000009033 | general_code_change | Go | reviews_256.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000009034 | raw_sql_destructive | SQL | accounts_478.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM employees; | DELETE_UNQUALIFIED | true |
DIFF00000009035 | raw_sql_safe | SQL | notifications_230.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM logs WHERE priority = 'active'; | NONE | false |
DIFF00000009036 | obfuscated_destructive | SQL | inventory_863.sql | schema cleanup | @@ -1,3 +1,3 @@
+UPdaTe TraNSacTioNs set NAme = cOncAt(NaMe, crEated_At); | UPDATE_CONCAT | true |
DIFF00000009037 | orm_schema_change | JavaScript | inventory_896.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('transactions', 'amount') | NONE | true |
DIFF00000009038 | raw_sql_safe | SQL | tickets_950.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO tickets (user_id, status) VALUES (%s, %s); | NONE | false |
DIFF00000009039 | general_code_change | Python | comments_621.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000009040 | orm_schema_change | Python | sessions_461.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='logs', name='description') | NONE | true |
DIFF00000009041 | orm_schema_change | TypeScript | events_652.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Notifications { // removed field: email } | NONE | true |
DIFF00000009042 | test_suite_cleanup | SQL | spec/sessions_557.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | false |
DIFF00000009043 | raw_sql_safe | SQL | logs_746.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE customers ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00000009044 | mentioned_in_comment | Python | inventory_735.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'UPDATE payments SET user_id = CONCAT(user_id, updated_at);' manually, handled by migration tool | UPDATE_CONCAT | false |
DIFF00000009045 | raw_sql_destructive | SQL | employees_295.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE comments RENAME COLUMN priority TO state; | ALTER_RENAME | true |
DIFF00000009046 | orm_schema_change | Python | orders_226.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='invoices', name='priority') | NONE | true |
DIFF00000009047 | raw_sql_safe | SQL | orders_404.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE comments SET is_active = %s WHERE email = %s; | NONE | false |
DIFF00000009048 | orm_schema_change | JavaScript | refunds_797.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('employees', table => table.dropColumn('order_id')) | NONE | true |
DIFF00000009049 | general_code_change | Python | orders_101.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000009050 | general_code_change | TypeScript | users_726.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 |
DIFF00000009051 | raw_sql_safe | SQL | comments_219.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE users ADD COLUMN contact_email VARCHAR(255); | NONE | false |
DIFF00000009052 | general_code_change | Ruby | employees_359.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000009053 | orm_schema_change | TypeScript | subscriptions_221.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Users { // removed field: updated_at } | NONE | true |
DIFF00000009054 | mentioned_in_comment | Python | comments_904.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'ALTER TABLE employees RENAME COLUMN balance TO state;' manually, handled by migration tool | ALTER_RENAME | false |
DIFF00000009055 | general_code_change | Python | users_686.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000009056 | test_suite_cleanup | SQL | tests/notifications_968.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM notifications; | DELETE_UNQUALIFIED | false |
DIFF00000009057 | general_code_change | Python | refunds_438.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00000009058 | test_suite_cleanup | SQL | test/notifications_415.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | false |
DIFF00000009059 | mentioned_in_comment | Python | tickets_606.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE transactions;' manually, handled by migration tool | TRUNCATE | false |
DIFF00000009060 | orm_schema_change | JavaScript | refunds_597.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('comments', table => table.dropColumn('created_at')) | NONE | true |
DIFF00000009061 | test_suite_cleanup | SQL | test/inventory_931.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM refunds; | DELETE_UNQUALIFIED | false |
DIFF00000009062 | general_code_change | Go | shipments_957.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000009063 | orm_schema_change | TypeScript | subscriptions_725.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Orders { // removed field: balance } | NONE | true |
DIFF00000009064 | raw_sql_destructive | SQL | employees_558.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE customers DROP COLUMN created_at; | DROP_COLUMN | true |
DIFF00000009065 | obfuscated_destructive | SQL | sessions_423.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE
FROM
subscriptions; | DELETE_UNQUALIFIED | true |
DIFF00000009066 | mentioned_in_comment | Python | customers_217.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE shipments DROP COLUMN created_at;") | DROP_COLUMN | false |
DIFF00000009067 | general_code_change | Java | customers_827.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00000009068 | obfuscated_destructive | SQL | accounts_824.sql | schema cleanup | @@ -1,3 +1,3 @@
+update inventory set status = concat(status, description); | UPDATE_CONCAT | true |
DIFF00000009069 | raw_sql_safe | SQL | inventory_592.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM logs WHERE user_id = 'active'; | NONE | false |
DIFF00000009070 | general_code_change | Python | subscriptions_434.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000009071 | general_code_change | Ruby | logs_887.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00000009072 | raw_sql_destructive | SQL | comments_258.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE inventory RENAME COLUMN priority TO amount_cents; | ALTER_RENAME | true |
DIFF00000009073 | raw_sql_safe | SQL | logs_18.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO employees (is_active, price) VALUES (%s, %s); | NONE | false |
DIFF00000009074 | raw_sql_destructive | SQL | refunds_815.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE orders RENAME COLUMN user_id TO full_name; | ALTER_RENAME | true |
DIFF00000009075 | general_code_change | Go | products_22.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000009076 | raw_sql_destructive | SQL | users_614.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE orders SET status = CONCAT(status, price); | UPDATE_CONCAT | true |
DIFF00000009077 | raw_sql_destructive | SQL | shipments_333.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE shipments SET category = CONCAT(category, category); | UPDATE_CONCAT | true |
DIFF00000009078 | mentioned_in_comment | Python | subscriptions_122.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE reviews DROP COLUMN email; -- now deprecated""" | DROP_COLUMN | false |
DIFF00000009079 | raw_sql_destructive | SQL | inventory_255.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE logs; | TRUNCATE | true |
DIFF00000009080 | general_code_change | Python | products_941.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00000009081 | orm_schema_change | TypeScript | customers_260.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Accounts { // removed field: status } | NONE | true |
DIFF00000009082 | general_code_change | Go | users_904.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00000009083 | orm_schema_change | JavaScript | reviews_423.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('payments', table => table.dropColumn('updated_at')) | NONE | true |
DIFF00000009084 | orm_schema_change | JavaScript | events_280.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('invoices', 'name') | NONE | true |
DIFF00000009085 | raw_sql_destructive | SQL | customers_934.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | true |
DIFF00000009086 | orm_schema_change | Ruby | refunds_540.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :comments, :score | NONE | true |
DIFF00000009087 | obfuscated_destructive | SQL | shipments_906.sql | schema cleanup | @@ -1,3 +1,3 @@
+aLteR TABlE subscrIptIONS REName cOLumn QUaNtITy tO User_roLE; | ALTER_RENAME | true |
DIFF00000009088 | obfuscated_destructive | SQL | payments_861.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
reviews
RENAME
COLUMN
description
TO
contact_email; | ALTER_RENAME | true |
DIFF00000009089 | raw_sql_safe | SQL | logs_380.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE users ADD COLUMN user_role VARCHAR(255); | NONE | false |
DIFF00000009090 | orm_schema_change | Python | refunds_656.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='employees', name='phone') | NONE | true |
DIFF00000009091 | raw_sql_safe | SQL | payments_148.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM payments WHERE category = 'active'; | NONE | false |
DIFF00000009092 | orm_schema_change | Ruby | employees_774.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :employees, :is_active | NONE | true |
DIFF00000009093 | orm_schema_change | JavaScript | events_441.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('employees', table => table.dropColumn('priority')) | NONE | true |
DIFF00000009094 | orm_schema_change | Ruby | notifications_637.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :tickets, :price | NONE | true |
DIFF00000009095 | raw_sql_destructive | SQL | accounts_991.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE employees; | DROP_TABLE | true |
DIFF00000009096 | test_suite_cleanup | SQL | mysql-test/suite/invoices_280.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE products; | TRUNCATE | false |
DIFF00000009097 | raw_sql_destructive | SQL | employees_587.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE events SET priority = CONCAT(priority, category); | UPDATE_CONCAT | true |
DIFF00000009098 | general_code_change | JavaScript | invoices_659.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00000009099 | general_code_change | Ruby | employees_265.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.