Created
November 26, 2020 18:09
-
-
Save guttentag/6bb286427ea1fcf6333711f5382f3ad6 to your computer and use it in GitHub Desktop.
Migrate postgres from vapor 2 to vapor 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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