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 |
|---|---|---|---|---|---|---|---|
DIFF00099998500 | test_suite_cleanup | SQL | spec/inventory_173.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE refunds DROP COLUMN priority; | DROP_COLUMN | false |
DIFF00099998501 | orm_schema_change | Ruby | transactions_697.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :subscriptions, :user_id | NONE | true |
DIFF00099998502 | general_code_change | JavaScript | employees_19.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099998503 | orm_schema_change | Python | accounts_345.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='subscriptions', name='user_id') | NONE | true |
DIFF00099998504 | raw_sql_destructive | SQL | subscriptions_26.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE invoices SET description = CONCAT(description, address); | UPDATE_CONCAT | true |
DIFF00099998505 | orm_schema_change | JavaScript | logs_280.js | sequelize migration: drop unused field | @@ -1,3 +1,3 @@
+queryInterface.removeColumn('comments', 'score') | NONE | true |
DIFF00099998506 | orm_schema_change | TypeScript | customers_298.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Payments { // removed field: updated_at } | NONE | true |
DIFF00099998507 | raw_sql_safe | SQL | notifications_764.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE refunds SET name = %s WHERE order_id = %s; | NONE | false |
DIFF00099998508 | general_code_change | Python | subscriptions_272.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099998509 | obfuscated_destructive | SQL | tickets_647.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER TABLE logs RENAME COLUMN amount TO user_role; | ALTER_RENAME | true |
DIFF00099998510 | raw_sql_destructive | SQL | payments_876.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE subscriptions; | DROP_TABLE | true |
DIFF00099998511 | general_code_change | Java | employees_635.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099998512 | raw_sql_safe | SQL | subscriptions_859.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_comments_updated_at ON comments (created_at); | NONE | false |
DIFF00099998513 | raw_sql_destructive | SQL | tickets_274.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE comments; | DROP_TABLE | true |
DIFF00099998514 | raw_sql_destructive | SQL | reviews_389.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE orders; | TRUNCATE | true |
DIFF00099998515 | obfuscated_destructive | SQL | orders_43.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALTER
TABLE
transactions
DROP
COLUMN
price; | DROP_COLUMN | true |
DIFF00099998516 | general_code_change | Ruby | inventory_442.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099998517 | obfuscated_destructive | SQL | tickets_66.sql | schema cleanup | @@ -1,3 +1,3 @@
+TRUNCATE
TABLE
events; | TRUNCATE | true |
DIFF00099998518 | raw_sql_safe | SQL | comments_295.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_subscriptions_balance ON subscriptions (phone); | NONE | false |
DIFF00099998519 | raw_sql_destructive | SQL | tickets_594.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE subscriptions; | TRUNCATE | true |
DIFF00099998520 | test_suite_cleanup | SQL | test/invoices_59.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE refunds DROP COLUMN name; | DROP_COLUMN | false |
DIFF00099998521 | orm_schema_change | JavaScript | users_89.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('invoices', table => table.dropColumn('price')) | NONE | true |
DIFF00099998522 | orm_schema_change | Python | transactions_390.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='inventory', name='created_at') | NONE | true |
DIFF00099998523 | raw_sql_destructive | SQL | notifications_683.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE comments; | DROP_TABLE | true |
DIFF00099998524 | general_code_change | Ruby | notifications_669.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099998525 | raw_sql_safe | SQL | accounts_445.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO users (order_id, quantity) VALUES (%s, %s); | NONE | false |
DIFF00099998526 | mentioned_in_comment | Python | logs_530.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE events RENAME COLUMN name TO amount_cents;") | ALTER_RENAME | false |
DIFF00099998527 | orm_schema_change | JavaScript | inventory_62.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('transactions', table => table.dropColumn('balance')) | NONE | true |
DIFF00099998528 | general_code_change | Ruby | customers_580.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099998529 | raw_sql_destructive | SQL | customers_574.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | true |
DIFF00099998530 | test_suite_cleanup | SQL | spec/notifications_910.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE notifications; | TRUNCATE | false |
DIFF00099998531 | test_suite_cleanup | SQL | mysql-test/suite/comments_137.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE customers SET category = CONCAT(category, updated_at); | UPDATE_CONCAT | false |
DIFF00099998532 | test_suite_cleanup | SQL | tests/refunds_185.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+TRUNCATE TABLE employees; | TRUNCATE | false |
DIFF00099998533 | orm_schema_change | TypeScript | transactions_923.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Payments { // removed field: updated_at } | NONE | true |
DIFF00099998534 | obfuscated_destructive | SQL | sessions_886.sql | schema cleanup | @@ -1,3 +1,3 @@
+Alter tABLe cUStOmERs Drop coLUMN dESCrIptIOn; | DROP_COLUMN | true |
DIFF00099998535 | mentioned_in_comment | Python | products_359.py | add warning comment | @@ -1,3 +1,3 @@
+# NOTE: do not run 'TRUNCATE TABLE orders;' manually, handled by migration tool | TRUNCATE | false |
DIFF00099998536 | test_suite_cleanup | SQL | spec/sessions_482.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE payments RENAME COLUMN status TO full_name; | ALTER_RENAME | false |
DIFF00099998537 | test_suite_cleanup | SQL | mysql-test/suite/sessions_515.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE tickets DROP COLUMN address; | DROP_COLUMN | false |
DIFF00099998538 | test_suite_cleanup | SQL | tests/comments_403.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE events; | DROP_TABLE | false |
DIFF00099998539 | raw_sql_destructive | SQL | reviews_394.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE users; | TRUNCATE | true |
DIFF00099998540 | raw_sql_safe | SQL | transactions_744.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE shipments SET user_id = %s WHERE created_at = %s; | NONE | false |
DIFF00099998541 | orm_schema_change | Ruby | invoices_189.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :employees, :price | NONE | true |
DIFF00099998542 | test_suite_cleanup | SQL | mysql-test/suite/tickets_57.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE comments SET balance = CONCAT(balance, order_id); | UPDATE_CONCAT | false |
DIFF00099998543 | raw_sql_safe | SQL | payments_724.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+CREATE INDEX idx_notifications_user_id ON notifications (address); | NONE | false |
DIFF00099998544 | general_code_change | Java | logs_861.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
DIFF00099998545 | general_code_change | JavaScript | logs_589.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 |
DIFF00099998546 | general_code_change | Python | tickets_634.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099998547 | orm_schema_change | TypeScript | shipments_612.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Inventory { // removed field: metadata } | NONE | true |
DIFF00099998548 | obfuscated_destructive | SQL | tickets_571.sql | schema cleanup | @@ -1,3 +1,3 @@
+alter taBLE TiCKeTs REname CoLUMn emAIL tO AMOuNt_cenTs; | ALTER_RENAME | true |
DIFF00099998549 | mentioned_in_comment | Python | employees_495.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: UPDATE refunds SET name = CONCAT(name, updated_at); -- now deprecated""" | UPDATE_CONCAT | false |
DIFF00099998550 | raw_sql_destructive | SQL | shipments_285.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | true |
DIFF00099998551 | mentioned_in_comment | Python | invoices_38.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE invoices DROP COLUMN price; -- now deprecated""" | DROP_COLUMN | false |
DIFF00099998552 | general_code_change | Go | notifications_957.go | refactor / feature work | @@ -1,3 +1,3 @@
+func HandleRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") } | NONE | false |
DIFF00099998553 | raw_sql_safe | SQL | subscriptions_434.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM shipments WHERE role = 'active'; | NONE | false |
DIFF00099998554 | orm_schema_change | TypeScript | subscriptions_42.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Products { // removed field: metadata } | NONE | true |
DIFF00099998555 | raw_sql_safe | SQL | payments_627.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO events (metadata, created_at) VALUES (%s, %s); | NONE | false |
DIFF00099998556 | test_suite_cleanup | SQL | spec/accounts_682.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE payments; | DROP_TABLE | false |
DIFF00099998557 | orm_schema_change | TypeScript | inventory_852.ts | prisma migration: drop unused field | @@ -1,3 +1,3 @@
+model Payments { // removed field: address } | NONE | true |
DIFF00099998558 | orm_schema_change | Ruby | tickets_327.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :logs, :order_id | NONE | true |
DIFF00099998559 | raw_sql_destructive | SQL | invoices_536.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM payments; | DELETE_UNQUALIFIED | true |
DIFF00099998560 | test_suite_cleanup | SQL | tests/notifications_438.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DROP TABLE orders; | DROP_TABLE | false |
DIFF00099998561 | raw_sql_safe | SQL | orders_233.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO notifications (price, category) VALUES (%s, %s); | NONE | false |
DIFF00099998562 | raw_sql_safe | SQL | payments_32.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+UPDATE reviews SET quantity = %s WHERE score = %s; | NONE | false |
DIFF00099998563 | mentioned_in_comment | Python | shipments_911.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: DELETE FROM shipments;") | DELETE_UNQUALIFIED | false |
DIFF00099998564 | general_code_change | Python | orders_269.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099998565 | raw_sql_safe | SQL | subscriptions_181.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM subscriptions WHERE is_active = 'active'; | NONE | false |
DIFF00099998566 | raw_sql_destructive | SQL | payments_236.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE sessions; | TRUNCATE | true |
DIFF00099998567 | orm_schema_change | JavaScript | inventory_64.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('tickets', table => table.dropColumn('score')) | NONE | true |
DIFF00099998568 | general_code_change | TypeScript | tickets_885.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 |
DIFF00099998569 | raw_sql_destructive | SQL | payments_882.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE payments; | TRUNCATE | true |
DIFF00099998570 | raw_sql_destructive | SQL | comments_605.sql | update schema | @@ -1,3 +1,3 @@
+UPDATE invoices SET score = CONCAT(score, amount); | UPDATE_CONCAT | true |
DIFF00099998571 | general_code_change | Python | accounts_889.py | refactor / feature work | @@ -1,3 +1,3 @@
+def calculate_total(items):
return sum(i.price for i in items) | NONE | false |
DIFF00099998572 | general_code_change | Python | comments_833.py | refactor / feature work | @@ -1,3 +1,3 @@
+class Cache:
def __init__(self):
self._store = {} | NONE | false |
DIFF00099998573 | test_suite_cleanup | SQL | test/users_556.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+UPDATE comments SET quantity = CONCAT(quantity, score); | UPDATE_CONCAT | false |
DIFF00099998574 | raw_sql_safe | SQL | payments_508.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM invoices WHERE address = 'active'; | NONE | false |
DIFF00099998575 | obfuscated_destructive | SQL | products_701.sql | schema cleanup | @@ -1,3 +1,3 @@
+drop tAbLe evENTS; | DROP_TABLE | true |
DIFF00099998576 | raw_sql_destructive | SQL | logs_990.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE orders; | TRUNCATE | true |
DIFF00099998577 | mentioned_in_comment | Python | shipments_884.py | add warning comment | @@ -1,3 +1,3 @@
+"""This function used to run: ALTER TABLE inventory DROP COLUMN name; -- now deprecated""" | DROP_COLUMN | false |
DIFF00099998578 | raw_sql_destructive | SQL | sessions_870.sql | update schema | @@ -1,3 +1,3 @@
+ALTER TABLE subscriptions DROP COLUMN category; | DROP_COLUMN | true |
DIFF00099998579 | general_code_change | Ruby | invoices_591.rb | refactor / feature work | @@ -1,3 +1,3 @@
+def full_name
"#{first_name} #{last_name}"
end | NONE | false |
DIFF00099998580 | general_code_change | JavaScript | sessions_189.js | refactor / feature work | @@ -1,3 +1,3 @@
+function formatDate(d) { return d.toISOString(); } | NONE | false |
DIFF00099998581 | orm_schema_change | Python | subscriptions_345.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='orders', name='order_id') | NONE | true |
DIFF00099998582 | test_suite_cleanup | SQL | tests/invoices_437.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE events DROP COLUMN metadata; | DROP_COLUMN | false |
DIFF00099998583 | raw_sql_destructive | SQL | employees_734.sql | update schema | @@ -1,3 +1,3 @@
+DELETE FROM users; | DELETE_UNQUALIFIED | true |
DIFF00099998584 | general_code_change | JavaScript | invoices_871.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 |
DIFF00099998585 | raw_sql_destructive | SQL | sessions_1.sql | update schema | @@ -1,3 +1,3 @@
+DROP TABLE notifications; | DROP_TABLE | true |
DIFF00099998586 | raw_sql_safe | SQL | users_655.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+ALTER TABLE comments ADD COLUMN amount_cents VARCHAR(255); | NONE | false |
DIFF00099998587 | mentioned_in_comment | Python | customers_264.py | add warning comment | @@ -1,3 +1,3 @@
+logger.warning("Skipping legacy query: ALTER TABLE refunds DROP COLUMN price;") | DROP_COLUMN | false |
DIFF00099998588 | orm_schema_change | Python | customers_393.py | django migration: drop unused field | @@ -1,3 +1,3 @@
+migrations.RemoveField(model_name='shipments', name='address') | NONE | true |
DIFF00099998589 | raw_sql_safe | SQL | employees_919.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO reviews (quantity, user_id) VALUES (%s, %s); | NONE | false |
DIFF00099998590 | raw_sql_safe | SQL | logs_385.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+INSERT INTO payments (category, status) VALUES (%s, %s); | NONE | false |
DIFF00099998591 | test_suite_cleanup | SQL | mysql-test/suite/products_55.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+DELETE FROM sessions; | DELETE_UNQUALIFIED | false |
DIFF00099998592 | raw_sql_safe | SQL | subscriptions_250.sql | add index / minor schema tweak | @@ -1,3 +1,3 @@
+SELECT * FROM orders WHERE email = 'active'; | NONE | false |
DIFF00099998593 | obfuscated_destructive | SQL | orders_162.sql | schema cleanup | @@ -1,3 +1,3 @@
+ALteR TaBLE trAnSacTions reNaME cOlumn nAME To State; | ALTER_RENAME | true |
DIFF00099998594 | raw_sql_destructive | SQL | notifications_911.sql | update schema | @@ -1,3 +1,3 @@
+TRUNCATE TABLE subscriptions; | TRUNCATE | true |
DIFF00099998595 | test_suite_cleanup | SQL | mysql-test/suite/reviews_331.sql | test cleanup fixture | @@ -1,3 +1,3 @@
+ALTER TABLE orders RENAME COLUMN role TO state; | ALTER_RENAME | false |
DIFF00099998596 | orm_schema_change | JavaScript | transactions_651.js | knex migration: drop unused field | @@ -1,3 +1,3 @@
+knex.schema.table('orders', table => table.dropColumn('quantity')) | NONE | true |
DIFF00099998597 | orm_schema_change | Ruby | inventory_785.rb | rails migration: drop unused field | @@ -1,3 +1,3 @@
+remove_column :payments, :metadata | NONE | true |
DIFF00099998598 | obfuscated_destructive | SQL | tickets_589.sql | schema cleanup | @@ -1,3 +1,3 @@
+DELETE FROM tickets; | DELETE_UNQUALIFIED | true |
DIFF00099998599 | general_code_change | Java | refunds_646.java | refactor / feature work | @@ -1,3 +1,3 @@
+public class UserService { public User findById(Long id) { return repo.find(id); } } | NONE | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.