Skip to content

Instantly share code, notes, and snippets.

@trevorblades
Last active July 14, 2020 06:03
Show Gist options
  • Save trevorblades/718d8da4ddcc6eca59ac79e5e0353217 to your computer and use it in GitHub Desktop.
Save trevorblades/718d8da4ddcc6eca59ac79e5e0353217 to your computer and use it in GitHub Desktop.
update packs set old_id = id;
create extension "uuid-ossp";
alter table packs alter column id set data type uuid using (uuid_generate_v4());
update "packWords" P set "packId2" = (select id from packs where old_id = P."packId");
update "games" P set "packId2" = (select id from packs where old_id = P."packId");
drop sequence packs_id_seq;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment