3 ms·
Not using Copilot yet, would appreciate if you could provide some real examples on what you typed and what copilot suggested.
by pqdbr 5y ago
Not using Copilot yet, would appreciate if you could provide some real examples on what you typed and what copilot suggested.
- phamilton 5y agoWhen I type: def up execute <<-SQL alter table users add constraint active_users_must_have_email check active = false OR email is not null NOT VALID SQL i.e. I am adding a check constraint but making it NOT VALID so it won't lock the table while scanning If I continue and write execute <<-SQL a then it completes it with alter table users And then the next line I type v and it completes it with validate constraint active_users_must_have_email SQL I then type end and it suggests: def down execute <<-SQL ALTER TABLE users DROP CONSTRAINT IF EXISTS constraint active_users_must_have_email; SQL end Which is exactly what I needed. What impresses me is that a) it recognized that a NOT VALID index needs to be VALIDATEd and b) it figured out what the down migration was.