Skip to content

Instantly share code, notes, and snippets.

@PavelPenkov
Created June 10, 2013 00:38
Show Gist options
  • Select an option

  • Save PavelPenkov/5745886 to your computer and use it in GitHub Desktop.

Select an option

Save PavelPenkov/5745886 to your computer and use it in GitHub Desktop.
DROP TABLE categories_search;
DROP TABLE onebox_renders;
DROP TABLE post_onebox_renders;
DROP TABLE posts_search;
DROP TABLE users_search;
DROP SEQUENCE onebox_renders_id_seq;
ALTER TABLE categories
ADD COLUMN hotness double precision DEFAULT 5.0 NOT NULL,
ADD COLUMN secure boolean DEFAULT false NOT NULL,
ADD COLUMN auto_close_days double precision;
ALTER TABLE category_featured_topics
ADD COLUMN "rank" integer DEFAULT 0 NOT NULL;
ALTER TABLE incoming_links
ADD COLUMN user_id integer,
ADD COLUMN ip_address inet,
ADD COLUMN current_user_id integer,
ALTER COLUMN referer DROP NOT NULL,
ALTER COLUMN "domain" DROP NOT NULL;
ALTER TABLE notifications
ALTER COLUMN "data" TYPE character varying(1000) /* TYPE change - table: notifications original: character varying(255) new: character varying(1000) */;
ALTER TABLE post_actions
ADD COLUMN related_post_id integer,
ADD COLUMN staff_took_action boolean DEFAULT false NOT NULL;
ALTER TABLE posts
DROP COLUMN custom_flag_count,
ADD COLUMN notify_moderators_count integer DEFAULT 0 NOT NULL,
ADD COLUMN "percent_rank" double precision DEFAULT 1.0,
ADD COLUMN notify_user_count integer DEFAULT 0 NOT NULL,
ADD COLUMN like_score integer DEFAULT 0 NOT NULL;
ALTER TABLE topic_users
ADD COLUMN unstarred_at timestamp without time zone;
ALTER TABLE topics
DROP COLUMN custom_flag_count,
ADD COLUMN notify_moderators_count integer DEFAULT 0 NOT NULL,
ADD COLUMN score double precision,
ADD COLUMN "percent_rank" double precision DEFAULT 1.0 NOT NULL,
ADD COLUMN notify_user_count integer DEFAULT 0 NOT NULL,
ADD COLUMN subtype character varying(255),
ADD COLUMN slug character varying(255),
ADD COLUMN auto_close_at timestamp without time zone,
ADD COLUMN auto_close_user_id integer,
ADD COLUMN auto_close_started_at timestamp without time zone;
ALTER TABLE users
ADD COLUMN likes_given integer DEFAULT 0 NOT NULL,
ADD COLUMN likes_received integer DEFAULT 0 NOT NULL,
ADD COLUMN topic_reply_count integer DEFAULT 0 NOT NULL,
ADD COLUMN blocked boolean DEFAULT false;
CREATE INDEX index_category_featured_topics_on_category_id_and_rank ON category_featured_topics USING btree (category_id, rank);
CREATE INDEX idx_search_category ON category_search_data USING gin (search_data);
CREATE INDEX idx_search_post ON post_search_data USING gin (search_data);
CREATE INDEX idx_search_user ON user_search_data USING gin (search_data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment