about summary refs log tree commit diff
path: root/migrations/2018-05-01-141548_add-users/down.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/2018-05-01-141548_add-users/down.sql')
-rw-r--r--migrations/2018-05-01-141548_add-users/down.sql8
1 files changed, 4 insertions, 4 deletions
diff --git a/migrations/2018-05-01-141548_add-users/down.sql b/migrations/2018-05-01-141548_add-users/down.sql
index 2f903171d4ba..61fd222e18cf 100644
--- a/migrations/2018-05-01-141548_add-users/down.sql
+++ b/migrations/2018-05-01-141548_add-users/down.sql
@@ -8,12 +8,12 @@ ALTER TABLE posts ADD COLUMN author_email VARCHAR;
 UPDATE threads SET author_name = users.name,
                    author_email = users.email
   FROM users
-  WHERE threads.author = users.id;
+  WHERE threads.user_id = users.id;
 
 UPDATE posts SET author_name = users.name,
                  author_email = users.email
   FROM users
-  WHERE posts.author = users.id;
+  WHERE posts.user_id = users.id;
 
 -- add the constraints back:
 ALTER TABLE threads ALTER COLUMN author_name SET NOT NULL;
@@ -58,6 +58,6 @@ CREATE MATERIALIZED VIEW search_index AS
 CREATE INDEX idx_fts_search ON search_index USING gin(document);
 
 -- and drop the users table and columns:
-ALTER TABLE posts DROP COLUMN author;
-ALTER TABLE threads DROP COLUMN author;
+ALTER TABLE posts DROP COLUMN user_id;
+ALTER TABLE threads DROP COLUMN user_id;
 DROP TABLE users;