From 2d0bbc65523a8f6cd59790fdc5bd206b4041813d Mon Sep 17 00:00:00 2001 From: Erik Rose Date: Mon, 28 Feb 2011 17:23:30 -0800 Subject: [PATCH] Add missing migration from 602144100. --- migrations/86-tweet-relationships.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 migrations/86-tweet-relationships.sql diff --git a/migrations/86-tweet-relationships.sql b/migrations/86-tweet-relationships.sql new file mode 100644 index 000000000..7dd6a39a7 --- /dev/null +++ b/migrations/86-tweet-relationships.sql @@ -0,0 +1,8 @@ +-- Remove surrogate key, and use tweet ID instead. Make reply_to a foreign key, +-- and rename it to conform to our conventions. +ALTER TABLE customercare_tweet DROP id, ADD PRIMARY KEY (tweet_id); +ALTER TABLE customercare_tweet CHANGE reply_to reply_to_id bigint; +ALTER TABLE customercare_tweet ADD CONSTRAINT reply_to_id_refs_tweet_id_47b7f44d FOREIGN KEY (reply_to_id) REFERENCES customercare_tweet (tweet_id); + +-- Drop old tweet_id index, now redundant with pkey: +ALTER TABLE customercare_tweet DROP KEY tweet_id;