Skip to content

Instantly share code, notes, and snippets.

@guttentag
Created November 26, 2020 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guttentag/6bb286427ea1fcf6333711f5382f3ad6 to your computer and use it in GitHub Desktop.
Save guttentag/6bb286427ea1fcf6333711f5382f3ad6 to your computer and use it in GitHub Desktop.
Migrate postgres from vapor 2 to vapor 3
1. CREATE EXTENSION "uuid-ossp";
2. ALTER TABLE fluent RENAME TO fluent_old;
CREATE TABLE fluent
AS (SELECT uuid_generate_v4() as id, name, batch, created_at as createdAt, updated_at as updatedAt from fluent_old);
3. After you have verified the table was transferred properly, you can drop the old fluent table: 
DROP TABLE fluent_old;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment