prior-art-archive / migration-2019

Scripts related to the migration of v1 to v2
MIT License
0 stars 0 forks source link

v2-dev and v2-prod database schemas differ #16

Open reefdog opened 5 years ago

reefdog commented 5 years ago

We rather expected this going in, which is why we were wiping dev's schema and replacing with prod's anyway, but I wanted to capture this for the record.

--- prarar_v2_prod_schema.sql
+++ (prarar_v2_dev_schema.sql)
@@ -2,7 +2,7 @@
 -- PostgreSQL database dump
 --

--- Dumped from database version 10.7 (Ubuntu 10.7-1.pgdg16.04+1)
+-- Dumped from database version 10.9 (Ubuntu 10.9-1.pgdg16.04+1)
 -- Dumped by pg_dump version 11.4

 SET statement_timeout = 0;
@@ -16,20 +16,6 @@
 SET client_min_messages = warning;
 SET row_security = off;

---
--- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -
---
-
-CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
-
-
---
--- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: -
---
-
-COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed';
-
-
 SET default_tablespace = '';

 SET default_with_oids = false;
@@ -44,6 +30,7 @@
     "organizationId" uuid NOT NULL,
     cid text,
     "fileCid" text,
+    "fileName" text,
     "createdAt" timestamp with time zone NOT NULL,
     "updatedAt" timestamp with time zone NOT NULL
 );
@@ -58,9 +45,11 @@
     title text,
     description text,
     "fileUrl" text,
-    "fileName" text,
     "contentType" text,
     "organizationId" uuid NOT NULL,
+    "cpcCodes" text[],
+    language text,
+    "publicationDate" timestamp with time zone,
     "createdAt" timestamp with time zone NOT NULL,
     "updatedAt" timestamp with time zone NOT NULL
 );
reefdog commented 5 years ago

Whilst debugging with @joeltg, we went ahead and made those column changes to the v2-dev database. (It helped the profile page render, which allowed us to actually upload docs.)