From f5405c8c67d6af593262d9326c4a68e1715fb93f Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 30 Aug 2012 14:45:01 -0400 Subject: [PATCH] compatibility for postgres 8.4 --- app/logical/alias_and_implication_importer.rb | 2 +- db/danbooru1.struct.sql | 3345 ---------- db/development_structure.sql | 5500 ----------------- db/schema.rb | 1477 +++++ db/structure.sql | 1078 ++-- db/test_structure.sql | 2914 --------- script/upgrade_schema.sql | 8 +- 7 files changed, 2030 insertions(+), 12294 deletions(-) delete mode 100644 db/danbooru1.struct.sql delete mode 100644 db/development_structure.sql create mode 100644 db/schema.rb delete mode 100644 db/test_structure.sql diff --git a/app/logical/alias_and_implication_importer.rb b/app/logical/alias_and_implication_importer.rb index ebf083494..4e8c1125b 100644 --- a/app/logical/alias_and_implication_importer.rb +++ b/app/logical/alias_and_implication_importer.rb @@ -41,7 +41,7 @@ private when :create_alias tag_alias = TagAlias.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2]) tag_alias.delay.process! - + when :create_implication tag_implication = TagImplication.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2]) tag_implication.delay.process! diff --git a/db/danbooru1.struct.sql b/db/danbooru1.struct.sql deleted file mode 100644 index cbec7583d..000000000 --- a/db/danbooru1.struct.sql +++ /dev/null @@ -1,3345 +0,0 @@ --- --- PostgreSQL database dump --- - -SET statement_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = off; -SET check_function_bodies = false; -SET client_min_messages = warning; -SET escape_string_warning = off; - --- --- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: albert --- - -CREATE PROCEDURAL LANGUAGE plpgsql; - - -ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO albert; - -SET search_path = public, pg_catalog; - --- --- Name: post_status; Type: TYPE; Schema: public; Owner: albert --- - -CREATE TYPE post_status AS ENUM ( - 'deleted', - 'flagged', - 'pending', - 'active' -); - - -ALTER TYPE public.post_status OWNER TO albert; - --- --- Name: block_delete(); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION block_delete() RETURNS trigger - LANGUAGE plpgsql - AS $$ -begin - RAISE EXCEPTION 'Attempted to delete from note table'; - RETURN NULL; -end; -$$; - - -ALTER FUNCTION public.block_delete() OWNER TO albert; - --- --- Name: notes_block_delete(); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION notes_block_delete() RETURNS trigger - LANGUAGE plpgsql - AS $$ -begin - raise exception 'cannot delete note'; -end; -$$; - - -ALTER FUNCTION public.notes_block_delete() OWNER TO albert; - --- --- Name: pools_posts_delete_trg(); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION pools_posts_delete_trg() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - UPDATE pools SET post_count = post_count - 1 WHERE id = OLD.pool_id; - RETURN OLD; - END; - $$; - - -ALTER FUNCTION public.pools_posts_delete_trg() OWNER TO albert; - --- --- Name: pools_posts_insert_trg(); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION pools_posts_insert_trg() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - UPDATE pools SET post_count = post_count + 1 WHERE id = NEW.pool_id; - RETURN NEW; - END; - $$; - - -ALTER FUNCTION public.pools_posts_insert_trg() OWNER TO albert; - --- --- Name: rlike(text, text); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION rlike(text, text) RETURNS boolean - LANGUAGE sql IMMUTABLE STRICT - AS $_$select $2 like $1$_$; - - -ALTER FUNCTION public.rlike(text, text) OWNER TO albert; - --- --- Name: testprs_end(internal); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION testprs_end(internal) RETURNS void - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_end'; - - -ALTER FUNCTION public.testprs_end(internal) OWNER TO albert; - --- --- Name: testprs_getlexeme(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION testprs_getlexeme(internal, internal, internal) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_getlexeme'; - - -ALTER FUNCTION public.testprs_getlexeme(internal, internal, internal) OWNER TO albert; - --- --- Name: testprs_lextype(internal); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION testprs_lextype(internal) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_lextype'; - - -ALTER FUNCTION public.testprs_lextype(internal) OWNER TO albert; - --- --- Name: testprs_start(internal, integer); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION testprs_start(internal, integer) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_start'; - - -ALTER FUNCTION public.testprs_start(internal, integer) OWNER TO albert; - --- --- Name: trg_posts_tags__delete(); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION trg_posts_tags__delete() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - UPDATE tags SET post_count = post_count - 1 WHERE tags.id = OLD.tag_id; - RETURN OLD; - END; - $$; - - -ALTER FUNCTION public.trg_posts_tags__delete() OWNER TO albert; - --- --- Name: trg_posts_tags__insert(); Type: FUNCTION; Schema: public; Owner: albert --- - -CREATE FUNCTION trg_posts_tags__insert() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - UPDATE tags SET post_count = post_count + 1 WHERE tags.id = NEW.tag_id; - RETURN NEW; - END; - $$; - - -ALTER FUNCTION public.trg_posts_tags__insert() OWNER TO albert; - --- --- Name: ~~~; Type: OPERATOR; Schema: public; Owner: albert --- - -CREATE OPERATOR ~~~ ( - PROCEDURE = rlike, - LEFTARG = text, - RIGHTARG = text, - COMMUTATOR = ~~ -); - - -ALTER OPERATOR public.~~~ (text, text) OWNER TO albert; - --- --- Name: testparser; Type: TEXT SEARCH PARSER; Schema: public; Owner: --- - -CREATE TEXT SEARCH PARSER testparser ( - START = testprs_start, - GETTOKEN = testprs_getlexeme, - END = testprs_end, - HEADLINE = prsd_headline, - LEXTYPES = testprs_lextype ); - - --- --- Name: danbooru; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: albert --- - -CREATE TEXT SEARCH CONFIGURATION danbooru ( - PARSER = testparser ); - -ALTER TEXT SEARCH CONFIGURATION danbooru - ADD MAPPING FOR word WITH simple; - - -ALTER TEXT SEARCH CONFIGURATION public.danbooru OWNER TO albert; - -SET default_tablespace = ''; - -SET default_with_oids = false; - --- --- Name: advertisement_hits; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE advertisement_hits ( - id integer NOT NULL, - advertisement_id integer, - created_at timestamp without time zone, - updated_at timestamp without time zone, - ip_addr inet -); - - -ALTER TABLE public.advertisement_hits OWNER TO albert; - --- --- Name: advertisement_hits_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE advertisement_hits_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.advertisement_hits_id_seq OWNER TO albert; - --- --- Name: advertisement_hits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE advertisement_hits_id_seq OWNED BY advertisement_hits.id; - - --- --- Name: advertisements; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE advertisements ( - id integer NOT NULL, - referral_url character varying(1000) NOT NULL, - ad_type character varying(255) NOT NULL, - status character varying(255) NOT NULL, - hit_count integer DEFAULT 0 NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - is_work_safe boolean DEFAULT false NOT NULL, - file_name character varying(255), - created_at timestamp without time zone -); - - -ALTER TABLE public.advertisements OWNER TO albert; - --- --- Name: advertisements_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE advertisements_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.advertisements_id_seq OWNER TO albert; - --- --- Name: advertisements_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE advertisements_id_seq OWNED BY advertisements.id; - - --- --- Name: artist_urls; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE artist_urls ( - id integer NOT NULL, - artist_id integer NOT NULL, - url text NOT NULL, - normalized_url text NOT NULL -); - - -ALTER TABLE public.artist_urls OWNER TO albert; - --- --- Name: artist_urls_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE artist_urls_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.artist_urls_id_seq OWNER TO albert; - --- --- Name: artist_urls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE artist_urls_id_seq OWNED BY artist_urls.id; - - --- --- Name: artist_versions; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE artist_versions ( - id integer NOT NULL, - artist_id integer, - version integer DEFAULT 0 NOT NULL, - name text, - updater_id integer, - cached_urls text, - created_at timestamp without time zone, - updated_at timestamp without time zone, - is_active boolean DEFAULT true NOT NULL, - other_names_array text[], - group_name character varying(255), - is_banned boolean DEFAULT false NOT NULL -); - - -ALTER TABLE public.artist_versions OWNER TO albert; - --- --- Name: artist_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE artist_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.artist_versions_id_seq OWNER TO albert; - --- --- Name: artist_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE artist_versions_id_seq OWNED BY artist_versions.id; - - --- --- Name: artists; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE artists ( - id integer NOT NULL, - created_at timestamp without time zone DEFAULT now() NOT NULL, - name text NOT NULL, - updated_at timestamp without time zone DEFAULT now() NOT NULL, - updater_id integer, - version integer, - is_active boolean DEFAULT true NOT NULL, - other_names_array text[], - group_name character varying(255), - is_banned boolean DEFAULT false NOT NULL -); - - -ALTER TABLE public.artists OWNER TO albert; - --- --- Name: artists_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE artists_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.artists_id_seq OWNER TO albert; - --- --- Name: artists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE artists_id_seq OWNED BY artists.id; - - --- --- Name: banned_ips; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE banned_ips ( - id integer NOT NULL, - creator_id integer NOT NULL, - ip_addr inet NOT NULL, - reason text, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - -ALTER TABLE public.banned_ips OWNER TO albert; - --- --- Name: banned_ips_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE banned_ips_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.banned_ips_id_seq OWNER TO albert; - --- --- Name: banned_ips_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE banned_ips_id_seq OWNED BY banned_ips.id; - - --- --- Name: bans; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE bans ( - id integer NOT NULL, - user_id integer NOT NULL, - reason text NOT NULL, - expires_at timestamp without time zone NOT NULL, - banned_by integer NOT NULL, - old_level integer -); - - -ALTER TABLE public.bans OWNER TO albert; - --- --- Name: bans_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE bans_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.bans_id_seq OWNER TO albert; - --- --- Name: bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE bans_id_seq OWNED BY bans.id; - - --- --- Name: comment_votes; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE comment_votes ( - id integer NOT NULL, - comment_id integer NOT NULL, - user_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - -ALTER TABLE public.comment_votes OWNER TO albert; - --- --- Name: comment_votes_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE comment_votes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.comment_votes_id_seq OWNER TO albert; - --- --- Name: comment_votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE comment_votes_id_seq OWNED BY comment_votes.id; - - --- --- Name: comments; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE comments ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - post_id integer NOT NULL, - user_id integer, - body text NOT NULL, - ip_addr inet NOT NULL, - text_search_index tsvector, - score integer DEFAULT 0 NOT NULL -); - - -ALTER TABLE public.comments OWNER TO albert; - --- --- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE comments_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.comments_id_seq OWNER TO albert; - --- --- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE comments_id_seq OWNED BY comments.id; - - --- --- Name: dmails; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE dmails ( - id integer NOT NULL, - from_id integer NOT NULL, - to_id integer NOT NULL, - title text NOT NULL, - body text NOT NULL, - created_at timestamp without time zone NOT NULL, - has_seen boolean DEFAULT false NOT NULL, - parent_id integer -); - - -ALTER TABLE public.dmails OWNER TO albert; - --- --- Name: dmails_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE dmails_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.dmails_id_seq OWNER TO albert; - --- --- Name: dmails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE dmails_id_seq OWNED BY dmails.id; - - --- --- Name: tag_subscriptions; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE tag_subscriptions ( - id integer NOT NULL, - user_id integer NOT NULL, - tag_query text NOT NULL, - cached_post_ids text DEFAULT ''::text NOT NULL, - name character varying(255) DEFAULT 'General'::character varying NOT NULL, - is_visible_on_profile boolean DEFAULT true NOT NULL -); - - -ALTER TABLE public.tag_subscriptions OWNER TO albert; - --- --- Name: favorite_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE favorite_tags_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.favorite_tags_id_seq OWNER TO albert; - --- --- Name: favorite_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE favorite_tags_id_seq OWNED BY tag_subscriptions.id; - - --- --- Name: favorites; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE favorites ( - id integer NOT NULL, - post_id integer NOT NULL, - user_id integer NOT NULL, - created_at timestamp without time zone DEFAULT now() NOT NULL -); - - -ALTER TABLE public.favorites OWNER TO albert; - --- --- Name: favorites_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE favorites_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.favorites_id_seq OWNER TO albert; - --- --- Name: favorites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE favorites_id_seq OWNED BY favorites.id; - - --- --- Name: flagged_post_details; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE flagged_post_details ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - post_id integer NOT NULL, - reason text NOT NULL, - user_id integer NOT NULL, - is_resolved boolean NOT NULL -); - - -ALTER TABLE public.flagged_post_details OWNER TO albert; - --- --- Name: flagged_post_details_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE flagged_post_details_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.flagged_post_details_id_seq OWNER TO albert; - --- --- Name: flagged_post_details_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE flagged_post_details_id_seq OWNED BY flagged_post_details.id; - - --- --- Name: forum_posts; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE forum_posts ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - parent_id integer, - creator_id integer, - body text NOT NULL, - response_count integer DEFAULT 0 NOT NULL, - title text NOT NULL, - last_updated_by integer, - is_sticky boolean DEFAULT false NOT NULL, - is_locked boolean DEFAULT false NOT NULL, - text_search_index tsvector -); - - -ALTER TABLE public.forum_posts OWNER TO albert; - --- --- Name: forum_posts_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE forum_posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.forum_posts_id_seq OWNER TO albert; - --- --- Name: forum_posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE forum_posts_id_seq OWNED BY forum_posts.id; - - --- --- Name: job_tasks; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE job_tasks ( - id integer NOT NULL, - task_type character varying(255) NOT NULL, - status character varying(255) NOT NULL, - status_message text, - created_at timestamp without time zone, - updated_at timestamp without time zone, - data_as_json text DEFAULT '{}'::text NOT NULL, - repeat_count integer DEFAULT 0 NOT NULL -); - - -ALTER TABLE public.job_tasks OWNER TO albert; - --- --- Name: job_tasks_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE job_tasks_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.job_tasks_id_seq OWNER TO albert; - --- --- Name: job_tasks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE job_tasks_id_seq OWNED BY job_tasks.id; - - --- --- Name: mod_actions; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE mod_actions ( - id integer NOT NULL, - user_id integer, - description text, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - -ALTER TABLE public.mod_actions OWNER TO albert; - --- --- Name: mod_actions_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE mod_actions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.mod_actions_id_seq OWNER TO albert; - --- --- Name: mod_actions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE mod_actions_id_seq OWNED BY mod_actions.id; - - --- --- Name: mod_queue_posts; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE mod_queue_posts ( - id integer NOT NULL, - user_id integer NOT NULL, - post_id integer NOT NULL -); - - -ALTER TABLE public.mod_queue_posts OWNER TO albert; - --- --- Name: mod_queue_posts_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE mod_queue_posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.mod_queue_posts_id_seq OWNER TO albert; - --- --- Name: mod_queue_posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE mod_queue_posts_id_seq OWNED BY mod_queue_posts.id; - - --- --- Name: note_versions; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE note_versions ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - x integer NOT NULL, - y integer NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - body text NOT NULL, - version integer NOT NULL, - ip_addr inet NOT NULL, - is_active boolean DEFAULT true NOT NULL, - note_id integer NOT NULL, - post_id integer NOT NULL, - user_id integer, - text_search_index tsvector -); - - -ALTER TABLE public.note_versions OWNER TO albert; - --- --- Name: note_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE note_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.note_versions_id_seq OWNER TO albert; - --- --- Name: note_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE note_versions_id_seq OWNED BY note_versions.id; - - --- --- Name: notes; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE notes ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - user_id integer, - x integer NOT NULL, - y integer NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - ip_addr inet NOT NULL, - version integer DEFAULT 1 NOT NULL, - is_active boolean DEFAULT true NOT NULL, - post_id integer NOT NULL, - body text NOT NULL, - text_search_index tsvector -); - - -ALTER TABLE public.notes OWNER TO albert; - --- --- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE notes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.notes_id_seq OWNER TO albert; - --- --- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE notes_id_seq OWNED BY notes.id; - - --- --- Name: pixiv_proxies; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE pixiv_proxies ( - id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - -ALTER TABLE public.pixiv_proxies OWNER TO albert; - --- --- Name: pixiv_proxies_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE pixiv_proxies_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.pixiv_proxies_id_seq OWNER TO albert; - --- --- Name: pixiv_proxies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE pixiv_proxies_id_seq OWNED BY pixiv_proxies.id; - - --- --- Name: pool_updates; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE pool_updates ( - id integer NOT NULL, - pool_id integer NOT NULL, - post_ids text DEFAULT ''::text NOT NULL, - user_id integer, - ip_addr inet, - created_at timestamp without time zone DEFAULT now(), - updated_at timestamp without time zone DEFAULT now() -); - - -ALTER TABLE public.pool_updates OWNER TO albert; - --- --- Name: pool_updates_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE pool_updates_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.pool_updates_id_seq OWNER TO albert; - --- --- Name: pool_updates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE pool_updates_id_seq OWNED BY pool_updates.id; - - --- --- Name: pools; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE pools ( - id integer NOT NULL, - name text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - user_id integer NOT NULL, - is_public boolean DEFAULT false NOT NULL, - post_count integer DEFAULT 0 NOT NULL, - description text DEFAULT ''::text NOT NULL, - is_active boolean DEFAULT true NOT NULL -); - - -ALTER TABLE public.pools OWNER TO albert; - --- --- Name: pools_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE pools_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.pools_id_seq OWNER TO albert; - --- --- Name: pools_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE pools_id_seq OWNED BY pools.id; - - --- --- Name: pools_posts; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE pools_posts ( - id integer NOT NULL, - sequence integer DEFAULT 0 NOT NULL, - pool_id integer NOT NULL, - post_id integer NOT NULL, - next_post_id integer, - prev_post_id integer -); - - -ALTER TABLE public.pools_posts OWNER TO albert; - --- --- Name: pools_posts_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE pools_posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.pools_posts_id_seq OWNER TO albert; - --- --- Name: pools_posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE pools_posts_id_seq OWNED BY pools_posts.id; - - --- --- Name: post_appeals; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE post_appeals ( - id integer NOT NULL, - post_id integer, - user_id integer, - reason character varying(255), - ip_addr inet, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - -ALTER TABLE public.post_appeals OWNER TO albert; - --- --- Name: post_appeals_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE post_appeals_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.post_appeals_id_seq OWNER TO albert; - --- --- Name: post_appeals_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE post_appeals_id_seq OWNED BY post_appeals.id; - - --- --- Name: posts; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE posts ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - user_id integer, - score integer DEFAULT 0 NOT NULL, - source text NOT NULL, - md5 text NOT NULL, - last_commented_at timestamp without time zone, - rating character(1) DEFAULT 'q'::bpchar NOT NULL, - width integer, - height integer, - ip_addr inet NOT NULL, - cached_tags text DEFAULT ''::text NOT NULL, - is_note_locked boolean DEFAULT false NOT NULL, - fav_count integer DEFAULT 0 NOT NULL, - file_ext text DEFAULT ''::text NOT NULL, - last_noted_at timestamp without time zone, - is_rating_locked boolean DEFAULT false NOT NULL, - parent_id integer, - has_children boolean DEFAULT false NOT NULL, - status post_status DEFAULT 'active'::post_status NOT NULL, - sample_width integer, - sample_height integer, - change_seq integer, - approver_id integer, - tags_index tsvector, - general_tag_count integer DEFAULT 0 NOT NULL, - artist_tag_count integer DEFAULT 0 NOT NULL, - character_tag_count integer DEFAULT 0 NOT NULL, - copyright_tag_count integer DEFAULT 0 NOT NULL, - file_size integer, - is_status_locked boolean DEFAULT false NOT NULL -); - - -ALTER TABLE public.posts OWNER TO albert; - --- --- Name: post_change_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE post_change_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.post_change_seq OWNER TO albert; - --- --- Name: post_change_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE post_change_seq OWNED BY posts.change_seq; - - --- --- Name: post_tag_histories; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE post_tag_histories ( - id integer NOT NULL, - post_id integer NOT NULL, - tags text NOT NULL, - user_id integer, - ip_addr inet NOT NULL, - created_at timestamp without time zone NOT NULL, - rating character(1), - parent_id integer, - source text -); - - -ALTER TABLE public.post_tag_histories OWNER TO albert; - --- --- Name: post_tag_histories_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE post_tag_histories_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.post_tag_histories_id_seq OWNER TO albert; - --- --- Name: post_tag_histories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE post_tag_histories_id_seq OWNED BY post_tag_histories.id; - - --- --- Name: post_votes; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE post_votes ( - id integer NOT NULL, - post_id integer NOT NULL, - user_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - score integer DEFAULT 0 NOT NULL -); - - -ALTER TABLE public.post_votes OWNER TO albert; - --- --- Name: post_votes_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE post_votes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.post_votes_id_seq OWNER TO albert; - --- --- Name: post_votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE post_votes_id_seq OWNED BY post_votes.id; - - --- --- Name: posts_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.posts_id_seq OWNER TO albert; - --- --- Name: posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE posts_id_seq OWNED BY posts.id; - - --- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE schema_migrations ( - version character varying(255) NOT NULL -); - - -ALTER TABLE public.schema_migrations OWNER TO albert; - --- --- Name: server_keys; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE server_keys ( - id integer NOT NULL, - name character varying(255) NOT NULL, - value text -); - - -ALTER TABLE public.server_keys OWNER TO albert; - --- --- Name: server_keys_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE server_keys_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.server_keys_id_seq OWNER TO albert; - --- --- Name: server_keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE server_keys_id_seq OWNED BY server_keys.id; - - --- --- Name: table_data; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE table_data ( - name text NOT NULL, - row_count integer NOT NULL -); - - -ALTER TABLE public.table_data OWNER TO albert; - --- --- Name: tag_aliases; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE tag_aliases ( - id integer NOT NULL, - name text NOT NULL, - alias_id integer NOT NULL, - is_pending boolean DEFAULT false NOT NULL, - reason text DEFAULT ''::text NOT NULL, - creator_id integer -); - - -ALTER TABLE public.tag_aliases OWNER TO albert; - --- --- Name: tag_aliases_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE tag_aliases_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.tag_aliases_id_seq OWNER TO albert; - --- --- Name: tag_aliases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE tag_aliases_id_seq OWNED BY tag_aliases.id; - - --- --- Name: tag_implications; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE tag_implications ( - id integer NOT NULL, - consequent_id integer NOT NULL, - predicate_id integer NOT NULL, - is_pending boolean DEFAULT false NOT NULL, - reason text DEFAULT ''::text NOT NULL, - creator_id integer -); - - -ALTER TABLE public.tag_implications OWNER TO albert; - --- --- Name: tag_implications_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE tag_implications_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.tag_implications_id_seq OWNER TO albert; - --- --- Name: tag_implications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE tag_implications_id_seq OWNED BY tag_implications.id; - - --- --- Name: tags; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE tags ( - id integer NOT NULL, - name text NOT NULL, - post_count integer DEFAULT 0 NOT NULL, - cached_related text DEFAULT '[]'::text NOT NULL, - cached_related_expires_on timestamp without time zone DEFAULT now() NOT NULL, - tag_type smallint DEFAULT 0 NOT NULL, - is_ambiguous boolean DEFAULT false NOT NULL -); - - -ALTER TABLE public.tags OWNER TO albert; - --- --- Name: tags_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE tags_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.tags_id_seq OWNER TO albert; - --- --- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE tags_id_seq OWNED BY tags.id; - - --- --- Name: test_janitors; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE test_janitors ( - id integer NOT NULL, - user_id integer NOT NULL, - test_promotion_date timestamp without time zone NOT NULL, - promotion_date timestamp without time zone, - original_level integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - -ALTER TABLE public.test_janitors OWNER TO albert; - --- --- Name: test_janitors_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE test_janitors_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.test_janitors_id_seq OWNER TO albert; - --- --- Name: test_janitors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE test_janitors_id_seq OWNED BY test_janitors.id; - - --- --- Name: user_blacklisted_tags; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE user_blacklisted_tags ( - id integer NOT NULL, - user_id integer NOT NULL, - tags text NOT NULL -); - - -ALTER TABLE public.user_blacklisted_tags OWNER TO albert; - --- --- Name: user_blacklisted_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE user_blacklisted_tags_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.user_blacklisted_tags_id_seq OWNER TO albert; - --- --- Name: user_blacklisted_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE user_blacklisted_tags_id_seq OWNED BY user_blacklisted_tags.id; - - --- --- Name: user_records; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE user_records ( - id integer NOT NULL, - user_id integer NOT NULL, - reported_by integer NOT NULL, - created_at timestamp without time zone DEFAULT now() NOT NULL, - body text NOT NULL, - score integer DEFAULT 0 NOT NULL -); - - -ALTER TABLE public.user_records OWNER TO albert; - --- --- Name: user_records_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE user_records_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.user_records_id_seq OWNER TO albert; - --- --- Name: user_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE user_records_id_seq OWNED BY user_records.id; - - --- --- Name: users; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE users ( - id integer NOT NULL, - name text NOT NULL, - password_hash text NOT NULL, - level integer DEFAULT 0 NOT NULL, - email text DEFAULT ''::text NOT NULL, - recent_tags text DEFAULT ''::text NOT NULL, - invite_count integer DEFAULT 0 NOT NULL, - always_resize_images boolean DEFAULT false NOT NULL, - invited_by integer, - created_at timestamp without time zone DEFAULT now() NOT NULL, - last_logged_in_at timestamp without time zone DEFAULT now() NOT NULL, - last_forum_topic_read_at timestamp without time zone DEFAULT '1960-01-01 00:00:00'::timestamp without time zone NOT NULL, - has_mail boolean DEFAULT false NOT NULL, - receive_dmails boolean DEFAULT false NOT NULL, - show_samples boolean, - upload_limit integer, - uploaded_tags text DEFAULT ''::text NOT NULL, - comment_threshold integer DEFAULT 0 NOT NULL -); - - -ALTER TABLE public.users OWNER TO albert; - --- --- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE users_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.users_id_seq OWNER TO albert; - --- --- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE users_id_seq OWNED BY users.id; - - --- --- Name: wiki_page_versions; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE wiki_page_versions ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - version integer DEFAULT 1 NOT NULL, - title text NOT NULL, - body text NOT NULL, - user_id integer, - ip_addr inet NOT NULL, - wiki_page_id integer NOT NULL, - is_locked boolean DEFAULT false NOT NULL, - text_search_index tsvector -); - - -ALTER TABLE public.wiki_page_versions OWNER TO albert; - --- --- Name: wiki_page_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE wiki_page_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.wiki_page_versions_id_seq OWNER TO albert; - --- --- Name: wiki_page_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE wiki_page_versions_id_seq OWNED BY wiki_page_versions.id; - - --- --- Name: wiki_pages; Type: TABLE; Schema: public; Owner: albert; Tablespace: --- - -CREATE TABLE wiki_pages ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - version integer DEFAULT 1 NOT NULL, - title text NOT NULL, - body text NOT NULL, - user_id integer, - ip_addr inet NOT NULL, - is_locked boolean DEFAULT false NOT NULL, - text_search_index tsvector -); - - -ALTER TABLE public.wiki_pages OWNER TO albert; - --- --- Name: wiki_pages_id_seq; Type: SEQUENCE; Schema: public; Owner: albert --- - -CREATE SEQUENCE wiki_pages_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - -ALTER TABLE public.wiki_pages_id_seq OWNER TO albert; - --- --- Name: wiki_pages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: albert --- - -ALTER SEQUENCE wiki_pages_id_seq OWNED BY wiki_pages.id; - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE advertisement_hits ALTER COLUMN id SET DEFAULT nextval('advertisement_hits_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE advertisements ALTER COLUMN id SET DEFAULT nextval('advertisements_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE artist_urls ALTER COLUMN id SET DEFAULT nextval('artist_urls_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE artist_versions ALTER COLUMN id SET DEFAULT nextval('artist_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE artists ALTER COLUMN id SET DEFAULT nextval('artists_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE banned_ips ALTER COLUMN id SET DEFAULT nextval('banned_ips_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE bans ALTER COLUMN id SET DEFAULT nextval('bans_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE comment_votes ALTER COLUMN id SET DEFAULT nextval('comment_votes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE comments ALTER COLUMN id SET DEFAULT nextval('comments_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE dmails ALTER COLUMN id SET DEFAULT nextval('dmails_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE favorites ALTER COLUMN id SET DEFAULT nextval('favorites_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE flagged_post_details ALTER COLUMN id SET DEFAULT nextval('flagged_post_details_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE forum_posts ALTER COLUMN id SET DEFAULT nextval('forum_posts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE job_tasks ALTER COLUMN id SET DEFAULT nextval('job_tasks_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE mod_actions ALTER COLUMN id SET DEFAULT nextval('mod_actions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE mod_queue_posts ALTER COLUMN id SET DEFAULT nextval('mod_queue_posts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE note_versions ALTER COLUMN id SET DEFAULT nextval('note_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE pixiv_proxies ALTER COLUMN id SET DEFAULT nextval('pixiv_proxies_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE pool_updates ALTER COLUMN id SET DEFAULT nextval('pool_updates_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE pools ALTER COLUMN id SET DEFAULT nextval('pools_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE pools_posts ALTER COLUMN id SET DEFAULT nextval('pools_posts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE post_appeals ALTER COLUMN id SET DEFAULT nextval('post_appeals_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE post_tag_histories ALTER COLUMN id SET DEFAULT nextval('post_tag_histories_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE post_votes ALTER COLUMN id SET DEFAULT nextval('post_votes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE posts ALTER COLUMN id SET DEFAULT nextval('posts_id_seq'::regclass); - - --- --- Name: change_seq; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE posts ALTER COLUMN change_seq SET DEFAULT nextval('post_change_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE server_keys ALTER COLUMN id SET DEFAULT nextval('server_keys_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE tag_aliases ALTER COLUMN id SET DEFAULT nextval('tag_aliases_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE tag_implications ALTER COLUMN id SET DEFAULT nextval('tag_implications_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE tag_subscriptions ALTER COLUMN id SET DEFAULT nextval('favorite_tags_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE tags ALTER COLUMN id SET DEFAULT nextval('tags_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE test_janitors ALTER COLUMN id SET DEFAULT nextval('test_janitors_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE user_blacklisted_tags ALTER COLUMN id SET DEFAULT nextval('user_blacklisted_tags_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE user_records ALTER COLUMN id SET DEFAULT nextval('user_records_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE wiki_page_versions ALTER COLUMN id SET DEFAULT nextval('wiki_page_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: albert --- - -ALTER TABLE wiki_pages ALTER COLUMN id SET DEFAULT nextval('wiki_pages_id_seq'::regclass); - - --- --- Name: advertisement_hits_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY advertisement_hits - ADD CONSTRAINT advertisement_hits_pkey PRIMARY KEY (id); - - --- --- Name: advertisements_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY advertisements - ADD CONSTRAINT advertisements_pkey PRIMARY KEY (id); - - --- --- Name: artist_urls_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY artist_urls - ADD CONSTRAINT artist_urls_pkey PRIMARY KEY (id); - - --- --- Name: artist_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY artist_versions - ADD CONSTRAINT artist_versions_pkey PRIMARY KEY (id); - - --- --- Name: artists_name_uniq; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY artists - ADD CONSTRAINT artists_name_uniq UNIQUE (name); - - --- --- Name: artists_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY artists - ADD CONSTRAINT artists_pkey PRIMARY KEY (id); - - --- --- Name: banned_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY banned_ips - ADD CONSTRAINT banned_ips_pkey PRIMARY KEY (id); - - --- --- Name: bans_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY bans - ADD CONSTRAINT bans_pkey PRIMARY KEY (id); - - --- --- Name: comment_votes_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY comment_votes - ADD CONSTRAINT comment_votes_pkey PRIMARY KEY (id); - - --- --- Name: comments_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY comments - ADD CONSTRAINT comments_pkey PRIMARY KEY (id); - - --- --- Name: dmails_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY dmails - ADD CONSTRAINT dmails_pkey PRIMARY KEY (id); - - --- --- Name: favorite_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY tag_subscriptions - ADD CONSTRAINT favorite_tags_pkey PRIMARY KEY (id); - - --- --- Name: favorites_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY favorites - ADD CONSTRAINT favorites_pkey PRIMARY KEY (id); - - --- --- Name: flagged_post_details_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY flagged_post_details - ADD CONSTRAINT flagged_post_details_pkey PRIMARY KEY (id); - - --- --- Name: forum_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY forum_posts - ADD CONSTRAINT forum_posts_pkey PRIMARY KEY (id); - - --- --- Name: job_tasks_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY job_tasks - ADD CONSTRAINT job_tasks_pkey PRIMARY KEY (id); - - --- --- Name: mod_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY mod_actions - ADD CONSTRAINT mod_actions_pkey PRIMARY KEY (id); - - --- --- Name: mod_queue_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY mod_queue_posts - ADD CONSTRAINT mod_queue_posts_pkey PRIMARY KEY (id); - - --- --- Name: note_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY note_versions - ADD CONSTRAINT note_versions_pkey PRIMARY KEY (id); - - --- --- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY notes - ADD CONSTRAINT notes_pkey PRIMARY KEY (id); - - --- --- Name: pixiv_proxies_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY pixiv_proxies - ADD CONSTRAINT pixiv_proxies_pkey PRIMARY KEY (id); - - --- --- Name: pool_updates_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY pool_updates - ADD CONSTRAINT pool_updates_pkey PRIMARY KEY (id); - - --- --- Name: pools_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY pools - ADD CONSTRAINT pools_pkey PRIMARY KEY (id); - - --- --- Name: pools_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY pools_posts - ADD CONSTRAINT pools_posts_pkey PRIMARY KEY (id); - - --- --- Name: post_appeals_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY post_appeals - ADD CONSTRAINT post_appeals_pkey PRIMARY KEY (id); - - --- --- Name: post_tag_histories_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY post_tag_histories - ADD CONSTRAINT post_tag_histories_pkey PRIMARY KEY (id); - - --- --- Name: post_votes_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY post_votes - ADD CONSTRAINT post_votes_pkey PRIMARY KEY (id); - - --- --- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY posts - ADD CONSTRAINT posts_pkey PRIMARY KEY (id); - - --- --- Name: server_keys_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY server_keys - ADD CONSTRAINT server_keys_pkey PRIMARY KEY (id); - - --- --- Name: table_data_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY table_data - ADD CONSTRAINT table_data_pkey PRIMARY KEY (name); - - --- --- Name: tag_aliases_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY tag_aliases - ADD CONSTRAINT tag_aliases_pkey PRIMARY KEY (id); - - --- --- Name: tag_implications_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY tag_implications - ADD CONSTRAINT tag_implications_pkey PRIMARY KEY (id); - - --- --- Name: tags_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY tags - ADD CONSTRAINT tags_pkey PRIMARY KEY (id); - - --- --- Name: test_janitors_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY test_janitors - ADD CONSTRAINT test_janitors_pkey PRIMARY KEY (id); - - --- --- Name: user_blacklisted_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY user_blacklisted_tags - ADD CONSTRAINT user_blacklisted_tags_pkey PRIMARY KEY (id); - - --- --- Name: user_records_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY user_records - ADD CONSTRAINT user_records_pkey PRIMARY KEY (id); - - --- --- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- Name: wiki_page_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY wiki_page_versions - ADD CONSTRAINT wiki_page_versions_pkey PRIMARY KEY (id); - - --- --- Name: wiki_pages_pkey; Type: CONSTRAINT; Schema: public; Owner: albert; Tablespace: --- - -ALTER TABLE ONLY wiki_pages - ADD CONSTRAINT wiki_pages_pkey PRIMARY KEY (id); - - --- --- Name: comments_text_search_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX comments_text_search_idx ON notes USING gin (text_search_index); - - --- --- Name: forum_posts__parent_id_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX forum_posts__parent_id_idx ON forum_posts USING btree (parent_id) WHERE (parent_id IS NULL); - - --- --- Name: forum_posts_search_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX forum_posts_search_idx ON forum_posts USING gin (text_search_index); - - --- --- Name: idx_comments__post; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_comments__post ON comments USING btree (post_id); - - --- --- Name: idx_favorites__post; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_favorites__post ON favorites USING btree (post_id); - - --- --- Name: idx_favorites__user; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_favorites__user ON favorites USING btree (user_id); - - --- --- Name: idx_note_versions__post; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_note_versions__post ON note_versions USING btree (post_id); - - --- --- Name: idx_notes__note; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_notes__note ON note_versions USING btree (note_id); - - --- --- Name: idx_notes__post; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_notes__post ON notes USING btree (post_id); - - --- --- Name: idx_post_tag_histories__post; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_post_tag_histories__post ON post_tag_histories USING btree (post_id); - - --- --- Name: idx_posts__created_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_posts__created_at ON posts USING btree (created_at); - - --- --- Name: idx_posts__last_commented_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_posts__last_commented_at ON posts USING btree (last_commented_at) WHERE (last_commented_at IS NOT NULL); - - --- --- Name: idx_posts__last_noted_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_posts__last_noted_at ON posts USING btree (last_noted_at) WHERE (last_noted_at IS NOT NULL); - - --- --- Name: idx_posts__md5; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE UNIQUE INDEX idx_posts__md5 ON posts USING btree (md5); - - --- --- Name: idx_posts__users; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_posts__users ON posts USING btree (user_id) WHERE (user_id IS NOT NULL); - - --- --- Name: idx_posts_parent_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_posts_parent_id ON posts USING btree (parent_id) WHERE (parent_id IS NOT NULL); - - --- --- Name: idx_tag_aliases__name; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE UNIQUE INDEX idx_tag_aliases__name ON tag_aliases USING btree (name); - - --- --- Name: idx_tag_implications__child; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_tag_implications__child ON tag_implications USING btree (predicate_id); - - --- --- Name: idx_tag_implications__parent; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_tag_implications__parent ON tag_implications USING btree (consequent_id); - - --- --- Name: idx_tags__name; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE UNIQUE INDEX idx_tags__name ON tags USING btree (name); - - --- --- Name: idx_tags__post_count; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_tags__post_count ON tags USING btree (post_count); - - --- --- Name: idx_users__name; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_users__name ON users USING btree (lower(name)); - - --- --- Name: idx_wiki_page_versions__wiki_page; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_wiki_page_versions__wiki_page ON wiki_page_versions USING btree (wiki_page_id); - - --- --- Name: idx_wiki_pages__title; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE UNIQUE INDEX idx_wiki_pages__title ON wiki_pages USING btree (title); - - --- --- Name: idx_wiki_pages__updated_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX idx_wiki_pages__updated_at ON wiki_pages USING btree (updated_at); - - --- --- Name: index_advertisement_hits_on_advertisement_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_advertisement_hits_on_advertisement_id ON advertisement_hits USING btree (advertisement_id); - - --- --- Name: index_advertisement_hits_on_created_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_advertisement_hits_on_created_at ON advertisement_hits USING btree (created_at); - - --- --- Name: index_artist_urls_on_artist_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_artist_urls_on_artist_id ON artist_urls USING btree (artist_id); - - --- --- Name: index_artist_urls_on_normalized_url; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_artist_urls_on_normalized_url ON artist_urls USING btree (normalized_url); - - --- --- Name: index_artist_urls_on_url; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_artist_urls_on_url ON artist_urls USING btree (url); - - --- --- Name: index_artist_versions_on_artist_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_artist_versions_on_artist_id ON artist_versions USING btree (artist_id); - - --- --- Name: index_artist_versions_on_updater_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_artist_versions_on_updater_id ON artist_versions USING btree (updater_id); - - --- --- Name: index_artists_on_other_names_array; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_artists_on_other_names_array ON artists USING btree (other_names_array); - - --- --- Name: index_banned_ips_on_ip_addr; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_banned_ips_on_ip_addr ON banned_ips USING btree (ip_addr); - - --- --- Name: index_bans_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_bans_on_user_id ON bans USING btree (user_id); - - --- --- Name: index_comment_votes_on_comment_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_comment_votes_on_comment_id ON comment_votes USING btree (comment_id); - - --- --- Name: index_comment_votes_on_created_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_comment_votes_on_created_at ON comment_votes USING btree (created_at); - - --- --- Name: index_comment_votes_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_comment_votes_on_user_id ON comment_votes USING btree (user_id); - - --- --- Name: index_comments_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_comments_on_user_id ON comments USING btree (user_id); - - --- --- Name: index_dmails_on_from_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_dmails_on_from_id ON dmails USING btree (from_id); - - --- --- Name: index_dmails_on_parent_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_dmails_on_parent_id ON dmails USING btree (parent_id); - - --- --- Name: index_dmails_on_to_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_dmails_on_to_id ON dmails USING btree (to_id); - - --- --- Name: index_flagged_post_details_on_post_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_flagged_post_details_on_post_id ON flagged_post_details USING btree (post_id); - - --- --- Name: index_forum_posts_on_creator_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_forum_posts_on_creator_id ON forum_posts USING btree (creator_id); - - --- --- Name: index_forum_posts_on_updated_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_forum_posts_on_updated_at ON forum_posts USING btree (updated_at); - - --- --- Name: index_mod_actions_on_created_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_mod_actions_on_created_at ON mod_actions USING btree (created_at); - - --- --- Name: index_mod_actions_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_mod_actions_on_user_id ON mod_actions USING btree (user_id); - - --- --- Name: index_note_versions_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_note_versions_on_user_id ON note_versions USING btree (user_id); - - --- --- Name: index_pool_updates_on_pool_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_pool_updates_on_pool_id ON pool_updates USING btree (pool_id); - - --- --- Name: index_pool_updates_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_pool_updates_on_user_id ON pool_updates USING btree (user_id); - - --- --- Name: index_post_appeals_on_created_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_appeals_on_created_at ON post_appeals USING btree (created_at); - - --- --- Name: index_post_appeals_on_ip_addr; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_appeals_on_ip_addr ON post_appeals USING btree (ip_addr); - - --- --- Name: index_post_appeals_on_post_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_appeals_on_post_id ON post_appeals USING btree (post_id); - - --- --- Name: index_post_appeals_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_appeals_on_user_id ON post_appeals USING btree (user_id); - - --- --- Name: index_post_tag_histories_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_tag_histories_on_user_id ON post_tag_histories USING btree (user_id); - - --- --- Name: index_post_votes_on_created_at; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_votes_on_created_at ON post_votes USING btree (created_at); - - --- --- Name: index_post_votes_on_post_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_votes_on_post_id ON post_votes USING btree (post_id); - - --- --- Name: index_post_votes_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_post_votes_on_user_id ON post_votes USING btree (user_id); - - --- --- Name: index_posts_on_approver_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_posts_on_approver_id ON posts USING btree (approver_id); - - --- --- Name: index_posts_on_change_seq; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_posts_on_change_seq ON posts USING btree (change_seq); - - --- --- Name: index_posts_on_file_size; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_posts_on_file_size ON posts USING btree (file_size); - - --- --- Name: index_posts_on_height; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_posts_on_height ON posts USING btree (height); - - --- --- Name: index_posts_on_source; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_posts_on_source ON posts USING btree (source); - - --- --- Name: index_posts_on_tags_index; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_posts_on_tags_index ON posts USING gin (tags_index); - - --- --- Name: index_posts_on_width; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_posts_on_width ON posts USING btree (width); - - --- --- Name: index_server_keys_on_name; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE UNIQUE INDEX index_server_keys_on_name ON server_keys USING btree (name); - - --- --- Name: index_tag_subscriptions_on_name; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_tag_subscriptions_on_name ON tag_subscriptions USING btree (name); - - --- --- Name: index_tag_subscriptions_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_tag_subscriptions_on_user_id ON tag_subscriptions USING btree (user_id); - - --- --- Name: index_test_janitors_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_test_janitors_on_user_id ON test_janitors USING btree (user_id); - - --- --- Name: index_user_blacklisted_tags_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_user_blacklisted_tags_on_user_id ON user_blacklisted_tags USING btree (user_id); - - --- --- Name: index_wiki_page_versions_on_user_id; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX index_wiki_page_versions_on_user_id ON wiki_page_versions USING btree (user_id); - - --- --- Name: notes_text_search_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX notes_text_search_idx ON notes USING gin (text_search_index); - - --- --- Name: pools_posts_pool_id_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX pools_posts_pool_id_idx ON pools_posts USING btree (pool_id); - - --- --- Name: pools_posts_post_id_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX pools_posts_post_id_idx ON pools_posts USING btree (post_id); - - --- --- Name: pools_user_id_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX pools_user_id_idx ON pools USING btree (user_id); - - --- --- Name: post_status_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX post_status_idx ON posts USING btree (status) WHERE (status < 'active'::post_status); - - --- --- Name: posts_mpixels; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX posts_mpixels ON posts USING btree (((((width * height))::numeric / 1000000.0))); - - --- --- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version); - - --- --- Name: wiki_pages_search_idx; Type: INDEX; Schema: public; Owner: albert; Tablespace: --- - -CREATE INDEX wiki_pages_search_idx ON wiki_pages USING gin (text_search_index); - - --- --- Name: pools_posts_delete_trg; Type: TRIGGER; Schema: public; Owner: albert --- - -CREATE TRIGGER pools_posts_delete_trg - BEFORE DELETE ON pools_posts - FOR EACH ROW - EXECUTE PROCEDURE pools_posts_delete_trg(); - - --- --- Name: pools_posts_insert_trg; Type: TRIGGER; Schema: public; Owner: albert --- - -CREATE TRIGGER pools_posts_insert_trg - BEFORE INSERT ON pools_posts - FOR EACH ROW - EXECUTE PROCEDURE pools_posts_insert_trg(); - - --- --- Name: trg_comment_search_update; Type: TRIGGER; Schema: public; Owner: albert --- - -CREATE TRIGGER trg_comment_search_update - BEFORE INSERT OR UPDATE ON comments - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('text_search_index', 'pg_catalog.english', 'body'); - - --- --- Name: trg_forum_post_search_update; Type: TRIGGER; Schema: public; Owner: albert --- - -CREATE TRIGGER trg_forum_post_search_update - BEFORE INSERT OR UPDATE ON forum_posts - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('text_search_index', 'pg_catalog.english', 'title', 'body'); - - --- --- Name: trg_note_search_update; Type: TRIGGER; Schema: public; Owner: albert --- - -CREATE TRIGGER trg_note_search_update - BEFORE INSERT OR UPDATE ON notes - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('text_search_index', 'pg_catalog.english', 'body'); - - --- --- Name: trg_posts_tags_index_update; Type: TRIGGER; Schema: public; Owner: albert --- - -CREATE TRIGGER trg_posts_tags_index_update - BEFORE INSERT OR UPDATE ON posts - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('tags_index', 'public.danbooru', 'cached_tags'); - - --- --- Name: trg_wiki_page_search_update; Type: TRIGGER; Schema: public; Owner: albert --- - -CREATE TRIGGER trg_wiki_page_search_update - BEFORE INSERT OR UPDATE ON wiki_pages - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('text_search_index', 'pg_catalog.english', 'title', 'body'); - - --- --- Name: artist_urls_artist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY artist_urls - ADD CONSTRAINT artist_urls_artist_id_fkey FOREIGN KEY (artist_id) REFERENCES artists(id) ON DELETE CASCADE; - - --- --- Name: artists_updater_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY artists - ADD CONSTRAINT artists_updater_id_fkey FOREIGN KEY (updater_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: bans_banned_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY bans - ADD CONSTRAINT bans_banned_by_fkey FOREIGN KEY (banned_by) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: bans_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY bans - ADD CONSTRAINT bans_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: comment_votes_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY comment_votes - ADD CONSTRAINT comment_votes_comment_id_fkey FOREIGN KEY (comment_id) REFERENCES comments(id) ON DELETE CASCADE; - - --- --- Name: comment_votes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY comment_votes - ADD CONSTRAINT comment_votes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: dmails_from_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY dmails - ADD CONSTRAINT dmails_from_id_fkey FOREIGN KEY (from_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: dmails_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY dmails - ADD CONSTRAINT dmails_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES dmails(id); - - --- --- Name: dmails_to_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY dmails - ADD CONSTRAINT dmails_to_id_fkey FOREIGN KEY (to_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: fk_comments__post; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY comments - ADD CONSTRAINT fk_comments__post FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: fk_comments__user; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY comments - ADD CONSTRAINT fk_comments__user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: fk_favorites__post; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY favorites - ADD CONSTRAINT fk_favorites__post FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: fk_favorites__user; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY favorites - ADD CONSTRAINT fk_favorites__user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: fk_note_versions__note; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY note_versions - ADD CONSTRAINT fk_note_versions__note FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; - - --- --- Name: fk_note_versions__post; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY note_versions - ADD CONSTRAINT fk_note_versions__post FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: fk_note_versions__user; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY note_versions - ADD CONSTRAINT fk_note_versions__user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: fk_notes__post; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY notes - ADD CONSTRAINT fk_notes__post FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: fk_notes__user; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY notes - ADD CONSTRAINT fk_notes__user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: fk_post_tag_histories__post; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY post_tag_histories - ADD CONSTRAINT fk_post_tag_histories__post FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: fk_posts__user; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY posts - ADD CONSTRAINT fk_posts__user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: fk_tag_aliases__alias; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY tag_aliases - ADD CONSTRAINT fk_tag_aliases__alias FOREIGN KEY (alias_id) REFERENCES tags(id) ON DELETE CASCADE; - - --- --- Name: fk_tag_implications__child; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY tag_implications - ADD CONSTRAINT fk_tag_implications__child FOREIGN KEY (predicate_id) REFERENCES tags(id) ON DELETE CASCADE; - - --- --- Name: fk_tag_implications__parent; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY tag_implications - ADD CONSTRAINT fk_tag_implications__parent FOREIGN KEY (consequent_id) REFERENCES tags(id) ON DELETE CASCADE; - - --- --- Name: fk_wiki_page_versions__user; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY wiki_page_versions - ADD CONSTRAINT fk_wiki_page_versions__user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: fk_wiki_page_versions__wiki_page; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY wiki_page_versions - ADD CONSTRAINT fk_wiki_page_versions__wiki_page FOREIGN KEY (wiki_page_id) REFERENCES wiki_pages(id) ON DELETE CASCADE; - - --- --- Name: fk_wiki_pages__user; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY wiki_pages - ADD CONSTRAINT fk_wiki_pages__user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: flagged_post_details_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY flagged_post_details - ADD CONSTRAINT flagged_post_details_post_id_fkey FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: flagged_post_details_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY flagged_post_details - ADD CONSTRAINT flagged_post_details_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: forum_posts_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY forum_posts - ADD CONSTRAINT forum_posts_creator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: forum_posts_last_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY forum_posts - ADD CONSTRAINT forum_posts_last_updated_by_fkey FOREIGN KEY (last_updated_by) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: forum_posts_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY forum_posts - ADD CONSTRAINT forum_posts_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES forum_posts(id) ON DELETE CASCADE; - - --- --- Name: mod_queue_posts_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY mod_queue_posts - ADD CONSTRAINT mod_queue_posts_post_id_fkey FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: mod_queue_posts_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY mod_queue_posts - ADD CONSTRAINT mod_queue_posts_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: pool_updates_pool_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY pool_updates - ADD CONSTRAINT pool_updates_pool_id_fkey FOREIGN KEY (pool_id) REFERENCES pools(id) ON DELETE CASCADE; - - --- --- Name: pools_posts_next_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY pools_posts - ADD CONSTRAINT pools_posts_next_post_id_fkey FOREIGN KEY (next_post_id) REFERENCES posts(id) ON DELETE SET NULL; - - --- --- Name: pools_posts_pool_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY pools_posts - ADD CONSTRAINT pools_posts_pool_id_fkey FOREIGN KEY (pool_id) REFERENCES pools(id) ON DELETE CASCADE; - - --- --- Name: pools_posts_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY pools_posts - ADD CONSTRAINT pools_posts_post_id_fkey FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: pools_posts_prev_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY pools_posts - ADD CONSTRAINT pools_posts_prev_post_id_fkey FOREIGN KEY (prev_post_id) REFERENCES posts(id) ON DELETE SET NULL; - - --- --- Name: pools_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY pools - ADD CONSTRAINT pools_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: post_tag_histories_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY post_tag_histories - ADD CONSTRAINT post_tag_histories_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: post_votes_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY post_votes - ADD CONSTRAINT post_votes_post_id_fkey FOREIGN KEY (post_id) REFERENCES posts(id) ON DELETE CASCADE; - - --- --- Name: post_votes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY post_votes - ADD CONSTRAINT post_votes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: posts_approver_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY posts - ADD CONSTRAINT posts_approver_id_fkey FOREIGN KEY (approver_id) REFERENCES users(id) ON DELETE SET NULL; - - --- --- Name: posts_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY posts - ADD CONSTRAINT posts_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES posts(id) ON DELETE SET NULL; - - --- --- Name: tag_aliases_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY tag_aliases - ADD CONSTRAINT tag_aliases_creator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: tag_implications_creator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY tag_implications - ADD CONSTRAINT tag_implications_creator_id_fkey FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: tag_subscriptions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY tag_subscriptions - ADD CONSTRAINT tag_subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: test_janitors_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY test_janitors - ADD CONSTRAINT test_janitors_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: user_blacklisted_tags_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY user_blacklisted_tags - ADD CONSTRAINT user_blacklisted_tags_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: user_records_reported_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY user_records - ADD CONSTRAINT user_records_reported_by_fkey FOREIGN KEY (reported_by) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: user_records_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: albert --- - -ALTER TABLE ONLY user_records - ADD CONSTRAINT user_records_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - - --- --- Name: public; Type: ACL; Schema: -; Owner: postgres --- - -REVOKE ALL ON SCHEMA public FROM PUBLIC; -REVOKE ALL ON SCHEMA public FROM postgres; -GRANT ALL ON SCHEMA public TO postgres; -GRANT ALL ON SCHEMA public TO PUBLIC; - - --- --- PostgreSQL database dump complete --- - diff --git a/db/development_structure.sql b/db/development_structure.sql deleted file mode 100644 index d24ddc67f..000000000 --- a/db/development_structure.sql +++ /dev/null @@ -1,5500 +0,0 @@ --- --- PostgreSQL database dump --- - -SET statement_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = off; -SET check_function_bodies = false; -SET client_min_messages = warning; -SET escape_string_warning = off; - --- --- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: - --- - -CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql; - - -SET search_path = public, pg_catalog; - --- --- Name: favorites_insert_trigger(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION favorites_insert_trigger() RETURNS trigger - LANGUAGE plpgsql - AS $$ - begin - if (NEW.user_id % 100 = 0) then - insert into favorites_0 values (NEW.*); - elsif (NEW.user_id % 100 = 1) then - insert into favorites_1 values (NEW.*); - - elsif (NEW.user_id % 100 = 2) then - insert into favorites_2 values (NEW.*); - - elsif (NEW.user_id % 100 = 3) then - insert into favorites_3 values (NEW.*); - - elsif (NEW.user_id % 100 = 4) then - insert into favorites_4 values (NEW.*); - - elsif (NEW.user_id % 100 = 5) then - insert into favorites_5 values (NEW.*); - - elsif (NEW.user_id % 100 = 6) then - insert into favorites_6 values (NEW.*); - - elsif (NEW.user_id % 100 = 7) then - insert into favorites_7 values (NEW.*); - - elsif (NEW.user_id % 100 = 8) then - insert into favorites_8 values (NEW.*); - - elsif (NEW.user_id % 100 = 9) then - insert into favorites_9 values (NEW.*); - - elsif (NEW.user_id % 100 = 10) then - insert into favorites_10 values (NEW.*); - - elsif (NEW.user_id % 100 = 11) then - insert into favorites_11 values (NEW.*); - - elsif (NEW.user_id % 100 = 12) then - insert into favorites_12 values (NEW.*); - - elsif (NEW.user_id % 100 = 13) then - insert into favorites_13 values (NEW.*); - - elsif (NEW.user_id % 100 = 14) then - insert into favorites_14 values (NEW.*); - - elsif (NEW.user_id % 100 = 15) then - insert into favorites_15 values (NEW.*); - - elsif (NEW.user_id % 100 = 16) then - insert into favorites_16 values (NEW.*); - - elsif (NEW.user_id % 100 = 17) then - insert into favorites_17 values (NEW.*); - - elsif (NEW.user_id % 100 = 18) then - insert into favorites_18 values (NEW.*); - - elsif (NEW.user_id % 100 = 19) then - insert into favorites_19 values (NEW.*); - - elsif (NEW.user_id % 100 = 20) then - insert into favorites_20 values (NEW.*); - - elsif (NEW.user_id % 100 = 21) then - insert into favorites_21 values (NEW.*); - - elsif (NEW.user_id % 100 = 22) then - insert into favorites_22 values (NEW.*); - - elsif (NEW.user_id % 100 = 23) then - insert into favorites_23 values (NEW.*); - - elsif (NEW.user_id % 100 = 24) then - insert into favorites_24 values (NEW.*); - - elsif (NEW.user_id % 100 = 25) then - insert into favorites_25 values (NEW.*); - - elsif (NEW.user_id % 100 = 26) then - insert into favorites_26 values (NEW.*); - - elsif (NEW.user_id % 100 = 27) then - insert into favorites_27 values (NEW.*); - - elsif (NEW.user_id % 100 = 28) then - insert into favorites_28 values (NEW.*); - - elsif (NEW.user_id % 100 = 29) then - insert into favorites_29 values (NEW.*); - - elsif (NEW.user_id % 100 = 30) then - insert into favorites_30 values (NEW.*); - - elsif (NEW.user_id % 100 = 31) then - insert into favorites_31 values (NEW.*); - - elsif (NEW.user_id % 100 = 32) then - insert into favorites_32 values (NEW.*); - - elsif (NEW.user_id % 100 = 33) then - insert into favorites_33 values (NEW.*); - - elsif (NEW.user_id % 100 = 34) then - insert into favorites_34 values (NEW.*); - - elsif (NEW.user_id % 100 = 35) then - insert into favorites_35 values (NEW.*); - - elsif (NEW.user_id % 100 = 36) then - insert into favorites_36 values (NEW.*); - - elsif (NEW.user_id % 100 = 37) then - insert into favorites_37 values (NEW.*); - - elsif (NEW.user_id % 100 = 38) then - insert into favorites_38 values (NEW.*); - - elsif (NEW.user_id % 100 = 39) then - insert into favorites_39 values (NEW.*); - - elsif (NEW.user_id % 100 = 40) then - insert into favorites_40 values (NEW.*); - - elsif (NEW.user_id % 100 = 41) then - insert into favorites_41 values (NEW.*); - - elsif (NEW.user_id % 100 = 42) then - insert into favorites_42 values (NEW.*); - - elsif (NEW.user_id % 100 = 43) then - insert into favorites_43 values (NEW.*); - - elsif (NEW.user_id % 100 = 44) then - insert into favorites_44 values (NEW.*); - - elsif (NEW.user_id % 100 = 45) then - insert into favorites_45 values (NEW.*); - - elsif (NEW.user_id % 100 = 46) then - insert into favorites_46 values (NEW.*); - - elsif (NEW.user_id % 100 = 47) then - insert into favorites_47 values (NEW.*); - - elsif (NEW.user_id % 100 = 48) then - insert into favorites_48 values (NEW.*); - - elsif (NEW.user_id % 100 = 49) then - insert into favorites_49 values (NEW.*); - - elsif (NEW.user_id % 100 = 50) then - insert into favorites_50 values (NEW.*); - - elsif (NEW.user_id % 100 = 51) then - insert into favorites_51 values (NEW.*); - - elsif (NEW.user_id % 100 = 52) then - insert into favorites_52 values (NEW.*); - - elsif (NEW.user_id % 100 = 53) then - insert into favorites_53 values (NEW.*); - - elsif (NEW.user_id % 100 = 54) then - insert into favorites_54 values (NEW.*); - - elsif (NEW.user_id % 100 = 55) then - insert into favorites_55 values (NEW.*); - - elsif (NEW.user_id % 100 = 56) then - insert into favorites_56 values (NEW.*); - - elsif (NEW.user_id % 100 = 57) then - insert into favorites_57 values (NEW.*); - - elsif (NEW.user_id % 100 = 58) then - insert into favorites_58 values (NEW.*); - - elsif (NEW.user_id % 100 = 59) then - insert into favorites_59 values (NEW.*); - - elsif (NEW.user_id % 100 = 60) then - insert into favorites_60 values (NEW.*); - - elsif (NEW.user_id % 100 = 61) then - insert into favorites_61 values (NEW.*); - - elsif (NEW.user_id % 100 = 62) then - insert into favorites_62 values (NEW.*); - - elsif (NEW.user_id % 100 = 63) then - insert into favorites_63 values (NEW.*); - - elsif (NEW.user_id % 100 = 64) then - insert into favorites_64 values (NEW.*); - - elsif (NEW.user_id % 100 = 65) then - insert into favorites_65 values (NEW.*); - - elsif (NEW.user_id % 100 = 66) then - insert into favorites_66 values (NEW.*); - - elsif (NEW.user_id % 100 = 67) then - insert into favorites_67 values (NEW.*); - - elsif (NEW.user_id % 100 = 68) then - insert into favorites_68 values (NEW.*); - - elsif (NEW.user_id % 100 = 69) then - insert into favorites_69 values (NEW.*); - - elsif (NEW.user_id % 100 = 70) then - insert into favorites_70 values (NEW.*); - - elsif (NEW.user_id % 100 = 71) then - insert into favorites_71 values (NEW.*); - - elsif (NEW.user_id % 100 = 72) then - insert into favorites_72 values (NEW.*); - - elsif (NEW.user_id % 100 = 73) then - insert into favorites_73 values (NEW.*); - - elsif (NEW.user_id % 100 = 74) then - insert into favorites_74 values (NEW.*); - - elsif (NEW.user_id % 100 = 75) then - insert into favorites_75 values (NEW.*); - - elsif (NEW.user_id % 100 = 76) then - insert into favorites_76 values (NEW.*); - - elsif (NEW.user_id % 100 = 77) then - insert into favorites_77 values (NEW.*); - - elsif (NEW.user_id % 100 = 78) then - insert into favorites_78 values (NEW.*); - - elsif (NEW.user_id % 100 = 79) then - insert into favorites_79 values (NEW.*); - - elsif (NEW.user_id % 100 = 80) then - insert into favorites_80 values (NEW.*); - - elsif (NEW.user_id % 100 = 81) then - insert into favorites_81 values (NEW.*); - - elsif (NEW.user_id % 100 = 82) then - insert into favorites_82 values (NEW.*); - - elsif (NEW.user_id % 100 = 83) then - insert into favorites_83 values (NEW.*); - - elsif (NEW.user_id % 100 = 84) then - insert into favorites_84 values (NEW.*); - - elsif (NEW.user_id % 100 = 85) then - insert into favorites_85 values (NEW.*); - - elsif (NEW.user_id % 100 = 86) then - insert into favorites_86 values (NEW.*); - - elsif (NEW.user_id % 100 = 87) then - insert into favorites_87 values (NEW.*); - - elsif (NEW.user_id % 100 = 88) then - insert into favorites_88 values (NEW.*); - - elsif (NEW.user_id % 100 = 89) then - insert into favorites_89 values (NEW.*); - - elsif (NEW.user_id % 100 = 90) then - insert into favorites_90 values (NEW.*); - - elsif (NEW.user_id % 100 = 91) then - insert into favorites_91 values (NEW.*); - - elsif (NEW.user_id % 100 = 92) then - insert into favorites_92 values (NEW.*); - - elsif (NEW.user_id % 100 = 93) then - insert into favorites_93 values (NEW.*); - - elsif (NEW.user_id % 100 = 94) then - insert into favorites_94 values (NEW.*); - - elsif (NEW.user_id % 100 = 95) then - insert into favorites_95 values (NEW.*); - - elsif (NEW.user_id % 100 = 96) then - insert into favorites_96 values (NEW.*); - - elsif (NEW.user_id % 100 = 97) then - insert into favorites_97 values (NEW.*); - - elsif (NEW.user_id % 100 = 98) then - insert into favorites_98 values (NEW.*); - - elsif (NEW.user_id % 100 = 99) then - insert into favorites_99 values (NEW.*); - - end if; - return NULL; - end; - $$; - - --- --- Name: testprs_end(internal); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_end(internal) RETURNS void - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_end'; - - --- --- Name: testprs_getlexeme(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_getlexeme(internal, internal, internal) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_getlexeme'; - - --- --- Name: testprs_lextype(internal); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_lextype(internal) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_lextype'; - - --- --- Name: testprs_start(internal, integer); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_start(internal, integer) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_start'; - - --- --- Name: testparser; Type: TEXT SEARCH PARSER; Schema: public; Owner: - --- - -CREATE TEXT SEARCH PARSER testparser ( - START = testprs_start, - GETTOKEN = testprs_getlexeme, - END = testprs_end, - HEADLINE = prsd_headline, - LEXTYPES = testprs_lextype ); - - --- --- Name: danbooru; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: - --- - -CREATE TEXT SEARCH CONFIGURATION danbooru ( - PARSER = testparser ); - -ALTER TEXT SEARCH CONFIGURATION danbooru - ADD MAPPING FOR word WITH simple; - - -SET default_tablespace = ''; - -SET default_with_oids = false; - --- --- Name: advertisement_hits; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE advertisement_hits ( - id integer NOT NULL, - advertisement_id integer NOT NULL, - ip_addr inet NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: advertisement_hits_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE advertisement_hits_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: advertisement_hits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE advertisement_hits_id_seq OWNED BY advertisement_hits.id; - - --- --- Name: advertisements; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE advertisements ( - id integer NOT NULL, - referral_url text NOT NULL, - ad_type character varying(255) NOT NULL, - status character varying(255) NOT NULL, - hit_count integer DEFAULT 0 NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - file_name character varying(255) NOT NULL, - is_work_safe boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: advertisements_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE advertisements_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: advertisements_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE advertisements_id_seq OWNED BY advertisements.id; - - --- --- Name: amazon_backups; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE amazon_backups ( - id integer NOT NULL, - last_id integer, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: amazon_backups_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE amazon_backups_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: amazon_backups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE amazon_backups_id_seq OWNED BY amazon_backups.id; - - --- --- Name: artist_urls; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE artist_urls ( - id integer NOT NULL, - artist_id integer NOT NULL, - url text NOT NULL, - normalized_url text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: artist_urls_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE artist_urls_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: artist_urls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE artist_urls_id_seq OWNED BY artist_urls.id; - - --- --- Name: artist_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE artist_versions ( - id integer NOT NULL, - artist_id integer NOT NULL, - name character varying(255) NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - is_active boolean DEFAULT true NOT NULL, - other_names text, - group_name character varying(255), - url_string text, - is_banned boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: artist_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE artist_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: artist_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE artist_versions_id_seq OWNED BY artist_versions.id; - - --- --- Name: artists; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE artists ( - id integer NOT NULL, - name character varying(255) NOT NULL, - creator_id integer NOT NULL, - is_active boolean DEFAULT true NOT NULL, - is_banned boolean DEFAULT false NOT NULL, - other_names text, - other_names_index tsvector, - group_name character varying(255), - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: artists_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE artists_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: artists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE artists_id_seq OWNED BY artists.id; - - --- --- Name: bans; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE bans ( - id integer NOT NULL, - user_id integer, - reason text NOT NULL, - banner_id integer NOT NULL, - expires_at timestamp without time zone NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: bans_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE bans_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE bans_id_seq OWNED BY bans.id; - - --- --- Name: comment_votes; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE comment_votes ( - id integer NOT NULL, - comment_id integer NOT NULL, - user_id integer NOT NULL, - score integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: comment_votes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE comment_votes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: comment_votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE comment_votes_id_seq OWNED BY comment_votes.id; - - --- --- Name: comments; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE comments ( - id integer NOT NULL, - post_id integer NOT NULL, - creator_id integer NOT NULL, - body text NOT NULL, - ip_addr inet NOT NULL, - body_index tsvector NOT NULL, - score integer DEFAULT 0 NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE comments_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE comments_id_seq OWNED BY comments.id; - - --- --- Name: delayed_jobs; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE delayed_jobs ( - id integer NOT NULL, - priority integer DEFAULT 0, - attempts integer DEFAULT 0, - handler text, - last_error text, - run_at timestamp without time zone, - locked_at timestamp without time zone, - failed_at timestamp without time zone, - locked_by character varying(255), - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: delayed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE delayed_jobs_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: delayed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE delayed_jobs_id_seq OWNED BY delayed_jobs.id; - - --- --- Name: dmails; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE dmails ( - id integer NOT NULL, - owner_id integer NOT NULL, - from_id integer NOT NULL, - to_id integer NOT NULL, - title text NOT NULL, - body text NOT NULL, - message_index tsvector NOT NULL, - is_read boolean DEFAULT false NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: dmails_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE dmails_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: dmails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE dmails_id_seq OWNED BY dmails.id; - - --- --- Name: favorites; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites ( - id integer NOT NULL, - user_id integer, - post_id integer -); - - --- --- Name: favorites_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: favorites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_id_seq OWNED BY favorites.id; - - --- --- Name: favorites_0; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_0 ( - CONSTRAINT favorites_0_user_id_check CHECK (((user_id % 100) = 0)) -) -INHERITS (favorites); - - --- --- Name: favorites_1; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_1 ( - CONSTRAINT favorites_1_user_id_check CHECK (((user_id % 100) = 1)) -) -INHERITS (favorites); - - --- --- Name: favorites_10; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_10 ( - CONSTRAINT favorites_10_user_id_check CHECK (((user_id % 100) = 10)) -) -INHERITS (favorites); - - --- --- Name: favorites_11; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_11 ( - CONSTRAINT favorites_11_user_id_check CHECK (((user_id % 100) = 11)) -) -INHERITS (favorites); - - --- --- Name: favorites_12; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_12 ( - CONSTRAINT favorites_12_user_id_check CHECK (((user_id % 100) = 12)) -) -INHERITS (favorites); - - --- --- Name: favorites_13; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_13 ( - CONSTRAINT favorites_13_user_id_check CHECK (((user_id % 100) = 13)) -) -INHERITS (favorites); - - --- --- Name: favorites_14; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_14 ( - CONSTRAINT favorites_14_user_id_check CHECK (((user_id % 100) = 14)) -) -INHERITS (favorites); - - --- --- Name: favorites_15; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_15 ( - CONSTRAINT favorites_15_user_id_check CHECK (((user_id % 100) = 15)) -) -INHERITS (favorites); - - --- --- Name: favorites_16; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_16 ( - CONSTRAINT favorites_16_user_id_check CHECK (((user_id % 100) = 16)) -) -INHERITS (favorites); - - --- --- Name: favorites_17; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_17 ( - CONSTRAINT favorites_17_user_id_check CHECK (((user_id % 100) = 17)) -) -INHERITS (favorites); - - --- --- Name: favorites_18; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_18 ( - CONSTRAINT favorites_18_user_id_check CHECK (((user_id % 100) = 18)) -) -INHERITS (favorites); - - --- --- Name: favorites_19; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_19 ( - CONSTRAINT favorites_19_user_id_check CHECK (((user_id % 100) = 19)) -) -INHERITS (favorites); - - --- --- Name: favorites_2; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_2 ( - CONSTRAINT favorites_2_user_id_check CHECK (((user_id % 100) = 2)) -) -INHERITS (favorites); - - --- --- Name: favorites_20; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_20 ( - CONSTRAINT favorites_20_user_id_check CHECK (((user_id % 100) = 20)) -) -INHERITS (favorites); - - --- --- Name: favorites_21; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_21 ( - CONSTRAINT favorites_21_user_id_check CHECK (((user_id % 100) = 21)) -) -INHERITS (favorites); - - --- --- Name: favorites_22; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_22 ( - CONSTRAINT favorites_22_user_id_check CHECK (((user_id % 100) = 22)) -) -INHERITS (favorites); - - --- --- Name: favorites_23; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_23 ( - CONSTRAINT favorites_23_user_id_check CHECK (((user_id % 100) = 23)) -) -INHERITS (favorites); - - --- --- Name: favorites_24; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_24 ( - CONSTRAINT favorites_24_user_id_check CHECK (((user_id % 100) = 24)) -) -INHERITS (favorites); - - --- --- Name: favorites_25; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_25 ( - CONSTRAINT favorites_25_user_id_check CHECK (((user_id % 100) = 25)) -) -INHERITS (favorites); - - --- --- Name: favorites_26; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_26 ( - CONSTRAINT favorites_26_user_id_check CHECK (((user_id % 100) = 26)) -) -INHERITS (favorites); - - --- --- Name: favorites_27; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_27 ( - CONSTRAINT favorites_27_user_id_check CHECK (((user_id % 100) = 27)) -) -INHERITS (favorites); - - --- --- Name: favorites_28; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_28 ( - CONSTRAINT favorites_28_user_id_check CHECK (((user_id % 100) = 28)) -) -INHERITS (favorites); - - --- --- Name: favorites_29; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_29 ( - CONSTRAINT favorites_29_user_id_check CHECK (((user_id % 100) = 29)) -) -INHERITS (favorites); - - --- --- Name: favorites_3; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_3 ( - CONSTRAINT favorites_3_user_id_check CHECK (((user_id % 100) = 3)) -) -INHERITS (favorites); - - --- --- Name: favorites_30; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_30 ( - CONSTRAINT favorites_30_user_id_check CHECK (((user_id % 100) = 30)) -) -INHERITS (favorites); - - --- --- Name: favorites_31; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_31 ( - CONSTRAINT favorites_31_user_id_check CHECK (((user_id % 100) = 31)) -) -INHERITS (favorites); - - --- --- Name: favorites_32; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_32 ( - CONSTRAINT favorites_32_user_id_check CHECK (((user_id % 100) = 32)) -) -INHERITS (favorites); - - --- --- Name: favorites_33; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_33 ( - CONSTRAINT favorites_33_user_id_check CHECK (((user_id % 100) = 33)) -) -INHERITS (favorites); - - --- --- Name: favorites_34; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_34 ( - CONSTRAINT favorites_34_user_id_check CHECK (((user_id % 100) = 34)) -) -INHERITS (favorites); - - --- --- Name: favorites_35; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_35 ( - CONSTRAINT favorites_35_user_id_check CHECK (((user_id % 100) = 35)) -) -INHERITS (favorites); - - --- --- Name: favorites_36; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_36 ( - CONSTRAINT favorites_36_user_id_check CHECK (((user_id % 100) = 36)) -) -INHERITS (favorites); - - --- --- Name: favorites_37; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_37 ( - CONSTRAINT favorites_37_user_id_check CHECK (((user_id % 100) = 37)) -) -INHERITS (favorites); - - --- --- Name: favorites_38; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_38 ( - CONSTRAINT favorites_38_user_id_check CHECK (((user_id % 100) = 38)) -) -INHERITS (favorites); - - --- --- Name: favorites_39; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_39 ( - CONSTRAINT favorites_39_user_id_check CHECK (((user_id % 100) = 39)) -) -INHERITS (favorites); - - --- --- Name: favorites_4; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_4 ( - CONSTRAINT favorites_4_user_id_check CHECK (((user_id % 100) = 4)) -) -INHERITS (favorites); - - --- --- Name: favorites_40; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_40 ( - CONSTRAINT favorites_40_user_id_check CHECK (((user_id % 100) = 40)) -) -INHERITS (favorites); - - --- --- Name: favorites_41; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_41 ( - CONSTRAINT favorites_41_user_id_check CHECK (((user_id % 100) = 41)) -) -INHERITS (favorites); - - --- --- Name: favorites_42; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_42 ( - CONSTRAINT favorites_42_user_id_check CHECK (((user_id % 100) = 42)) -) -INHERITS (favorites); - - --- --- Name: favorites_43; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_43 ( - CONSTRAINT favorites_43_user_id_check CHECK (((user_id % 100) = 43)) -) -INHERITS (favorites); - - --- --- Name: favorites_44; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_44 ( - CONSTRAINT favorites_44_user_id_check CHECK (((user_id % 100) = 44)) -) -INHERITS (favorites); - - --- --- Name: favorites_45; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_45 ( - CONSTRAINT favorites_45_user_id_check CHECK (((user_id % 100) = 45)) -) -INHERITS (favorites); - - --- --- Name: favorites_46; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_46 ( - CONSTRAINT favorites_46_user_id_check CHECK (((user_id % 100) = 46)) -) -INHERITS (favorites); - - --- --- Name: favorites_47; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_47 ( - CONSTRAINT favorites_47_user_id_check CHECK (((user_id % 100) = 47)) -) -INHERITS (favorites); - - --- --- Name: favorites_48; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_48 ( - CONSTRAINT favorites_48_user_id_check CHECK (((user_id % 100) = 48)) -) -INHERITS (favorites); - - --- --- Name: favorites_49; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_49 ( - CONSTRAINT favorites_49_user_id_check CHECK (((user_id % 100) = 49)) -) -INHERITS (favorites); - - --- --- Name: favorites_5; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_5 ( - CONSTRAINT favorites_5_user_id_check CHECK (((user_id % 100) = 5)) -) -INHERITS (favorites); - - --- --- Name: favorites_50; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_50 ( - CONSTRAINT favorites_50_user_id_check CHECK (((user_id % 100) = 50)) -) -INHERITS (favorites); - - --- --- Name: favorites_51; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_51 ( - CONSTRAINT favorites_51_user_id_check CHECK (((user_id % 100) = 51)) -) -INHERITS (favorites); - - --- --- Name: favorites_52; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_52 ( - CONSTRAINT favorites_52_user_id_check CHECK (((user_id % 100) = 52)) -) -INHERITS (favorites); - - --- --- Name: favorites_53; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_53 ( - CONSTRAINT favorites_53_user_id_check CHECK (((user_id % 100) = 53)) -) -INHERITS (favorites); - - --- --- Name: favorites_54; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_54 ( - CONSTRAINT favorites_54_user_id_check CHECK (((user_id % 100) = 54)) -) -INHERITS (favorites); - - --- --- Name: favorites_55; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_55 ( - CONSTRAINT favorites_55_user_id_check CHECK (((user_id % 100) = 55)) -) -INHERITS (favorites); - - --- --- Name: favorites_56; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_56 ( - CONSTRAINT favorites_56_user_id_check CHECK (((user_id % 100) = 56)) -) -INHERITS (favorites); - - --- --- Name: favorites_57; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_57 ( - CONSTRAINT favorites_57_user_id_check CHECK (((user_id % 100) = 57)) -) -INHERITS (favorites); - - --- --- Name: favorites_58; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_58 ( - CONSTRAINT favorites_58_user_id_check CHECK (((user_id % 100) = 58)) -) -INHERITS (favorites); - - --- --- Name: favorites_59; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_59 ( - CONSTRAINT favorites_59_user_id_check CHECK (((user_id % 100) = 59)) -) -INHERITS (favorites); - - --- --- Name: favorites_6; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_6 ( - CONSTRAINT favorites_6_user_id_check CHECK (((user_id % 100) = 6)) -) -INHERITS (favorites); - - --- --- Name: favorites_60; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_60 ( - CONSTRAINT favorites_60_user_id_check CHECK (((user_id % 100) = 60)) -) -INHERITS (favorites); - - --- --- Name: favorites_61; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_61 ( - CONSTRAINT favorites_61_user_id_check CHECK (((user_id % 100) = 61)) -) -INHERITS (favorites); - - --- --- Name: favorites_62; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_62 ( - CONSTRAINT favorites_62_user_id_check CHECK (((user_id % 100) = 62)) -) -INHERITS (favorites); - - --- --- Name: favorites_63; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_63 ( - CONSTRAINT favorites_63_user_id_check CHECK (((user_id % 100) = 63)) -) -INHERITS (favorites); - - --- --- Name: favorites_64; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_64 ( - CONSTRAINT favorites_64_user_id_check CHECK (((user_id % 100) = 64)) -) -INHERITS (favorites); - - --- --- Name: favorites_65; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_65 ( - CONSTRAINT favorites_65_user_id_check CHECK (((user_id % 100) = 65)) -) -INHERITS (favorites); - - --- --- Name: favorites_66; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_66 ( - CONSTRAINT favorites_66_user_id_check CHECK (((user_id % 100) = 66)) -) -INHERITS (favorites); - - --- --- Name: favorites_67; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_67 ( - CONSTRAINT favorites_67_user_id_check CHECK (((user_id % 100) = 67)) -) -INHERITS (favorites); - - --- --- Name: favorites_68; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_68 ( - CONSTRAINT favorites_68_user_id_check CHECK (((user_id % 100) = 68)) -) -INHERITS (favorites); - - --- --- Name: favorites_69; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_69 ( - CONSTRAINT favorites_69_user_id_check CHECK (((user_id % 100) = 69)) -) -INHERITS (favorites); - - --- --- Name: favorites_7; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_7 ( - CONSTRAINT favorites_7_user_id_check CHECK (((user_id % 100) = 7)) -) -INHERITS (favorites); - - --- --- Name: favorites_70; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_70 ( - CONSTRAINT favorites_70_user_id_check CHECK (((user_id % 100) = 70)) -) -INHERITS (favorites); - - --- --- Name: favorites_71; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_71 ( - CONSTRAINT favorites_71_user_id_check CHECK (((user_id % 100) = 71)) -) -INHERITS (favorites); - - --- --- Name: favorites_72; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_72 ( - CONSTRAINT favorites_72_user_id_check CHECK (((user_id % 100) = 72)) -) -INHERITS (favorites); - - --- --- Name: favorites_73; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_73 ( - CONSTRAINT favorites_73_user_id_check CHECK (((user_id % 100) = 73)) -) -INHERITS (favorites); - - --- --- Name: favorites_74; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_74 ( - CONSTRAINT favorites_74_user_id_check CHECK (((user_id % 100) = 74)) -) -INHERITS (favorites); - - --- --- Name: favorites_75; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_75 ( - CONSTRAINT favorites_75_user_id_check CHECK (((user_id % 100) = 75)) -) -INHERITS (favorites); - - --- --- Name: favorites_76; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_76 ( - CONSTRAINT favorites_76_user_id_check CHECK (((user_id % 100) = 76)) -) -INHERITS (favorites); - - --- --- Name: favorites_77; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_77 ( - CONSTRAINT favorites_77_user_id_check CHECK (((user_id % 100) = 77)) -) -INHERITS (favorites); - - --- --- Name: favorites_78; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_78 ( - CONSTRAINT favorites_78_user_id_check CHECK (((user_id % 100) = 78)) -) -INHERITS (favorites); - - --- --- Name: favorites_79; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_79 ( - CONSTRAINT favorites_79_user_id_check CHECK (((user_id % 100) = 79)) -) -INHERITS (favorites); - - --- --- Name: favorites_8; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_8 ( - CONSTRAINT favorites_8_user_id_check CHECK (((user_id % 100) = 8)) -) -INHERITS (favorites); - - --- --- Name: favorites_80; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_80 ( - CONSTRAINT favorites_80_user_id_check CHECK (((user_id % 100) = 80)) -) -INHERITS (favorites); - - --- --- Name: favorites_81; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_81 ( - CONSTRAINT favorites_81_user_id_check CHECK (((user_id % 100) = 81)) -) -INHERITS (favorites); - - --- --- Name: favorites_82; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_82 ( - CONSTRAINT favorites_82_user_id_check CHECK (((user_id % 100) = 82)) -) -INHERITS (favorites); - - --- --- Name: favorites_83; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_83 ( - CONSTRAINT favorites_83_user_id_check CHECK (((user_id % 100) = 83)) -) -INHERITS (favorites); - - --- --- Name: favorites_84; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_84 ( - CONSTRAINT favorites_84_user_id_check CHECK (((user_id % 100) = 84)) -) -INHERITS (favorites); - - --- --- Name: favorites_85; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_85 ( - CONSTRAINT favorites_85_user_id_check CHECK (((user_id % 100) = 85)) -) -INHERITS (favorites); - - --- --- Name: favorites_86; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_86 ( - CONSTRAINT favorites_86_user_id_check CHECK (((user_id % 100) = 86)) -) -INHERITS (favorites); - - --- --- Name: favorites_87; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_87 ( - CONSTRAINT favorites_87_user_id_check CHECK (((user_id % 100) = 87)) -) -INHERITS (favorites); - - --- --- Name: favorites_88; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_88 ( - CONSTRAINT favorites_88_user_id_check CHECK (((user_id % 100) = 88)) -) -INHERITS (favorites); - - --- --- Name: favorites_89; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_89 ( - CONSTRAINT favorites_89_user_id_check CHECK (((user_id % 100) = 89)) -) -INHERITS (favorites); - - --- --- Name: favorites_9; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_9 ( - CONSTRAINT favorites_9_user_id_check CHECK (((user_id % 100) = 9)) -) -INHERITS (favorites); - - --- --- Name: favorites_90; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_90 ( - CONSTRAINT favorites_90_user_id_check CHECK (((user_id % 100) = 90)) -) -INHERITS (favorites); - - --- --- Name: favorites_91; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_91 ( - CONSTRAINT favorites_91_user_id_check CHECK (((user_id % 100) = 91)) -) -INHERITS (favorites); - - --- --- Name: favorites_92; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_92 ( - CONSTRAINT favorites_92_user_id_check CHECK (((user_id % 100) = 92)) -) -INHERITS (favorites); - - --- --- Name: favorites_93; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_93 ( - CONSTRAINT favorites_93_user_id_check CHECK (((user_id % 100) = 93)) -) -INHERITS (favorites); - - --- --- Name: favorites_94; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_94 ( - CONSTRAINT favorites_94_user_id_check CHECK (((user_id % 100) = 94)) -) -INHERITS (favorites); - - --- --- Name: favorites_95; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_95 ( - CONSTRAINT favorites_95_user_id_check CHECK (((user_id % 100) = 95)) -) -INHERITS (favorites); - - --- --- Name: favorites_96; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_96 ( - CONSTRAINT favorites_96_user_id_check CHECK (((user_id % 100) = 96)) -) -INHERITS (favorites); - - --- --- Name: favorites_97; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_97 ( - CONSTRAINT favorites_97_user_id_check CHECK (((user_id % 100) = 97)) -) -INHERITS (favorites); - - --- --- Name: favorites_98; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_98 ( - CONSTRAINT favorites_98_user_id_check CHECK (((user_id % 100) = 98)) -) -INHERITS (favorites); - - --- --- Name: favorites_99; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_99 ( - CONSTRAINT favorites_99_user_id_check CHECK (((user_id % 100) = 99)) -) -INHERITS (favorites); - - --- --- Name: forum_posts; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE forum_posts ( - id integer NOT NULL, - topic_id integer NOT NULL, - creator_id integer NOT NULL, - updater_id integer NOT NULL, - body text NOT NULL, - text_index tsvector NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: forum_posts_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE forum_posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: forum_posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE forum_posts_id_seq OWNED BY forum_posts.id; - - --- --- Name: forum_topics; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE forum_topics ( - id integer NOT NULL, - creator_id integer NOT NULL, - updater_id integer NOT NULL, - title character varying(255) NOT NULL, - response_count integer DEFAULT 0 NOT NULL, - is_sticky boolean DEFAULT false NOT NULL, - is_locked boolean DEFAULT false NOT NULL, - text_index tsvector NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: forum_topics_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE forum_topics_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: forum_topics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE forum_topics_id_seq OWNED BY forum_topics.id; - - --- --- Name: ip_bans; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE ip_bans ( - id integer NOT NULL, - creator_id integer NOT NULL, - ip_addr inet NOT NULL, - reason text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: ip_bans_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE ip_bans_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: ip_bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE ip_bans_id_seq OWNED BY ip_bans.id; - - --- --- Name: janitor_trials; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE janitor_trials ( - id integer NOT NULL, - creator_id integer NOT NULL, - user_id integer NOT NULL, - original_level integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: janitor_trials_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE janitor_trials_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: janitor_trials_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE janitor_trials_id_seq OWNED BY janitor_trials.id; - - --- --- Name: mod_actions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE mod_actions ( - id integer NOT NULL, - creator_id integer NOT NULL, - description text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: mod_actions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE mod_actions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: mod_actions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE mod_actions_id_seq OWNED BY mod_actions.id; - - --- --- Name: news_updates; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE news_updates ( - id integer NOT NULL, - message text NOT NULL, - creator_id integer NOT NULL, - updater_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: news_updates_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE news_updates_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: news_updates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE news_updates_id_seq OWNED BY news_updates.id; - - --- --- Name: note_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE note_versions ( - id integer NOT NULL, - note_id integer NOT NULL, - post_id integer NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - x integer NOT NULL, - y integer NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - is_active boolean DEFAULT true NOT NULL, - body text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: note_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE note_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: note_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE note_versions_id_seq OWNED BY note_versions.id; - - --- --- Name: notes; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE notes ( - id integer NOT NULL, - creator_id integer NOT NULL, - post_id integer NOT NULL, - x integer NOT NULL, - y integer NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - is_active boolean DEFAULT true NOT NULL, - body text NOT NULL, - body_index tsvector NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE notes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE notes_id_seq OWNED BY notes.id; - - --- --- Name: pool_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE pool_versions ( - id integer NOT NULL, - pool_id integer, - post_ids text DEFAULT ''::text NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: pool_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE pool_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pool_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE pool_versions_id_seq OWNED BY pool_versions.id; - - --- --- Name: pools; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE pools ( - id integer NOT NULL, - name character varying(255), - creator_id integer NOT NULL, - description text, - is_active boolean DEFAULT true NOT NULL, - post_ids text DEFAULT ''::text NOT NULL, - post_count integer DEFAULT 0 NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: pools_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE pools_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pools_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE pools_id_seq OWNED BY pools.id; - - --- --- Name: post_appeals; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_appeals ( - id integer NOT NULL, - post_id integer NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr integer NOT NULL, - reason text, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: post_appeals_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_appeals_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: post_appeals_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_appeals_id_seq OWNED BY post_appeals.id; - - --- --- Name: post_disapprovals; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_disapprovals ( - id integer NOT NULL, - user_id integer NOT NULL, - post_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: post_disapprovals_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_disapprovals_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: post_disapprovals_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_disapprovals_id_seq OWNED BY post_disapprovals.id; - - --- --- Name: post_flags; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_flags ( - id integer NOT NULL, - post_id integer NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr inet NOT NULL, - reason text, - is_resolved boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: post_flags_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_flags_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: post_flags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_flags_id_seq OWNED BY post_flags.id; - - --- --- Name: post_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_versions ( - id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - post_id integer NOT NULL, - tags text DEFAULT ''::text NOT NULL, - rating character(1), - parent_id integer, - source text, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL -); - - --- --- Name: post_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: post_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_versions_id_seq OWNED BY post_versions.id; - - --- --- Name: post_votes; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_votes ( - id integer NOT NULL, - post_id integer NOT NULL, - user_id integer NOT NULL, - score integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: post_votes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_votes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: post_votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_votes_id_seq OWNED BY post_votes.id; - - --- --- Name: posts; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE posts ( - id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - up_score integer DEFAULT 0 NOT NULL, - down_score integer DEFAULT 0 NOT NULL, - score integer DEFAULT 0 NOT NULL, - source character varying(255), - md5 character varying(255) NOT NULL, - rating character(1) DEFAULT 'q'::bpchar NOT NULL, - is_note_locked boolean DEFAULT false NOT NULL, - is_rating_locked boolean DEFAULT false NOT NULL, - is_status_locked boolean DEFAULT false NOT NULL, - is_pending boolean DEFAULT false NOT NULL, - is_flagged boolean DEFAULT false NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, - uploader_id integer NOT NULL, - uploader_ip_addr inet NOT NULL, - approver_id integer, - fav_string text DEFAULT ''::text NOT NULL, - pool_string text DEFAULT ''::text NOT NULL, - last_noted_at timestamp without time zone, - last_commented_at timestamp without time zone, - fav_count integer DEFAULT 0 NOT NULL, - tag_string text DEFAULT ''::text NOT NULL, - tag_index tsvector, - tag_count integer DEFAULT 0 NOT NULL, - tag_count_general integer DEFAULT 0 NOT NULL, - tag_count_artist integer DEFAULT 0 NOT NULL, - tag_count_character integer DEFAULT 0 NOT NULL, - tag_count_copyright integer DEFAULT 0 NOT NULL, - file_ext character varying(255) NOT NULL, - file_size integer NOT NULL, - image_width integer NOT NULL, - image_height integer NOT NULL, - parent_id integer, - has_children boolean DEFAULT false NOT NULL -); - - --- --- Name: posts_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE posts_id_seq OWNED BY posts.id; - - --- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE schema_migrations ( - version character varying(255) NOT NULL -); - - --- --- Name: tag_aliases; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tag_aliases ( - id integer NOT NULL, - antecedent_name character varying(255) NOT NULL, - consequent_name character varying(255) NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr inet NOT NULL, - forum_topic_id integer, - status text DEFAULT 'pending'::text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tag_aliases_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tag_aliases_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: tag_aliases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tag_aliases_id_seq OWNED BY tag_aliases.id; - - --- --- Name: tag_implications; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tag_implications ( - id integer NOT NULL, - antecedent_name character varying(255) NOT NULL, - consequent_name character varying(255) NOT NULL, - descendant_names text NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr inet NOT NULL, - forum_topic_id integer, - status text DEFAULT 'pending'::text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tag_implications_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tag_implications_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: tag_implications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tag_implications_id_seq OWNED BY tag_implications.id; - - --- --- Name: tag_subscriptions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tag_subscriptions ( - id integer NOT NULL, - creator_id integer NOT NULL, - name character varying(255) NOT NULL, - tag_query character varying(255) NOT NULL, - post_ids text NOT NULL, - is_public boolean DEFAULT true NOT NULL, - last_accessed_at timestamp without time zone, - is_opted_in boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tag_subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tag_subscriptions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: tag_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tag_subscriptions_id_seq OWNED BY tag_subscriptions.id; - - --- --- Name: tags; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tags ( - id integer NOT NULL, - name character varying(255) NOT NULL, - post_count integer DEFAULT 0 NOT NULL, - category integer DEFAULT 0 NOT NULL, - related_tags text, - related_tags_updated_at timestamp without time zone, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tags_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tags_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tags_id_seq OWNED BY tags.id; - - --- --- Name: uploads; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE uploads ( - id integer NOT NULL, - source character varying(255), - file_path character varying(255), - content_type character varying(255), - rating character(1) NOT NULL, - uploader_id integer NOT NULL, - uploader_ip_addr inet NOT NULL, - tag_string text NOT NULL, - status text DEFAULT 'pending'::text NOT NULL, - backtrace text, - post_id integer, - md5_confirmation character varying(255), - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE uploads_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id; - - --- --- Name: user_feedback; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE user_feedback ( - id integer NOT NULL, - user_id integer NOT NULL, - creator_id integer NOT NULL, - category character varying(255) NOT NULL, - body text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: user_feedback_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE user_feedback_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: user_feedback_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE user_feedback_id_seq OWNED BY user_feedback.id; - - --- --- Name: user_password_reset_nonces; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE user_password_reset_nonces ( - id integer NOT NULL, - key character varying(255) NOT NULL, - email character varying(255) NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: user_password_reset_nonces_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE user_password_reset_nonces_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: user_password_reset_nonces_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE user_password_reset_nonces_id_seq OWNED BY user_password_reset_nonces.id; - - --- --- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE users ( - id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - name character varying(255) NOT NULL, - password_hash character varying(255) NOT NULL, - email character varying(255), - email_verification_key character varying(255), - inviter_id integer, - is_banned boolean DEFAULT false NOT NULL, - level integer DEFAULT 0 NOT NULL, - base_upload_limit integer DEFAULT 10 NOT NULL, - last_logged_in_at timestamp without time zone, - last_forum_read_at timestamp without time zone, - has_mail boolean DEFAULT false NOT NULL, - recent_tags text, - post_upload_count integer DEFAULT 0 NOT NULL, - post_update_count integer DEFAULT 0 NOT NULL, - note_update_count integer DEFAULT 0 NOT NULL, - favorite_count integer DEFAULT 0 NOT NULL, - receive_email_notifications boolean DEFAULT false NOT NULL, - comment_threshold integer DEFAULT (-1) NOT NULL, - always_resize_images boolean DEFAULT false NOT NULL, - default_image_size character varying(255) DEFAULT 'large'::character varying NOT NULL, - favorite_tags text, - blacklisted_tags text, - time_zone character varying(255) DEFAULT 'Eastern Time (US & Canada)'::character varying NOT NULL -); - - --- --- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE users_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE users_id_seq OWNED BY users.id; - - --- --- Name: wiki_page_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE wiki_page_versions ( - id integer NOT NULL, - wiki_page_id integer NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - title character varying(255) NOT NULL, - body text NOT NULL, - is_locked boolean NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: wiki_page_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE wiki_page_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: wiki_page_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE wiki_page_versions_id_seq OWNED BY wiki_page_versions.id; - - --- --- Name: wiki_pages; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE wiki_pages ( - id integer NOT NULL, - creator_id integer NOT NULL, - title character varying(255) NOT NULL, - body text NOT NULL, - body_index tsvector NOT NULL, - is_locked boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: wiki_pages_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE wiki_pages_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: wiki_pages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE wiki_pages_id_seq OWNED BY wiki_pages.id; - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE advertisement_hits ALTER COLUMN id SET DEFAULT nextval('advertisement_hits_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE advertisements ALTER COLUMN id SET DEFAULT nextval('advertisements_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE amazon_backups ALTER COLUMN id SET DEFAULT nextval('amazon_backups_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE artist_urls ALTER COLUMN id SET DEFAULT nextval('artist_urls_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE artist_versions ALTER COLUMN id SET DEFAULT nextval('artist_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE artists ALTER COLUMN id SET DEFAULT nextval('artists_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE bans ALTER COLUMN id SET DEFAULT nextval('bans_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE comment_votes ALTER COLUMN id SET DEFAULT nextval('comment_votes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE comments ALTER COLUMN id SET DEFAULT nextval('comments_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE delayed_jobs ALTER COLUMN id SET DEFAULT nextval('delayed_jobs_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE dmails ALTER COLUMN id SET DEFAULT nextval('dmails_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites ALTER COLUMN id SET DEFAULT nextval('favorites_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE forum_posts ALTER COLUMN id SET DEFAULT nextval('forum_posts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE forum_topics ALTER COLUMN id SET DEFAULT nextval('forum_topics_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ip_bans ALTER COLUMN id SET DEFAULT nextval('ip_bans_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE janitor_trials ALTER COLUMN id SET DEFAULT nextval('janitor_trials_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE mod_actions ALTER COLUMN id SET DEFAULT nextval('mod_actions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE news_updates ALTER COLUMN id SET DEFAULT nextval('news_updates_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE note_versions ALTER COLUMN id SET DEFAULT nextval('note_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE pool_versions ALTER COLUMN id SET DEFAULT nextval('pool_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE pools ALTER COLUMN id SET DEFAULT nextval('pools_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_appeals ALTER COLUMN id SET DEFAULT nextval('post_appeals_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_disapprovals ALTER COLUMN id SET DEFAULT nextval('post_disapprovals_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_flags ALTER COLUMN id SET DEFAULT nextval('post_flags_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_versions ALTER COLUMN id SET DEFAULT nextval('post_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_votes ALTER COLUMN id SET DEFAULT nextval('post_votes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE posts ALTER COLUMN id SET DEFAULT nextval('posts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tag_aliases ALTER COLUMN id SET DEFAULT nextval('tag_aliases_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tag_implications ALTER COLUMN id SET DEFAULT nextval('tag_implications_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tag_subscriptions ALTER COLUMN id SET DEFAULT nextval('tag_subscriptions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tags ALTER COLUMN id SET DEFAULT nextval('tags_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE user_feedback ALTER COLUMN id SET DEFAULT nextval('user_feedback_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE user_password_reset_nonces ALTER COLUMN id SET DEFAULT nextval('user_password_reset_nonces_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE wiki_page_versions ALTER COLUMN id SET DEFAULT nextval('wiki_page_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE wiki_pages ALTER COLUMN id SET DEFAULT nextval('wiki_pages_id_seq'::regclass); - - --- --- Name: advertisement_hits_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY advertisement_hits - ADD CONSTRAINT advertisement_hits_pkey PRIMARY KEY (id); - - --- --- Name: advertisements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY advertisements - ADD CONSTRAINT advertisements_pkey PRIMARY KEY (id); - - --- --- Name: amazon_backups_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY amazon_backups - ADD CONSTRAINT amazon_backups_pkey PRIMARY KEY (id); - - --- --- Name: artist_urls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY artist_urls - ADD CONSTRAINT artist_urls_pkey PRIMARY KEY (id); - - --- --- Name: artist_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY artist_versions - ADD CONSTRAINT artist_versions_pkey PRIMARY KEY (id); - - --- --- Name: artists_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY artists - ADD CONSTRAINT artists_pkey PRIMARY KEY (id); - - --- --- Name: bans_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY bans - ADD CONSTRAINT bans_pkey PRIMARY KEY (id); - - --- --- Name: comment_votes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY comment_votes - ADD CONSTRAINT comment_votes_pkey PRIMARY KEY (id); - - --- --- Name: comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY comments - ADD CONSTRAINT comments_pkey PRIMARY KEY (id); - - --- --- Name: delayed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY delayed_jobs - ADD CONSTRAINT delayed_jobs_pkey PRIMARY KEY (id); - - --- --- Name: dmails_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY dmails - ADD CONSTRAINT dmails_pkey PRIMARY KEY (id); - - --- --- Name: favorites_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites - ADD CONSTRAINT favorites_pkey PRIMARY KEY (id); - - --- --- Name: forum_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY forum_posts - ADD CONSTRAINT forum_posts_pkey PRIMARY KEY (id); - - --- --- Name: forum_topics_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY forum_topics - ADD CONSTRAINT forum_topics_pkey PRIMARY KEY (id); - - --- --- Name: ip_bans_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY ip_bans - ADD CONSTRAINT ip_bans_pkey PRIMARY KEY (id); - - --- --- Name: janitor_trials_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY janitor_trials - ADD CONSTRAINT janitor_trials_pkey PRIMARY KEY (id); - - --- --- Name: mod_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY mod_actions - ADD CONSTRAINT mod_actions_pkey PRIMARY KEY (id); - - --- --- Name: news_updates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY news_updates - ADD CONSTRAINT news_updates_pkey PRIMARY KEY (id); - - --- --- Name: note_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY note_versions - ADD CONSTRAINT note_versions_pkey PRIMARY KEY (id); - - --- --- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY notes - ADD CONSTRAINT notes_pkey PRIMARY KEY (id); - - --- --- Name: pool_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY pool_versions - ADD CONSTRAINT pool_versions_pkey PRIMARY KEY (id); - - --- --- Name: pools_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY pools - ADD CONSTRAINT pools_pkey PRIMARY KEY (id); - - --- --- Name: post_appeals_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_appeals - ADD CONSTRAINT post_appeals_pkey PRIMARY KEY (id); - - --- --- Name: post_disapprovals_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_disapprovals - ADD CONSTRAINT post_disapprovals_pkey PRIMARY KEY (id); - - --- --- Name: post_flags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_flags - ADD CONSTRAINT post_flags_pkey PRIMARY KEY (id); - - --- --- Name: post_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_versions - ADD CONSTRAINT post_versions_pkey PRIMARY KEY (id); - - --- --- Name: post_votes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_votes - ADD CONSTRAINT post_votes_pkey PRIMARY KEY (id); - - --- --- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY posts - ADD CONSTRAINT posts_pkey PRIMARY KEY (id); - - --- --- Name: tag_aliases_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tag_aliases - ADD CONSTRAINT tag_aliases_pkey PRIMARY KEY (id); - - --- --- Name: tag_implications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tag_implications - ADD CONSTRAINT tag_implications_pkey PRIMARY KEY (id); - - --- --- Name: tag_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tag_subscriptions - ADD CONSTRAINT tag_subscriptions_pkey PRIMARY KEY (id); - - --- --- Name: tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tags - ADD CONSTRAINT tags_pkey PRIMARY KEY (id); - - --- --- Name: uploads_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY uploads - ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); - - --- --- Name: user_feedback_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY user_feedback - ADD CONSTRAINT user_feedback_pkey PRIMARY KEY (id); - - --- --- Name: user_password_reset_nonces_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY user_password_reset_nonces - ADD CONSTRAINT user_password_reset_nonces_pkey PRIMARY KEY (id); - - --- --- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- Name: wiki_page_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY wiki_page_versions - ADD CONSTRAINT wiki_page_versions_pkey PRIMARY KEY (id); - - --- --- Name: wiki_pages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY wiki_pages - ADD CONSTRAINT wiki_pages_pkey PRIMARY KEY (id); - - --- --- Name: index_advertisement_hits_on_advertisement_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_advertisement_hits_on_advertisement_id ON advertisement_hits USING btree (advertisement_id); - - --- --- Name: index_advertisement_hits_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_advertisement_hits_on_created_at ON advertisement_hits USING btree (created_at); - - --- --- Name: index_advertisements_on_ad_type; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_advertisements_on_ad_type ON advertisements USING btree (ad_type); - - --- --- Name: index_artist_urls_on_artist_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_urls_on_artist_id ON artist_urls USING btree (artist_id); - - --- --- Name: index_artist_urls_on_normalized_url; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_urls_on_normalized_url ON artist_urls USING btree (normalized_url); - - --- --- Name: index_artist_urls_on_url; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_urls_on_url ON artist_urls USING btree (url); - - --- --- Name: index_artist_versions_on_artist_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_versions_on_artist_id ON artist_versions USING btree (artist_id); - - --- --- Name: index_artist_versions_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_versions_on_name ON artist_versions USING btree (name); - - --- --- Name: index_artist_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_versions_on_updater_id ON artist_versions USING btree (updater_id); - - --- --- Name: index_artists_on_group_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artists_on_group_name ON artists USING btree (group_name); - - --- --- Name: index_artists_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_artists_on_name ON artists USING btree (name); - - --- --- Name: index_artists_on_other_names_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artists_on_other_names_index ON artists USING gin (other_names_index); - - --- --- Name: index_bans_on_banner_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_bans_on_banner_id ON bans USING btree (banner_id); - - --- --- Name: index_bans_on_expires_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_bans_on_expires_at ON bans USING btree (expires_at); - - --- --- Name: index_bans_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_bans_on_user_id ON bans USING btree (user_id); - - --- --- Name: index_comment_votes_on_comment_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comment_votes_on_comment_id ON comment_votes USING btree (comment_id); - - --- --- Name: index_comment_votes_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comment_votes_on_created_at ON comment_votes USING btree (created_at); - - --- --- Name: index_comment_votes_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comment_votes_on_user_id ON comment_votes USING btree (user_id); - - --- --- Name: index_comments_on_body_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comments_on_body_index ON comments USING gin (body_index); - - --- --- Name: index_comments_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comments_on_post_id ON comments USING btree (post_id); - - --- --- Name: index_delayed_jobs_on_run_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_delayed_jobs_on_run_at ON delayed_jobs USING btree (run_at); - - --- --- Name: index_dmails_on_message_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_dmails_on_message_index ON dmails USING gin (message_index); - - --- --- Name: index_dmails_on_owner_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_dmails_on_owner_id ON dmails USING btree (owner_id); - - --- --- Name: index_favorites_0_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_0_on_post_id ON favorites_0 USING btree (post_id); - - --- --- Name: index_favorites_0_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_0_on_user_id ON favorites_0 USING btree (user_id); - - --- --- Name: index_favorites_10_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_10_on_post_id ON favorites_10 USING btree (post_id); - - --- --- Name: index_favorites_10_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_10_on_user_id ON favorites_10 USING btree (user_id); - - --- --- Name: index_favorites_11_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_11_on_post_id ON favorites_11 USING btree (post_id); - - --- --- Name: index_favorites_11_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_11_on_user_id ON favorites_11 USING btree (user_id); - - --- --- Name: index_favorites_12_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_12_on_post_id ON favorites_12 USING btree (post_id); - - --- --- Name: index_favorites_12_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_12_on_user_id ON favorites_12 USING btree (user_id); - - --- --- Name: index_favorites_13_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_13_on_post_id ON favorites_13 USING btree (post_id); - - --- --- Name: index_favorites_13_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_13_on_user_id ON favorites_13 USING btree (user_id); - - --- --- Name: index_favorites_14_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_14_on_post_id ON favorites_14 USING btree (post_id); - - --- --- Name: index_favorites_14_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_14_on_user_id ON favorites_14 USING btree (user_id); - - --- --- Name: index_favorites_15_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_15_on_post_id ON favorites_15 USING btree (post_id); - - --- --- Name: index_favorites_15_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_15_on_user_id ON favorites_15 USING btree (user_id); - - --- --- Name: index_favorites_16_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_16_on_post_id ON favorites_16 USING btree (post_id); - - --- --- Name: index_favorites_16_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_16_on_user_id ON favorites_16 USING btree (user_id); - - --- --- Name: index_favorites_17_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_17_on_post_id ON favorites_17 USING btree (post_id); - - --- --- Name: index_favorites_17_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_17_on_user_id ON favorites_17 USING btree (user_id); - - --- --- Name: index_favorites_18_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_18_on_post_id ON favorites_18 USING btree (post_id); - - --- --- Name: index_favorites_18_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_18_on_user_id ON favorites_18 USING btree (user_id); - - --- --- Name: index_favorites_19_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_19_on_post_id ON favorites_19 USING btree (post_id); - - --- --- Name: index_favorites_19_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_19_on_user_id ON favorites_19 USING btree (user_id); - - --- --- Name: index_favorites_1_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_1_on_post_id ON favorites_1 USING btree (post_id); - - --- --- Name: index_favorites_1_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_1_on_user_id ON favorites_1 USING btree (user_id); - - --- --- Name: index_favorites_20_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_20_on_post_id ON favorites_20 USING btree (post_id); - - --- --- Name: index_favorites_20_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_20_on_user_id ON favorites_20 USING btree (user_id); - - --- --- Name: index_favorites_21_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_21_on_post_id ON favorites_21 USING btree (post_id); - - --- --- Name: index_favorites_21_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_21_on_user_id ON favorites_21 USING btree (user_id); - - --- --- Name: index_favorites_22_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_22_on_post_id ON favorites_22 USING btree (post_id); - - --- --- Name: index_favorites_22_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_22_on_user_id ON favorites_22 USING btree (user_id); - - --- --- Name: index_favorites_23_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_23_on_post_id ON favorites_23 USING btree (post_id); - - --- --- Name: index_favorites_23_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_23_on_user_id ON favorites_23 USING btree (user_id); - - --- --- Name: index_favorites_24_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_24_on_post_id ON favorites_24 USING btree (post_id); - - --- --- Name: index_favorites_24_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_24_on_user_id ON favorites_24 USING btree (user_id); - - --- --- Name: index_favorites_25_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_25_on_post_id ON favorites_25 USING btree (post_id); - - --- --- Name: index_favorites_25_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_25_on_user_id ON favorites_25 USING btree (user_id); - - --- --- Name: index_favorites_26_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_26_on_post_id ON favorites_26 USING btree (post_id); - - --- --- Name: index_favorites_26_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_26_on_user_id ON favorites_26 USING btree (user_id); - - --- --- Name: index_favorites_27_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_27_on_post_id ON favorites_27 USING btree (post_id); - - --- --- Name: index_favorites_27_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_27_on_user_id ON favorites_27 USING btree (user_id); - - --- --- Name: index_favorites_28_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_28_on_post_id ON favorites_28 USING btree (post_id); - - --- --- Name: index_favorites_28_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_28_on_user_id ON favorites_28 USING btree (user_id); - - --- --- Name: index_favorites_29_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_29_on_post_id ON favorites_29 USING btree (post_id); - - --- --- Name: index_favorites_29_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_29_on_user_id ON favorites_29 USING btree (user_id); - - --- --- Name: index_favorites_2_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_2_on_post_id ON favorites_2 USING btree (post_id); - - --- --- Name: index_favorites_2_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_2_on_user_id ON favorites_2 USING btree (user_id); - - --- --- Name: index_favorites_30_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_30_on_post_id ON favorites_30 USING btree (post_id); - - --- --- Name: index_favorites_30_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_30_on_user_id ON favorites_30 USING btree (user_id); - - --- --- Name: index_favorites_31_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_31_on_post_id ON favorites_31 USING btree (post_id); - - --- --- Name: index_favorites_31_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_31_on_user_id ON favorites_31 USING btree (user_id); - - --- --- Name: index_favorites_32_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_32_on_post_id ON favorites_32 USING btree (post_id); - - --- --- Name: index_favorites_32_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_32_on_user_id ON favorites_32 USING btree (user_id); - - --- --- Name: index_favorites_33_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_33_on_post_id ON favorites_33 USING btree (post_id); - - --- --- Name: index_favorites_33_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_33_on_user_id ON favorites_33 USING btree (user_id); - - --- --- Name: index_favorites_34_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_34_on_post_id ON favorites_34 USING btree (post_id); - - --- --- Name: index_favorites_34_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_34_on_user_id ON favorites_34 USING btree (user_id); - - --- --- Name: index_favorites_35_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_35_on_post_id ON favorites_35 USING btree (post_id); - - --- --- Name: index_favorites_35_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_35_on_user_id ON favorites_35 USING btree (user_id); - - --- --- Name: index_favorites_36_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_36_on_post_id ON favorites_36 USING btree (post_id); - - --- --- Name: index_favorites_36_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_36_on_user_id ON favorites_36 USING btree (user_id); - - --- --- Name: index_favorites_37_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_37_on_post_id ON favorites_37 USING btree (post_id); - - --- --- Name: index_favorites_37_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_37_on_user_id ON favorites_37 USING btree (user_id); - - --- --- Name: index_favorites_38_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_38_on_post_id ON favorites_38 USING btree (post_id); - - --- --- Name: index_favorites_38_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_38_on_user_id ON favorites_38 USING btree (user_id); - - --- --- Name: index_favorites_39_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_39_on_post_id ON favorites_39 USING btree (post_id); - - --- --- Name: index_favorites_39_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_39_on_user_id ON favorites_39 USING btree (user_id); - - --- --- Name: index_favorites_3_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_3_on_post_id ON favorites_3 USING btree (post_id); - - --- --- Name: index_favorites_3_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_3_on_user_id ON favorites_3 USING btree (user_id); - - --- --- Name: index_favorites_40_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_40_on_post_id ON favorites_40 USING btree (post_id); - - --- --- Name: index_favorites_40_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_40_on_user_id ON favorites_40 USING btree (user_id); - - --- --- Name: index_favorites_41_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_41_on_post_id ON favorites_41 USING btree (post_id); - - --- --- Name: index_favorites_41_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_41_on_user_id ON favorites_41 USING btree (user_id); - - --- --- Name: index_favorites_42_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_42_on_post_id ON favorites_42 USING btree (post_id); - - --- --- Name: index_favorites_42_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_42_on_user_id ON favorites_42 USING btree (user_id); - - --- --- Name: index_favorites_43_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_43_on_post_id ON favorites_43 USING btree (post_id); - - --- --- Name: index_favorites_43_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_43_on_user_id ON favorites_43 USING btree (user_id); - - --- --- Name: index_favorites_44_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_44_on_post_id ON favorites_44 USING btree (post_id); - - --- --- Name: index_favorites_44_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_44_on_user_id ON favorites_44 USING btree (user_id); - - --- --- Name: index_favorites_45_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_45_on_post_id ON favorites_45 USING btree (post_id); - - --- --- Name: index_favorites_45_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_45_on_user_id ON favorites_45 USING btree (user_id); - - --- --- Name: index_favorites_46_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_46_on_post_id ON favorites_46 USING btree (post_id); - - --- --- Name: index_favorites_46_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_46_on_user_id ON favorites_46 USING btree (user_id); - - --- --- Name: index_favorites_47_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_47_on_post_id ON favorites_47 USING btree (post_id); - - --- --- Name: index_favorites_47_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_47_on_user_id ON favorites_47 USING btree (user_id); - - --- --- Name: index_favorites_48_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_48_on_post_id ON favorites_48 USING btree (post_id); - - --- --- Name: index_favorites_48_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_48_on_user_id ON favorites_48 USING btree (user_id); - - --- --- Name: index_favorites_49_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_49_on_post_id ON favorites_49 USING btree (post_id); - - --- --- Name: index_favorites_49_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_49_on_user_id ON favorites_49 USING btree (user_id); - - --- --- Name: index_favorites_4_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_4_on_post_id ON favorites_4 USING btree (post_id); - - --- --- Name: index_favorites_4_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_4_on_user_id ON favorites_4 USING btree (user_id); - - --- --- Name: index_favorites_50_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_50_on_post_id ON favorites_50 USING btree (post_id); - - --- --- Name: index_favorites_50_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_50_on_user_id ON favorites_50 USING btree (user_id); - - --- --- Name: index_favorites_51_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_51_on_post_id ON favorites_51 USING btree (post_id); - - --- --- Name: index_favorites_51_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_51_on_user_id ON favorites_51 USING btree (user_id); - - --- --- Name: index_favorites_52_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_52_on_post_id ON favorites_52 USING btree (post_id); - - --- --- Name: index_favorites_52_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_52_on_user_id ON favorites_52 USING btree (user_id); - - --- --- Name: index_favorites_53_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_53_on_post_id ON favorites_53 USING btree (post_id); - - --- --- Name: index_favorites_53_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_53_on_user_id ON favorites_53 USING btree (user_id); - - --- --- Name: index_favorites_54_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_54_on_post_id ON favorites_54 USING btree (post_id); - - --- --- Name: index_favorites_54_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_54_on_user_id ON favorites_54 USING btree (user_id); - - --- --- Name: index_favorites_55_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_55_on_post_id ON favorites_55 USING btree (post_id); - - --- --- Name: index_favorites_55_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_55_on_user_id ON favorites_55 USING btree (user_id); - - --- --- Name: index_favorites_56_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_56_on_post_id ON favorites_56 USING btree (post_id); - - --- --- Name: index_favorites_56_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_56_on_user_id ON favorites_56 USING btree (user_id); - - --- --- Name: index_favorites_57_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_57_on_post_id ON favorites_57 USING btree (post_id); - - --- --- Name: index_favorites_57_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_57_on_user_id ON favorites_57 USING btree (user_id); - - --- --- Name: index_favorites_58_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_58_on_post_id ON favorites_58 USING btree (post_id); - - --- --- Name: index_favorites_58_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_58_on_user_id ON favorites_58 USING btree (user_id); - - --- --- Name: index_favorites_59_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_59_on_post_id ON favorites_59 USING btree (post_id); - - --- --- Name: index_favorites_59_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_59_on_user_id ON favorites_59 USING btree (user_id); - - --- --- Name: index_favorites_5_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_5_on_post_id ON favorites_5 USING btree (post_id); - - --- --- Name: index_favorites_5_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_5_on_user_id ON favorites_5 USING btree (user_id); - - --- --- Name: index_favorites_60_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_60_on_post_id ON favorites_60 USING btree (post_id); - - --- --- Name: index_favorites_60_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_60_on_user_id ON favorites_60 USING btree (user_id); - - --- --- Name: index_favorites_61_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_61_on_post_id ON favorites_61 USING btree (post_id); - - --- --- Name: index_favorites_61_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_61_on_user_id ON favorites_61 USING btree (user_id); - - --- --- Name: index_favorites_62_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_62_on_post_id ON favorites_62 USING btree (post_id); - - --- --- Name: index_favorites_62_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_62_on_user_id ON favorites_62 USING btree (user_id); - - --- --- Name: index_favorites_63_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_63_on_post_id ON favorites_63 USING btree (post_id); - - --- --- Name: index_favorites_63_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_63_on_user_id ON favorites_63 USING btree (user_id); - - --- --- Name: index_favorites_64_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_64_on_post_id ON favorites_64 USING btree (post_id); - - --- --- Name: index_favorites_64_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_64_on_user_id ON favorites_64 USING btree (user_id); - - --- --- Name: index_favorites_65_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_65_on_post_id ON favorites_65 USING btree (post_id); - - --- --- Name: index_favorites_65_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_65_on_user_id ON favorites_65 USING btree (user_id); - - --- --- Name: index_favorites_66_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_66_on_post_id ON favorites_66 USING btree (post_id); - - --- --- Name: index_favorites_66_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_66_on_user_id ON favorites_66 USING btree (user_id); - - --- --- Name: index_favorites_67_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_67_on_post_id ON favorites_67 USING btree (post_id); - - --- --- Name: index_favorites_67_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_67_on_user_id ON favorites_67 USING btree (user_id); - - --- --- Name: index_favorites_68_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_68_on_post_id ON favorites_68 USING btree (post_id); - - --- --- Name: index_favorites_68_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_68_on_user_id ON favorites_68 USING btree (user_id); - - --- --- Name: index_favorites_69_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_69_on_post_id ON favorites_69 USING btree (post_id); - - --- --- Name: index_favorites_69_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_69_on_user_id ON favorites_69 USING btree (user_id); - - --- --- Name: index_favorites_6_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_6_on_post_id ON favorites_6 USING btree (post_id); - - --- --- Name: index_favorites_6_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_6_on_user_id ON favorites_6 USING btree (user_id); - - --- --- Name: index_favorites_70_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_70_on_post_id ON favorites_70 USING btree (post_id); - - --- --- Name: index_favorites_70_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_70_on_user_id ON favorites_70 USING btree (user_id); - - --- --- Name: index_favorites_71_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_71_on_post_id ON favorites_71 USING btree (post_id); - - --- --- Name: index_favorites_71_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_71_on_user_id ON favorites_71 USING btree (user_id); - - --- --- Name: index_favorites_72_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_72_on_post_id ON favorites_72 USING btree (post_id); - - --- --- Name: index_favorites_72_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_72_on_user_id ON favorites_72 USING btree (user_id); - - --- --- Name: index_favorites_73_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_73_on_post_id ON favorites_73 USING btree (post_id); - - --- --- Name: index_favorites_73_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_73_on_user_id ON favorites_73 USING btree (user_id); - - --- --- Name: index_favorites_74_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_74_on_post_id ON favorites_74 USING btree (post_id); - - --- --- Name: index_favorites_74_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_74_on_user_id ON favorites_74 USING btree (user_id); - - --- --- Name: index_favorites_75_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_75_on_post_id ON favorites_75 USING btree (post_id); - - --- --- Name: index_favorites_75_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_75_on_user_id ON favorites_75 USING btree (user_id); - - --- --- Name: index_favorites_76_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_76_on_post_id ON favorites_76 USING btree (post_id); - - --- --- Name: index_favorites_76_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_76_on_user_id ON favorites_76 USING btree (user_id); - - --- --- Name: index_favorites_77_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_77_on_post_id ON favorites_77 USING btree (post_id); - - --- --- Name: index_favorites_77_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_77_on_user_id ON favorites_77 USING btree (user_id); - - --- --- Name: index_favorites_78_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_78_on_post_id ON favorites_78 USING btree (post_id); - - --- --- Name: index_favorites_78_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_78_on_user_id ON favorites_78 USING btree (user_id); - - --- --- Name: index_favorites_79_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_79_on_post_id ON favorites_79 USING btree (post_id); - - --- --- Name: index_favorites_79_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_79_on_user_id ON favorites_79 USING btree (user_id); - - --- --- Name: index_favorites_7_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_7_on_post_id ON favorites_7 USING btree (post_id); - - --- --- Name: index_favorites_7_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_7_on_user_id ON favorites_7 USING btree (user_id); - - --- --- Name: index_favorites_80_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_80_on_post_id ON favorites_80 USING btree (post_id); - - --- --- Name: index_favorites_80_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_80_on_user_id ON favorites_80 USING btree (user_id); - - --- --- Name: index_favorites_81_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_81_on_post_id ON favorites_81 USING btree (post_id); - - --- --- Name: index_favorites_81_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_81_on_user_id ON favorites_81 USING btree (user_id); - - --- --- Name: index_favorites_82_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_82_on_post_id ON favorites_82 USING btree (post_id); - - --- --- Name: index_favorites_82_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_82_on_user_id ON favorites_82 USING btree (user_id); - - --- --- Name: index_favorites_83_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_83_on_post_id ON favorites_83 USING btree (post_id); - - --- --- Name: index_favorites_83_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_83_on_user_id ON favorites_83 USING btree (user_id); - - --- --- Name: index_favorites_84_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_84_on_post_id ON favorites_84 USING btree (post_id); - - --- --- Name: index_favorites_84_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_84_on_user_id ON favorites_84 USING btree (user_id); - - --- --- Name: index_favorites_85_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_85_on_post_id ON favorites_85 USING btree (post_id); - - --- --- Name: index_favorites_85_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_85_on_user_id ON favorites_85 USING btree (user_id); - - --- --- Name: index_favorites_86_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_86_on_post_id ON favorites_86 USING btree (post_id); - - --- --- Name: index_favorites_86_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_86_on_user_id ON favorites_86 USING btree (user_id); - - --- --- Name: index_favorites_87_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_87_on_post_id ON favorites_87 USING btree (post_id); - - --- --- Name: index_favorites_87_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_87_on_user_id ON favorites_87 USING btree (user_id); - - --- --- Name: index_favorites_88_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_88_on_post_id ON favorites_88 USING btree (post_id); - - --- --- Name: index_favorites_88_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_88_on_user_id ON favorites_88 USING btree (user_id); - - --- --- Name: index_favorites_89_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_89_on_post_id ON favorites_89 USING btree (post_id); - - --- --- Name: index_favorites_89_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_89_on_user_id ON favorites_89 USING btree (user_id); - - --- --- Name: index_favorites_8_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_8_on_post_id ON favorites_8 USING btree (post_id); - - --- --- Name: index_favorites_8_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_8_on_user_id ON favorites_8 USING btree (user_id); - - --- --- Name: index_favorites_90_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_90_on_post_id ON favorites_90 USING btree (post_id); - - --- --- Name: index_favorites_90_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_90_on_user_id ON favorites_90 USING btree (user_id); - - --- --- Name: index_favorites_91_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_91_on_post_id ON favorites_91 USING btree (post_id); - - --- --- Name: index_favorites_91_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_91_on_user_id ON favorites_91 USING btree (user_id); - - --- --- Name: index_favorites_92_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_92_on_post_id ON favorites_92 USING btree (post_id); - - --- --- Name: index_favorites_92_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_92_on_user_id ON favorites_92 USING btree (user_id); - - --- --- Name: index_favorites_93_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_93_on_post_id ON favorites_93 USING btree (post_id); - - --- --- Name: index_favorites_93_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_93_on_user_id ON favorites_93 USING btree (user_id); - - --- --- Name: index_favorites_94_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_94_on_post_id ON favorites_94 USING btree (post_id); - - --- --- Name: index_favorites_94_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_94_on_user_id ON favorites_94 USING btree (user_id); - - --- --- Name: index_favorites_95_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_95_on_post_id ON favorites_95 USING btree (post_id); - - --- --- Name: index_favorites_95_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_95_on_user_id ON favorites_95 USING btree (user_id); - - --- --- Name: index_favorites_96_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_96_on_post_id ON favorites_96 USING btree (post_id); - - --- --- Name: index_favorites_96_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_96_on_user_id ON favorites_96 USING btree (user_id); - - --- --- Name: index_favorites_97_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_97_on_post_id ON favorites_97 USING btree (post_id); - - --- --- Name: index_favorites_97_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_97_on_user_id ON favorites_97 USING btree (user_id); - - --- --- Name: index_favorites_98_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_98_on_post_id ON favorites_98 USING btree (post_id); - - --- --- Name: index_favorites_98_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_98_on_user_id ON favorites_98 USING btree (user_id); - - --- --- Name: index_favorites_99_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_99_on_post_id ON favorites_99 USING btree (post_id); - - --- --- Name: index_favorites_99_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_99_on_user_id ON favorites_99 USING btree (user_id); - - --- --- Name: index_favorites_9_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_9_on_post_id ON favorites_9 USING btree (post_id); - - --- --- Name: index_favorites_9_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_9_on_user_id ON favorites_9 USING btree (user_id); - - --- --- Name: index_forum_posts_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_posts_on_creator_id ON forum_posts USING btree (creator_id); - - --- --- Name: index_forum_posts_on_text_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_posts_on_text_index ON forum_posts USING gin (text_index); - - --- --- Name: index_forum_posts_on_topic_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_posts_on_topic_id ON forum_posts USING btree (topic_id); - - --- --- Name: index_forum_topics_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_topics_on_creator_id ON forum_topics USING btree (creator_id); - - --- --- Name: index_forum_topics_on_text_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_topics_on_text_index ON forum_topics USING gin (text_index); - - --- --- Name: index_ip_bans_on_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_ip_bans_on_ip_addr ON ip_bans USING btree (ip_addr); - - --- --- Name: index_janitor_trials_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_janitor_trials_on_user_id ON janitor_trials USING btree (user_id); - - --- --- Name: index_news_updates_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_news_updates_on_created_at ON news_updates USING btree (created_at); - - --- --- Name: index_note_versions_on_note_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_note_versions_on_note_id ON note_versions USING btree (note_id); - - --- --- Name: index_note_versions_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_note_versions_on_post_id ON note_versions USING btree (post_id); - - --- --- Name: index_note_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_note_versions_on_updater_id ON note_versions USING btree (updater_id); - - --- --- Name: index_note_versions_on_updater_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_note_versions_on_updater_ip_addr ON note_versions USING btree (updater_ip_addr); - - --- --- Name: index_notes_on_body_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_notes_on_body_index ON notes USING gin (body_index); - - --- --- Name: index_notes_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_notes_on_creator_id ON notes USING btree (creator_id); - - --- --- Name: index_notes_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_notes_on_post_id ON notes USING btree (post_id); - - --- --- Name: index_pool_versions_on_pool_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pool_versions_on_pool_id ON pool_versions USING btree (pool_id); - - --- --- Name: index_pool_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pool_versions_on_updater_id ON pool_versions USING btree (updater_id); - - --- --- Name: index_pool_versions_on_updater_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pool_versions_on_updater_ip_addr ON pool_versions USING btree (updater_ip_addr); - - --- --- Name: index_pools_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pools_on_creator_id ON pools USING btree (creator_id); - - --- --- Name: index_pools_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pools_on_name ON pools USING btree (name); - - --- --- Name: index_post_appeals_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_appeals_on_creator_id ON post_appeals USING btree (creator_id); - - --- --- Name: index_post_appeals_on_creator_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_appeals_on_creator_ip_addr ON post_appeals USING btree (creator_ip_addr); - - --- --- Name: index_post_appeals_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_appeals_on_post_id ON post_appeals USING btree (post_id); - - --- --- Name: index_post_disapprovals_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_disapprovals_on_post_id ON post_disapprovals USING btree (post_id); - - --- --- Name: index_post_disapprovals_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_disapprovals_on_user_id ON post_disapprovals USING btree (user_id); - - --- --- Name: index_post_flags_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_flags_on_creator_id ON post_flags USING btree (creator_id); - - --- --- Name: index_post_flags_on_creator_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_flags_on_creator_ip_addr ON post_flags USING btree (creator_ip_addr); - - --- --- Name: index_post_flags_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_flags_on_post_id ON post_flags USING btree (post_id); - - --- --- Name: index_post_versions_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_versions_on_post_id ON post_versions USING btree (post_id); - - --- --- Name: index_post_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_versions_on_updater_id ON post_versions USING btree (updater_id); - - --- --- Name: index_post_versions_on_updater_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_versions_on_updater_ip_addr ON post_versions USING btree (updater_ip_addr); - - --- --- Name: index_post_votes_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_votes_on_post_id ON post_votes USING btree (post_id); - - --- --- Name: index_post_votes_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_votes_on_user_id ON post_votes USING btree (user_id); - - --- --- Name: index_posts_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_created_at ON posts USING btree (created_at); - - --- --- Name: index_posts_on_file_size; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_file_size ON posts USING btree (file_size); - - --- --- Name: index_posts_on_image_height; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_image_height ON posts USING btree (image_height); - - --- --- Name: index_posts_on_image_width; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_image_width ON posts USING btree (image_width); - - --- --- Name: index_posts_on_last_commented_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_last_commented_at ON posts USING btree (last_commented_at); - - --- --- Name: index_posts_on_last_noted_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_last_noted_at ON posts USING btree (last_noted_at); - - --- --- Name: index_posts_on_md5; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_posts_on_md5 ON posts USING btree (md5); - - --- --- Name: index_posts_on_mpixels; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_mpixels ON posts USING btree (((((image_width * image_height))::numeric / 1000000.0))); - - --- --- Name: index_posts_on_parent_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_parent_id ON posts USING btree (parent_id); - - --- --- Name: index_posts_on_source; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_source ON posts USING btree (source); - - --- --- Name: index_posts_on_tags_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_tags_index ON posts USING gin (tag_index); - - --- --- Name: index_posts_on_uploader_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_uploader_id ON posts USING btree (uploader_id); - - --- --- Name: index_posts_on_uploader_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_uploader_ip_addr ON posts USING btree (uploader_ip_addr); - - --- --- Name: index_tag_aliases_on_antecedent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING btree (antecedent_name); - - --- --- Name: index_tag_aliases_on_consequent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_aliases_on_consequent_name ON tag_aliases USING btree (consequent_name); - - --- --- Name: index_tag_implications_on_antecedent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_implications_on_antecedent_name ON tag_implications USING btree (antecedent_name); - - --- --- Name: index_tag_implications_on_consequent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_implications_on_consequent_name ON tag_implications USING btree (consequent_name); - - --- --- Name: index_tag_subscriptions_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_subscriptions_on_creator_id ON tag_subscriptions USING btree (creator_id); - - --- --- Name: index_tag_subscriptions_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_subscriptions_on_name ON tag_subscriptions USING btree (name); - - --- --- Name: index_tags_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name); - - --- --- Name: index_uploads_on_uploader_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_uploads_on_uploader_id ON uploads USING btree (uploader_id); - - --- --- Name: index_uploads_on_uploader_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_uploads_on_uploader_ip_addr ON uploads USING btree (uploader_ip_addr); - - --- --- Name: index_user_feedback_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_user_feedback_on_creator_id ON user_feedback USING btree (creator_id); - - --- --- Name: index_user_feedback_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_user_feedback_on_user_id ON user_feedback USING btree (user_id); - - --- --- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_users_on_email ON users USING btree (email); - - --- --- Name: index_users_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_users_on_name ON users USING btree (lower((name)::text)); - - --- --- Name: index_wiki_page_versions_on_wiki_page_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_wiki_page_versions_on_wiki_page_id ON wiki_page_versions USING btree (wiki_page_id); - - --- --- Name: index_wiki_pages_on_body_index_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_wiki_pages_on_body_index_index ON wiki_pages USING gin (body_index); - - --- --- Name: index_wiki_pages_on_title; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_wiki_pages_on_title ON wiki_pages USING btree (title); - - --- --- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version); - - --- --- Name: insert_favorites_trigger; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER insert_favorites_trigger BEFORE INSERT ON favorites FOR EACH ROW EXECUTE PROCEDURE favorites_insert_trigger(); - - --- --- Name: trigger_artists_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_artists_on_update BEFORE INSERT OR UPDATE ON artists FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('other_names_index', 'public.danbooru', 'other_names'); - - --- --- Name: trigger_comments_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_comments_on_update BEFORE INSERT OR UPDATE ON comments FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body'); - - --- --- Name: trigger_dmails_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_dmails_on_update BEFORE INSERT OR UPDATE ON dmails FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('message_index', 'pg_catalog.english', 'title', 'body'); - - --- --- Name: trigger_forum_posts_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_forum_posts_on_update BEFORE INSERT OR UPDATE ON forum_posts FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'body'); - - --- --- Name: trigger_forum_topics_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_forum_topics_on_update BEFORE INSERT OR UPDATE ON forum_topics FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'title'); - - --- --- Name: trigger_notes_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_notes_on_update BEFORE INSERT OR UPDATE ON notes FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body'); - - --- --- Name: trigger_posts_on_tag_index_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_posts_on_tag_index_update BEFORE INSERT OR UPDATE ON posts FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('tag_index', 'public.danbooru', 'tag_string', 'fav_string', 'pool_string'); - - --- --- Name: trigger_wiki_pages_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_wiki_pages_on_update BEFORE INSERT OR UPDATE ON wiki_pages FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'public.danbooru', 'body', 'title'); - - --- --- PostgreSQL database dump complete --- - -INSERT INTO schema_migrations (version) VALUES ('20100204211522'); - -INSERT INTO schema_migrations (version) VALUES ('20100204214746'); - -INSERT INTO schema_migrations (version) VALUES ('20100205162521'); - -INSERT INTO schema_migrations (version) VALUES ('20100205163027'); - -INSERT INTO schema_migrations (version) VALUES ('20100205224030'); - -INSERT INTO schema_migrations (version) VALUES ('20100211025616'); - -INSERT INTO schema_migrations (version) VALUES ('20100211181944'); - -INSERT INTO schema_migrations (version) VALUES ('20100211191709'); - -INSERT INTO schema_migrations (version) VALUES ('20100211191716'); - -INSERT INTO schema_migrations (version) VALUES ('20100213181847'); - -INSERT INTO schema_migrations (version) VALUES ('20100213183712'); - -INSERT INTO schema_migrations (version) VALUES ('20100214080549'); - -INSERT INTO schema_migrations (version) VALUES ('20100214080557'); - -INSERT INTO schema_migrations (version) VALUES ('20100214080605'); - -INSERT INTO schema_migrations (version) VALUES ('20100215182234'); - -INSERT INTO schema_migrations (version) VALUES ('20100215213756'); - -INSERT INTO schema_migrations (version) VALUES ('20100215223541'); - -INSERT INTO schema_migrations (version) VALUES ('20100215224629'); - -INSERT INTO schema_migrations (version) VALUES ('20100215224635'); - -INSERT INTO schema_migrations (version) VALUES ('20100215225710'); - -INSERT INTO schema_migrations (version) VALUES ('20100215230642'); - -INSERT INTO schema_migrations (version) VALUES ('20100219230537'); - -INSERT INTO schema_migrations (version) VALUES ('20100221003655'); - -INSERT INTO schema_migrations (version) VALUES ('20100221005812'); - -INSERT INTO schema_migrations (version) VALUES ('20100223001012'); - -INSERT INTO schema_migrations (version) VALUES ('20100224171915'); - -INSERT INTO schema_migrations (version) VALUES ('20100224172146'); - -INSERT INTO schema_migrations (version) VALUES ('20100307073438'); - -INSERT INTO schema_migrations (version) VALUES ('20100309211553'); - -INSERT INTO schema_migrations (version) VALUES ('20100318213503'); - -INSERT INTO schema_migrations (version) VALUES ('20100826232512'); - -INSERT INTO schema_migrations (version) VALUES ('20110328215652'); - -INSERT INTO schema_migrations (version) VALUES ('20110328215701'); - -INSERT INTO schema_migrations (version) VALUES ('20110607194023'); - -INSERT INTO schema_migrations (version) VALUES ('20110717010705'); - -INSERT INTO schema_migrations (version) VALUES ('20110722211855'); - -INSERT INTO schema_migrations (version) VALUES ('20110815233456'); - -INSERT INTO schema_migrations (version) VALUES ('20111101212358'); \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 000000000..c42caaaba --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,1477 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20111101212358) do + + create_table "advertisement_hits", :force => true do |t| + t.integer "advertisement_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "ip_addr", :limit => nil + end + + add_index "advertisement_hits", ["advertisement_id"], :name => "index_advertisement_hits_on_advertisement_id" + add_index "advertisement_hits", ["created_at"], :name => "index_advertisement_hits_on_created_at" + + create_table "advertisements", :force => true do |t| + t.string "referral_url", :limit => 1000, :null => false + t.string "ad_type", :null => false + t.string "status", :null => false + t.integer "hit_count", :default => 0, :null => false + t.integer "width", :null => false + t.integer "height", :null => false + t.boolean "is_work_safe", :default => false, :null => false + t.string "file_name" + t.datetime "created_at" + end + + add_index "advertisements", ["ad_type"], :name => "index_advertisements_on_ad_type" + + create_table "amazon_backups", :force => true do |t| + t.integer "last_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "artist_urls", :force => true do |t| + t.integer "artist_id", :null => false + t.text "url", :null => false + t.text "normalized_url", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "artist_urls", ["artist_id"], :name => "index_artist_urls_on_artist_id" + add_index "artist_urls", ["normalized_url"], :name => "index_artist_urls_on_normalized_url" + add_index "artist_urls", ["normalized_url"], :name => "index_artist_urls_on_normalized_url_pattern" + add_index "artist_urls", ["url"], :name => "index_artist_urls_on_url" + add_index "artist_urls", ["url"], :name => "index_artist_urls_on_url_pattern" + + create_table "artist_versions", :force => true do |t| + t.integer "artist_id" + t.text "name" + t.integer "updater_id" + t.text "url_string" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "is_active", :default => true, :null => false + t.string "group_name" + t.boolean "is_banned", :default => false, :null => false + t.string "updater_ip_addr", :limit => nil, :default => "127.0.0.1" + t.text "other_names", :default => "" + end + + add_index "artist_versions", ["artist_id"], :name => "index_artist_versions_on_artist_id" + add_index "artist_versions", ["updater_id"], :name => "index_artist_versions_on_updater_id" + + create_table "artists", :force => true do |t| + t.datetime "created_at", :null => false + t.text "name", :null => false + t.datetime "updated_at", :null => false + t.integer "creator_id" + t.boolean "is_active", :default => true, :null => false + t.string "group_name" + t.boolean "is_banned", :default => false, :null => false + t.text "other_names", :default => "" + t.tsvector "other_names_index" + end + + add_index "artists", ["name"], :name => "index_artists_on_name", :unique => true + add_index "artists", ["other_names_index"], :name => "index_artists_on_other_names_index" + + create_table "bans", :force => true do |t| + t.integer "user_id", :null => false + t.text "reason", :null => false + t.datetime "expires_at", :null => false + t.integer "banner_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "bans", ["banner_id"], :name => "index_bans_on_banner_id" + add_index "bans", ["expires_at"], :name => "index_bans_on_expires_at" + add_index "bans", ["user_id"], :name => "index_bans_on_user_id" + + create_table "comment_votes", :force => true do |t| + t.integer "comment_id", :null => false + t.integer "user_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "score", :default => 0, :null => false + end + + add_index "comment_votes", ["comment_id"], :name => "index_comment_votes_on_comment_id" + add_index "comment_votes", ["created_at"], :name => "index_comment_votes_on_created_at" + add_index "comment_votes", ["user_id"], :name => "index_comment_votes_on_user_id" + + create_table "comments", :force => true do |t| + t.datetime "created_at", :null => false + t.integer "post_id", :null => false + t.integer "creator_id" + t.text "body", :null => false + t.string "ip_addr", :limit => nil, :null => false + t.tsvector "body_index" + t.integer "score", :default => 0, :null => false + t.datetime "updated_at" + end + + add_index "comments", ["body_index"], :name => "index_comments_on_text_search_index" + add_index "comments", ["creator_id"], :name => "index_comments_on_creator_id" + add_index "comments", ["post_id"], :name => "index_comments_on_post_id" + + create_table "delayed_jobs", :force => true do |t| + t.integer "priority", :default => 0 + t.integer "attempts", :default => 0 + t.text "handler" + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["run_at"], :name => "index_delayed_jobs_on_run_at" + + create_table "dmails", :force => true do |t| + t.integer "owner_id", :null => false + t.integer "from_id", :null => false + t.integer "to_id", :null => false + t.text "title", :null => false + t.text "body", :null => false + t.tsvector "message_index", :null => false + t.boolean "is_read", :default => false, :null => false + t.boolean "is_deleted", :default => false, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "dmails", ["message_index"], :name => "index_dmails_on_message_index" + add_index "dmails", ["owner_id"], :name => "index_dmails_on_owner_id" + + create_table "favorites", :force => true do |t| + t.integer "user_id" + t.integer "post_id" + end + + create_table "favorites_0", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_0", ["post_id"], :name => "index_favorites_0_on_post_id" + add_index "favorites_0", ["user_id"], :name => "index_favorites_0_on_user_id" + + create_table "favorites_1", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_1", ["post_id"], :name => "index_favorites_1_on_post_id" + add_index "favorites_1", ["user_id"], :name => "index_favorites_1_on_user_id" + + create_table "favorites_10", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_10", ["post_id"], :name => "index_favorites_10_on_post_id" + add_index "favorites_10", ["user_id"], :name => "index_favorites_10_on_user_id" + + create_table "favorites_11", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_11", ["post_id"], :name => "index_favorites_11_on_post_id" + add_index "favorites_11", ["user_id"], :name => "index_favorites_11_on_user_id" + + create_table "favorites_12", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_12", ["post_id"], :name => "index_favorites_12_on_post_id" + add_index "favorites_12", ["user_id"], :name => "index_favorites_12_on_user_id" + + create_table "favorites_13", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_13", ["post_id"], :name => "index_favorites_13_on_post_id" + add_index "favorites_13", ["user_id"], :name => "index_favorites_13_on_user_id" + + create_table "favorites_14", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_14", ["post_id"], :name => "index_favorites_14_on_post_id" + add_index "favorites_14", ["user_id"], :name => "index_favorites_14_on_user_id" + + create_table "favorites_15", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_15", ["post_id"], :name => "index_favorites_15_on_post_id" + add_index "favorites_15", ["user_id"], :name => "index_favorites_15_on_user_id" + + create_table "favorites_16", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_16", ["post_id"], :name => "index_favorites_16_on_post_id" + add_index "favorites_16", ["user_id"], :name => "index_favorites_16_on_user_id" + + create_table "favorites_17", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_17", ["post_id"], :name => "index_favorites_17_on_post_id" + add_index "favorites_17", ["user_id"], :name => "index_favorites_17_on_user_id" + + create_table "favorites_18", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_18", ["post_id"], :name => "index_favorites_18_on_post_id" + add_index "favorites_18", ["user_id"], :name => "index_favorites_18_on_user_id" + + create_table "favorites_19", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_19", ["post_id"], :name => "index_favorites_19_on_post_id" + add_index "favorites_19", ["user_id"], :name => "index_favorites_19_on_user_id" + + create_table "favorites_2", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_2", ["post_id"], :name => "index_favorites_2_on_post_id" + add_index "favorites_2", ["user_id"], :name => "index_favorites_2_on_user_id" + + create_table "favorites_20", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_20", ["post_id"], :name => "index_favorites_20_on_post_id" + add_index "favorites_20", ["user_id"], :name => "index_favorites_20_on_user_id" + + create_table "favorites_21", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_21", ["post_id"], :name => "index_favorites_21_on_post_id" + add_index "favorites_21", ["user_id"], :name => "index_favorites_21_on_user_id" + + create_table "favorites_22", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_22", ["post_id"], :name => "index_favorites_22_on_post_id" + add_index "favorites_22", ["user_id"], :name => "index_favorites_22_on_user_id" + + create_table "favorites_23", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_23", ["post_id"], :name => "index_favorites_23_on_post_id" + add_index "favorites_23", ["user_id"], :name => "index_favorites_23_on_user_id" + + create_table "favorites_24", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_24", ["post_id"], :name => "index_favorites_24_on_post_id" + add_index "favorites_24", ["user_id"], :name => "index_favorites_24_on_user_id" + + create_table "favorites_25", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_25", ["post_id"], :name => "index_favorites_25_on_post_id" + add_index "favorites_25", ["user_id"], :name => "index_favorites_25_on_user_id" + + create_table "favorites_26", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_26", ["post_id"], :name => "index_favorites_26_on_post_id" + add_index "favorites_26", ["user_id"], :name => "index_favorites_26_on_user_id" + + create_table "favorites_27", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_27", ["post_id"], :name => "index_favorites_27_on_post_id" + add_index "favorites_27", ["user_id"], :name => "index_favorites_27_on_user_id" + + create_table "favorites_28", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_28", ["post_id"], :name => "index_favorites_28_on_post_id" + add_index "favorites_28", ["user_id"], :name => "index_favorites_28_on_user_id" + + create_table "favorites_29", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_29", ["post_id"], :name => "index_favorites_29_on_post_id" + add_index "favorites_29", ["user_id"], :name => "index_favorites_29_on_user_id" + + create_table "favorites_3", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_3", ["post_id"], :name => "index_favorites_3_on_post_id" + add_index "favorites_3", ["user_id"], :name => "index_favorites_3_on_user_id" + + create_table "favorites_30", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_30", ["post_id"], :name => "index_favorites_30_on_post_id" + add_index "favorites_30", ["user_id"], :name => "index_favorites_30_on_user_id" + + create_table "favorites_31", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_31", ["post_id"], :name => "index_favorites_31_on_post_id" + add_index "favorites_31", ["user_id"], :name => "index_favorites_31_on_user_id" + + create_table "favorites_32", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_32", ["post_id"], :name => "index_favorites_32_on_post_id" + add_index "favorites_32", ["user_id"], :name => "index_favorites_32_on_user_id" + + create_table "favorites_33", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_33", ["post_id"], :name => "index_favorites_33_on_post_id" + add_index "favorites_33", ["user_id"], :name => "index_favorites_33_on_user_id" + + create_table "favorites_34", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_34", ["post_id"], :name => "index_favorites_34_on_post_id" + add_index "favorites_34", ["user_id"], :name => "index_favorites_34_on_user_id" + + create_table "favorites_35", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_35", ["post_id"], :name => "index_favorites_35_on_post_id" + add_index "favorites_35", ["user_id"], :name => "index_favorites_35_on_user_id" + + create_table "favorites_36", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_36", ["post_id"], :name => "index_favorites_36_on_post_id" + add_index "favorites_36", ["user_id"], :name => "index_favorites_36_on_user_id" + + create_table "favorites_37", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_37", ["post_id"], :name => "index_favorites_37_on_post_id" + add_index "favorites_37", ["user_id"], :name => "index_favorites_37_on_user_id" + + create_table "favorites_38", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_38", ["post_id"], :name => "index_favorites_38_on_post_id" + add_index "favorites_38", ["user_id"], :name => "index_favorites_38_on_user_id" + + create_table "favorites_39", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_39", ["post_id"], :name => "index_favorites_39_on_post_id" + add_index "favorites_39", ["user_id"], :name => "index_favorites_39_on_user_id" + + create_table "favorites_4", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_4", ["post_id"], :name => "index_favorites_4_on_post_id" + add_index "favorites_4", ["user_id"], :name => "index_favorites_4_on_user_id" + + create_table "favorites_40", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_40", ["post_id"], :name => "index_favorites_40_on_post_id" + add_index "favorites_40", ["user_id"], :name => "index_favorites_40_on_user_id" + + create_table "favorites_41", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_41", ["post_id"], :name => "index_favorites_41_on_post_id" + add_index "favorites_41", ["user_id"], :name => "index_favorites_41_on_user_id" + + create_table "favorites_42", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_42", ["post_id"], :name => "index_favorites_42_on_post_id" + add_index "favorites_42", ["user_id"], :name => "index_favorites_42_on_user_id" + + create_table "favorites_43", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_43", ["post_id"], :name => "index_favorites_43_on_post_id" + add_index "favorites_43", ["user_id"], :name => "index_favorites_43_on_user_id" + + create_table "favorites_44", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_44", ["post_id"], :name => "index_favorites_44_on_post_id" + add_index "favorites_44", ["user_id"], :name => "index_favorites_44_on_user_id" + + create_table "favorites_45", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_45", ["post_id"], :name => "index_favorites_45_on_post_id" + add_index "favorites_45", ["user_id"], :name => "index_favorites_45_on_user_id" + + create_table "favorites_46", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_46", ["post_id"], :name => "index_favorites_46_on_post_id" + add_index "favorites_46", ["user_id"], :name => "index_favorites_46_on_user_id" + + create_table "favorites_47", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_47", ["post_id"], :name => "index_favorites_47_on_post_id" + add_index "favorites_47", ["user_id"], :name => "index_favorites_47_on_user_id" + + create_table "favorites_48", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_48", ["post_id"], :name => "index_favorites_48_on_post_id" + add_index "favorites_48", ["user_id"], :name => "index_favorites_48_on_user_id" + + create_table "favorites_49", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_49", ["post_id"], :name => "index_favorites_49_on_post_id" + add_index "favorites_49", ["user_id"], :name => "index_favorites_49_on_user_id" + + create_table "favorites_5", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_5", ["post_id"], :name => "index_favorites_5_on_post_id" + add_index "favorites_5", ["user_id"], :name => "index_favorites_5_on_user_id" + + create_table "favorites_50", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_50", ["post_id"], :name => "index_favorites_50_on_post_id" + add_index "favorites_50", ["user_id"], :name => "index_favorites_50_on_user_id" + + create_table "favorites_51", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_51", ["post_id"], :name => "index_favorites_51_on_post_id" + add_index "favorites_51", ["user_id"], :name => "index_favorites_51_on_user_id" + + create_table "favorites_52", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_52", ["post_id"], :name => "index_favorites_52_on_post_id" + add_index "favorites_52", ["user_id"], :name => "index_favorites_52_on_user_id" + + create_table "favorites_53", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_53", ["post_id"], :name => "index_favorites_53_on_post_id" + add_index "favorites_53", ["user_id"], :name => "index_favorites_53_on_user_id" + + create_table "favorites_54", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_54", ["post_id"], :name => "index_favorites_54_on_post_id" + add_index "favorites_54", ["user_id"], :name => "index_favorites_54_on_user_id" + + create_table "favorites_55", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_55", ["post_id"], :name => "index_favorites_55_on_post_id" + add_index "favorites_55", ["user_id"], :name => "index_favorites_55_on_user_id" + + create_table "favorites_56", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_56", ["post_id"], :name => "index_favorites_56_on_post_id" + add_index "favorites_56", ["user_id"], :name => "index_favorites_56_on_user_id" + + create_table "favorites_57", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_57", ["post_id"], :name => "index_favorites_57_on_post_id" + add_index "favorites_57", ["user_id"], :name => "index_favorites_57_on_user_id" + + create_table "favorites_58", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_58", ["post_id"], :name => "index_favorites_58_on_post_id" + add_index "favorites_58", ["user_id"], :name => "index_favorites_58_on_user_id" + + create_table "favorites_59", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_59", ["post_id"], :name => "index_favorites_59_on_post_id" + add_index "favorites_59", ["user_id"], :name => "index_favorites_59_on_user_id" + + create_table "favorites_6", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_6", ["post_id"], :name => "index_favorites_6_on_post_id" + add_index "favorites_6", ["user_id"], :name => "index_favorites_6_on_user_id" + + create_table "favorites_60", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_60", ["post_id"], :name => "index_favorites_60_on_post_id" + add_index "favorites_60", ["user_id"], :name => "index_favorites_60_on_user_id" + + create_table "favorites_61", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_61", ["post_id"], :name => "index_favorites_61_on_post_id" + add_index "favorites_61", ["user_id"], :name => "index_favorites_61_on_user_id" + + create_table "favorites_62", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_62", ["post_id"], :name => "index_favorites_62_on_post_id" + add_index "favorites_62", ["user_id"], :name => "index_favorites_62_on_user_id" + + create_table "favorites_63", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_63", ["post_id"], :name => "index_favorites_63_on_post_id" + add_index "favorites_63", ["user_id"], :name => "index_favorites_63_on_user_id" + + create_table "favorites_64", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_64", ["post_id"], :name => "index_favorites_64_on_post_id" + add_index "favorites_64", ["user_id"], :name => "index_favorites_64_on_user_id" + + create_table "favorites_65", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_65", ["post_id"], :name => "index_favorites_65_on_post_id" + add_index "favorites_65", ["user_id"], :name => "index_favorites_65_on_user_id" + + create_table "favorites_66", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_66", ["post_id"], :name => "index_favorites_66_on_post_id" + add_index "favorites_66", ["user_id"], :name => "index_favorites_66_on_user_id" + + create_table "favorites_67", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_67", ["post_id"], :name => "index_favorites_67_on_post_id" + add_index "favorites_67", ["user_id"], :name => "index_favorites_67_on_user_id" + + create_table "favorites_68", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_68", ["post_id"], :name => "index_favorites_68_on_post_id" + add_index "favorites_68", ["user_id"], :name => "index_favorites_68_on_user_id" + + create_table "favorites_69", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_69", ["post_id"], :name => "index_favorites_69_on_post_id" + add_index "favorites_69", ["user_id"], :name => "index_favorites_69_on_user_id" + + create_table "favorites_7", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_7", ["post_id"], :name => "index_favorites_7_on_post_id" + add_index "favorites_7", ["user_id"], :name => "index_favorites_7_on_user_id" + + create_table "favorites_70", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_70", ["post_id"], :name => "index_favorites_70_on_post_id" + add_index "favorites_70", ["user_id"], :name => "index_favorites_70_on_user_id" + + create_table "favorites_71", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_71", ["post_id"], :name => "index_favorites_71_on_post_id" + add_index "favorites_71", ["user_id"], :name => "index_favorites_71_on_user_id" + + create_table "favorites_72", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_72", ["post_id"], :name => "index_favorites_72_on_post_id" + add_index "favorites_72", ["user_id"], :name => "index_favorites_72_on_user_id" + + create_table "favorites_73", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_73", ["post_id"], :name => "index_favorites_73_on_post_id" + add_index "favorites_73", ["user_id"], :name => "index_favorites_73_on_user_id" + + create_table "favorites_74", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_74", ["post_id"], :name => "index_favorites_74_on_post_id" + add_index "favorites_74", ["user_id"], :name => "index_favorites_74_on_user_id" + + create_table "favorites_75", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_75", ["post_id"], :name => "index_favorites_75_on_post_id" + add_index "favorites_75", ["user_id"], :name => "index_favorites_75_on_user_id" + + create_table "favorites_76", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_76", ["post_id"], :name => "index_favorites_76_on_post_id" + add_index "favorites_76", ["user_id"], :name => "index_favorites_76_on_user_id" + + create_table "favorites_77", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_77", ["post_id"], :name => "index_favorites_77_on_post_id" + add_index "favorites_77", ["user_id"], :name => "index_favorites_77_on_user_id" + + create_table "favorites_78", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_78", ["post_id"], :name => "index_favorites_78_on_post_id" + add_index "favorites_78", ["user_id"], :name => "index_favorites_78_on_user_id" + + create_table "favorites_79", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_79", ["post_id"], :name => "index_favorites_79_on_post_id" + add_index "favorites_79", ["user_id"], :name => "index_favorites_79_on_user_id" + + create_table "favorites_8", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_8", ["post_id"], :name => "index_favorites_8_on_post_id" + add_index "favorites_8", ["user_id"], :name => "index_favorites_8_on_user_id" + + create_table "favorites_80", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_80", ["post_id"], :name => "index_favorites_80_on_post_id" + add_index "favorites_80", ["user_id"], :name => "index_favorites_80_on_user_id" + + create_table "favorites_81", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_81", ["post_id"], :name => "index_favorites_81_on_post_id" + add_index "favorites_81", ["user_id"], :name => "index_favorites_81_on_user_id" + + create_table "favorites_82", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_82", ["post_id"], :name => "index_favorites_82_on_post_id" + add_index "favorites_82", ["user_id"], :name => "index_favorites_82_on_user_id" + + create_table "favorites_83", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_83", ["post_id"], :name => "index_favorites_83_on_post_id" + add_index "favorites_83", ["user_id"], :name => "index_favorites_83_on_user_id" + + create_table "favorites_84", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_84", ["post_id"], :name => "index_favorites_84_on_post_id" + add_index "favorites_84", ["user_id"], :name => "index_favorites_84_on_user_id" + + create_table "favorites_85", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_85", ["post_id"], :name => "index_favorites_85_on_post_id" + add_index "favorites_85", ["user_id"], :name => "index_favorites_85_on_user_id" + + create_table "favorites_86", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_86", ["post_id"], :name => "index_favorites_86_on_post_id" + add_index "favorites_86", ["user_id"], :name => "index_favorites_86_on_user_id" + + create_table "favorites_87", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_87", ["post_id"], :name => "index_favorites_87_on_post_id" + add_index "favorites_87", ["user_id"], :name => "index_favorites_87_on_user_id" + + create_table "favorites_88", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_88", ["post_id"], :name => "index_favorites_88_on_post_id" + add_index "favorites_88", ["user_id"], :name => "index_favorites_88_on_user_id" + + create_table "favorites_89", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_89", ["post_id"], :name => "index_favorites_89_on_post_id" + add_index "favorites_89", ["user_id"], :name => "index_favorites_89_on_user_id" + + create_table "favorites_9", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_9", ["post_id"], :name => "index_favorites_9_on_post_id" + add_index "favorites_9", ["user_id"], :name => "index_favorites_9_on_user_id" + + create_table "favorites_90", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_90", ["post_id"], :name => "index_favorites_90_on_post_id" + add_index "favorites_90", ["user_id"], :name => "index_favorites_90_on_user_id" + + create_table "favorites_91", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_91", ["post_id"], :name => "index_favorites_91_on_post_id" + add_index "favorites_91", ["user_id"], :name => "index_favorites_91_on_user_id" + + create_table "favorites_92", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_92", ["post_id"], :name => "index_favorites_92_on_post_id" + add_index "favorites_92", ["user_id"], :name => "index_favorites_92_on_user_id" + + create_table "favorites_93", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_93", ["post_id"], :name => "index_favorites_93_on_post_id" + add_index "favorites_93", ["user_id"], :name => "index_favorites_93_on_user_id" + + create_table "favorites_94", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_94", ["post_id"], :name => "index_favorites_94_on_post_id" + add_index "favorites_94", ["user_id"], :name => "index_favorites_94_on_user_id" + + create_table "favorites_95", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_95", ["post_id"], :name => "index_favorites_95_on_post_id" + add_index "favorites_95", ["user_id"], :name => "index_favorites_95_on_user_id" + + create_table "favorites_96", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_96", ["post_id"], :name => "index_favorites_96_on_post_id" + add_index "favorites_96", ["user_id"], :name => "index_favorites_96_on_user_id" + + create_table "favorites_97", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_97", ["post_id"], :name => "index_favorites_97_on_post_id" + add_index "favorites_97", ["user_id"], :name => "index_favorites_97_on_user_id" + + create_table "favorites_98", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_98", ["post_id"], :name => "index_favorites_98_on_post_id" + add_index "favorites_98", ["user_id"], :name => "index_favorites_98_on_user_id" + + create_table "favorites_99", :id => false, :force => true do |t| + t.integer "id", :null => false + t.integer "user_id" + t.integer "post_id" + end + + add_index "favorites_99", ["post_id"], :name => "index_favorites_99_on_post_id" + add_index "favorites_99", ["user_id"], :name => "index_favorites_99_on_user_id" + + create_table "forum_posts", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "creator_id" + t.text "body", :null => false + t.integer "updater_id" + t.tsvector "text_index" + t.boolean "is_deleted", :default => false, :null => false + t.integer "topic_id" + end + + add_index "forum_posts", ["creator_id"], :name => "index_forum_posts_on_creator_id" + add_index "forum_posts", ["text_index"], :name => "index_forum_posts_on_text_index" + add_index "forum_posts", ["topic_id"], :name => "index_forum_posts_on_topic_id" + add_index "forum_posts", ["updated_at"], :name => "index_forum_posts_on_updated_at" + + create_table "forum_topics", :force => true do |t| + t.integer "creator_id", :null => false + t.integer "updater_id", :null => false + t.string "title", :null => false + t.integer "response_count", :default => 0, :null => false + t.boolean "is_sticky", :default => false, :null => false + t.boolean "is_locked", :default => false, :null => false + t.tsvector "text_index", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "is_deleted", :default => false, :null => false + end + + add_index "forum_topics", ["creator_id"], :name => "index_forum_topics_on_creator_id" + add_index "forum_topics", ["text_index"], :name => "index_forum_topics_on_text_index" + + create_table "ip_bans", :force => true do |t| + t.integer "creator_id", :null => false + t.string "ip_addr", :limit => nil, :null => false + t.text "reason" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "ip_bans", ["ip_addr"], :name => "index_ip_bans_on_ip_addr" + + create_table "janitor_trials", :force => true do |t| + t.integer "user_id", :null => false + t.integer "original_level", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "creator_id", :default => 1, :null => false + end + + add_index "janitor_trials", ["user_id"], :name => "index_janitor_trials_on_creator_id" + + create_table "mod_actions", :force => true do |t| + t.integer "creator_id" + t.text "description" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "mod_actions", ["created_at"], :name => "index_mod_actions_on_created_at" + add_index "mod_actions", ["creator_id"], :name => "index_mod_actions_on_creator_id" + + create_table "news_updates", :force => true do |t| + t.text "message", :null => false + t.integer "creator_id", :null => false + t.integer "updater_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "news_updates", ["created_at"], :name => "index_news_updates_on_created_at" + + create_table "note_versions", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "x", :null => false + t.integer "y", :null => false + t.integer "width", :null => false + t.integer "height", :null => false + t.text "body", :null => false + t.string "updater_ip_addr", :limit => nil, :null => false + t.boolean "is_active", :default => true, :null => false + t.integer "note_id", :null => false + t.integer "post_id", :null => false + t.integer "updater_id" + end + + add_index "note_versions", ["note_id"], :name => "index_note_versions_on_note_id" + add_index "note_versions", ["post_id"], :name => "index_note_versions_on_post_id" + add_index "note_versions", ["updater_id"], :name => "index_note_versions_on_updater_id" + add_index "note_versions", ["updater_ip_addr"], :name => "index_note_versions_on_updater_ip_addr" + + create_table "notes", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "creator_id" + t.integer "x", :null => false + t.integer "y", :null => false + t.integer "width", :null => false + t.integer "height", :null => false + t.boolean "is_active", :default => true, :null => false + t.integer "post_id", :null => false + t.text "body", :null => false + t.tsvector "body_index" + end + + add_index "notes", ["body_index"], :name => "index_notes_on_body_index" + add_index "notes", ["creator_id"], :name => "index_notes_on_creator_id" + add_index "notes", ["post_id"], :name => "index_notes_on_post_id" + + create_table "pool_versions", :force => true do |t| + t.integer "pool_id", :null => false + t.text "post_ids", :default => "", :null => false + t.integer "updater_id" + t.string "updater_ip_addr", :limit => nil + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "pool_versions", ["pool_id"], :name => "index_pool_versions_on_pool_id" + add_index "pool_versions", ["updater_id"], :name => "index_pool_versions_on_updater_id" + add_index "pool_versions", ["updater_ip_addr"], :name => "index_pool_versions_on_updater_ip_addr" + + create_table "pools", :force => true do |t| + t.text "name", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "creator_id", :null => false + t.integer "post_count", :default => 0, :null => false + t.text "description", :default => "", :null => false + t.boolean "is_active", :default => true, :null => false + t.boolean "is_deleted", :default => false, :null => false + t.text "post_ids", :default => "", :null => false + end + + add_index "pools", ["creator_id"], :name => "index_pools_on_creator_id" + + create_table "post_appeals", :force => true do |t| + t.integer "post_id" + t.integer "creator_id" + t.string "reason" + t.string "creator_ip_addr", :limit => nil + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "post_appeals", ["created_at"], :name => "index_post_appeals_on_created_at" + add_index "post_appeals", ["creator_id"], :name => "index_post_appeals_on_creator_id" + add_index "post_appeals", ["creator_ip_addr"], :name => "index_post_appeals_on_creator_ip_addr" + add_index "post_appeals", ["post_id"], :name => "index_post_appeals_on_post_id" + + create_table "post_disapprovals", :force => true do |t| + t.integer "user_id", :null => false + t.integer "post_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "post_disapprovals", ["post_id"], :name => "index_post_disapprovals_on_post_id" + add_index "post_disapprovals", ["user_id"], :name => "index_post_disapprovals_on_user_id" + + create_table "post_flags", :force => true do |t| + t.datetime "created_at", :null => false + t.integer "post_id", :null => false + t.text "reason", :null => false + t.integer "creator_id", :null => false + t.boolean "is_resolved", :null => false + t.string "creator_ip_addr", :limit => nil, :default => "127.0.0.1", :null => false + t.datetime "updated_at", :null => false + end + + add_index "post_flags", ["creator_id"], :name => "index_post_flags_on_creator_id" + add_index "post_flags", ["creator_ip_addr"], :name => "index_post_flags_on_creator_ip_addr" + add_index "post_flags", ["post_id"], :name => "index_post_flags_on_post_id" + + create_table "post_versions", :force => true do |t| + t.integer "post_id", :null => false + t.text "tags", :null => false + t.integer "updater_id" + t.string "updater_ip_addr", :limit => nil, :null => false + t.datetime "updated_at", :null => false + t.string "rating", :limit => 1 + t.integer "parent_id" + t.text "source" + end + + add_index "post_versions", ["post_id"], :name => "index_post_versions_on_post_id" + add_index "post_versions", ["updater_id"], :name => "index_post_versions_on_updater_id" + add_index "post_versions", ["updater_ip_addr"], :name => "index_post_versions_on_updater_ip_addr" + + create_table "post_votes", :force => true do |t| + t.integer "post_id", :null => false + t.integer "user_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "score", :default => 0, :null => false + end + + add_index "post_votes", ["created_at"], :name => "index_post_votes_on_created_at" + add_index "post_votes", ["post_id"], :name => "index_post_votes_on_post_id" + add_index "post_votes", ["user_id"], :name => "index_post_votes_on_user_id" + + create_table "posts", :force => true do |t| + t.datetime "created_at", :null => false + t.integer "uploader_id" + t.integer "score", :default => 0, :null => false + t.text "source" + t.text "md5", :null => false + t.datetime "last_commented_at" + t.string "rating", :limit => 1, :default => "q", :null => false + t.integer "image_width" + t.integer "image_height" + t.string "uploader_ip_addr", :limit => nil, :null => false + t.text "tag_string", :default => "", :null => false + t.boolean "is_note_locked", :default => false, :null => false + t.integer "fav_count", :default => 0, :null => false + t.text "file_ext", :default => "", :null => false + t.datetime "last_noted_at" + t.boolean "is_rating_locked", :default => false, :null => false + t.integer "parent_id" + t.boolean "has_children", :default => false, :null => false + t.integer "approver_id" + t.tsvector "tag_index" + t.integer "tag_count_general", :default => 0, :null => false + t.integer "tag_count_artist", :default => 0, :null => false + t.integer "tag_count_character", :default => 0, :null => false + t.integer "tag_count_copyright", :default => 0, :null => false + t.integer "file_size" + t.boolean "is_status_locked", :default => false, :null => false + t.text "fav_string", :default => "", :null => false + t.text "pool_string", :default => "", :null => false + t.integer "up_score", :default => 0, :null => false + t.integer "down_score", :default => 0, :null => false + t.boolean "is_pending", :default => false, :null => false + t.boolean "is_flagged", :default => false, :null => false + t.boolean "is_deleted", :default => false, :null => false + t.integer "tag_count", :default => 0, :null => false + t.datetime "updated_at" + end + + add_index "posts", ["approver_id"], :name => "index_posts_on_approver_id" + add_index "posts", ["created_at"], :name => "index_posts_on_created_at" + add_index "posts", ["file_size"], :name => "index_posts_on_file_size" + add_index "posts", ["image_height"], :name => "index_posts_on_image_height" + add_index "posts", ["image_width"], :name => "index_posts_on_image_width" + add_index "posts", ["last_commented_at"], :name => "index_posts_on_last_commented_at" + add_index "posts", ["last_noted_at"], :name => "index_posts_on_last_noted_at" + add_index "posts", ["md5"], :name => "index_posts_on_md5", :unique => true + add_index "posts", ["parent_id"], :name => "index_posts_on_parent_id" + add_index "posts", ["source"], :name => "index_posts_on_source" + add_index "posts", ["source"], :name => "index_posts_on_source_pattern" + add_index "posts", ["tag_index"], :name => "index_posts_on_tag_index" + add_index "posts", ["uploader_id"], :name => "index_posts_on_uploader_id" + add_index "posts", ["uploader_ip_addr"], :name => "index_posts_on_uploader_ip_addr" + + create_table "tag_aliases", :force => true do |t| + t.text "antecedent_name", :null => false + t.text "reason", :default => "", :null => false + t.integer "creator_id" + t.string "consequent_name", :default => "", :null => false + t.string "status", :default => "active", :null => false + t.integer "forum_topic_id" + t.string "creator_ip_addr", :limit => nil, :default => "127.0.0.1", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "tag_aliases", ["antecedent_name"], :name => "index_tag_aliases_on_antecedent_name", :unique => true + add_index "tag_aliases", ["consequent_name"], :name => "index_tag_aliases_on_consequent_name" + + create_table "tag_implications", :force => true do |t| + t.text "reason", :default => "", :null => false + t.integer "creator_id" + t.string "antecedent_name", :default => "", :null => false + t.string "consequent_name", :default => "", :null => false + t.text "descendant_names", :default => "", :null => false + t.string "creator_ip_addr", :limit => nil, :default => "127.0.0.1", :null => false + t.string "status", :default => "active", :null => false + t.integer "forum_topic_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "tag_subscriptions", :force => true do |t| + t.integer "creator_id", :null => false + t.text "tag_query", :null => false + t.text "post_ids", :default => "", :null => false + t.string "name", :default => "General", :null => false + t.boolean "is_public", :default => true, :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "last_accessed_at" + t.boolean "is_opted_in", :default => false, :null => false + end + + add_index "tag_subscriptions", ["creator_id"], :name => "index_tag_subscriptions_on_creator_id" + add_index "tag_subscriptions", ["name"], :name => "index_tag_subscriptions_on_name" + + create_table "tags", :force => true do |t| + t.text "name", :null => false + t.integer "post_count", :default => 0, :null => false + t.text "related_tags" + t.datetime "related_tags_updated_at" + t.integer "category", :limit => 2, :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true + add_index "tags", ["name"], :name => "index_tags_on_name_pattern" + add_index "tags", ["post_count"], :name => "index_tags_on_post_count" + + create_table "uploads", :force => true do |t| + t.string "source" + t.string "file_path" + t.string "content_type" + t.string "rating", :limit => 1, :null => false + t.integer "uploader_id", :null => false + t.string "uploader_ip_addr", :limit => nil, :null => false + t.text "tag_string", :null => false + t.text "status", :default => "pending", :null => false + t.text "backtrace" + t.integer "post_id" + t.string "md5_confirmation" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "uploads", ["uploader_id"], :name => "index_uploads_on_uploader_id" + add_index "uploads", ["uploader_ip_addr"], :name => "index_uploads_on_uploader_ip_addr" + + create_table "user_feedback", :force => true do |t| + t.integer "user_id", :null => false + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.text "body", :null => false + t.string "category", :default => "", :null => false + t.datetime "updated_at" + end + + add_index "user_feedback", ["user_id"], :name => "index_user_feedback_on_user_id" + + create_table "user_password_reset_nonces", :force => true do |t| + t.string "key", :null => false + t.string "email", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "users", :force => true do |t| + t.text "name", :null => false + t.text "password_hash", :null => false + t.integer "level", :default => 0, :null => false + t.text "email", :default => "", :null => false + t.text "recent_tags", :default => "", :null => false + t.boolean "always_resize_images", :default => false, :null => false + t.integer "inviter_id" + t.datetime "created_at", :null => false + t.datetime "last_logged_in_at" + t.datetime "last_forum_read_at", :default => '1960-01-01 00:00:00' + t.boolean "has_mail", :default => false, :null => false + t.boolean "receive_email_notifications", :default => false, :null => false + t.integer "base_upload_limit" + t.integer "comment_threshold", :default => 0, :null => false + t.datetime "updated_at" + t.string "email_verification_key" + t.boolean "is_banned", :default => false, :null => false + t.string "default_image_size", :default => "large", :null => false + t.text "favorite_tags" + t.text "blacklisted_tags" + t.string "time_zone", :default => "Eastern Time (US & Canada)", :null => false + t.integer "post_update_count", :default => 0, :null => false + t.integer "note_update_count", :default => 0, :null => false + t.integer "favorite_count", :default => 0, :null => false + t.integer "post_upload_count", :default => 0, :null => false + end + + add_index "users", ["email"], :name => "index_users_on_email" + add_index "users", ["inviter_id"], :name => "index_users_on_inviter_id" + + create_table "wiki_page_versions", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "title", :null => false + t.text "body", :null => false + t.integer "updater_id" + t.string "updater_ip_addr", :limit => nil, :null => false + t.integer "wiki_page_id", :null => false + t.boolean "is_locked", :default => false, :null => false + end + + add_index "wiki_page_versions", ["updater_id"], :name => "index_wiki_page_versions_on_updater_id" + add_index "wiki_page_versions", ["wiki_page_id"], :name => "index_wiki_page_versions_on_wiki_page_id" + + create_table "wiki_pages", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "title", :null => false + t.text "body", :null => false + t.integer "creator_id" + t.boolean "is_locked", :default => false, :null => false + t.tsvector "body_index" + end + + add_index "wiki_pages", ["body_index"], :name => "index_wiki_pages_on_body_index" + add_index "wiki_pages", ["title"], :name => "index_wiki_pages_on_title", :unique => true + add_index "wiki_pages", ["title"], :name => "index_wiki_pages_on_title_pattern" + add_index "wiki_pages", ["updated_at"], :name => "index_wiki_pages_on_updated_at" + +end diff --git a/db/structure.sql b/db/structure.sql index 7e92d0572..185f9b83b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -4,26 +4,46 @@ SET statement_timeout = 0; SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; +SET standard_conforming_strings = off; SET check_function_bodies = false; SET client_min_messages = warning; +SET escape_string_warning = off; -- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - +-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: - -- -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; +CREATE PROCEDURAL LANGUAGE plpgsql; SET search_path = public, pg_catalog; +-- +-- Name: post_status; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE post_status AS ENUM ( + 'deleted', + 'flagged', + 'pending', + 'active' +); + + +-- +-- Name: block_delete(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION block_delete() RETURNS trigger + LANGUAGE plpgsql + AS $$ +begin + RAISE EXCEPTION 'Attempted to delete from note table'; + RETURN NULL; +end; +$$; + + -- -- Name: favorites_insert_trigger(); Type: FUNCTION; Schema: public; Owner: - -- @@ -34,7 +54,8 @@ CREATE FUNCTION favorites_insert_trigger() RETURNS trigger begin if (NEW.user_id % 100 = 0) then insert into favorites_0 values (NEW.*); - elsif (NEW.user_id % 100 = 1) then + + elsif (NEW.user_id % 100 = 1) then insert into favorites_1 values (NEW.*); elsif (NEW.user_id % 100 = 2) then @@ -337,6 +358,28 @@ CREATE FUNCTION favorites_insert_trigger() RETURNS trigger $$; +-- +-- Name: notes_block_delete(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION notes_block_delete() RETURNS trigger + LANGUAGE plpgsql + AS $$ +begin + raise exception 'cannot delete note'; +end; +$$; + + +-- +-- Name: rlike(text, text); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION rlike(text, text) RETURNS boolean + LANGUAGE sql IMMUTABLE STRICT + AS $_$select $2 like $1$_$; + + -- -- Name: testprs_end(internal); Type: FUNCTION; Schema: public; Owner: - -- @@ -373,6 +416,18 @@ CREATE FUNCTION testprs_start(internal, integer) RETURNS internal AS '$libdir/test_parser', 'testprs_start'; +-- +-- Name: ~~~; Type: OPERATOR; Schema: public; Owner: - +-- + +CREATE OPERATOR ~~~ ( + PROCEDURE = rlike, + LEFTARG = text, + RIGHTARG = text, + COMMUTATOR = ~~ +); + + -- -- Name: testparser; Type: TEXT SEARCH PARSER; Schema: public; Owner: - -- @@ -406,10 +461,10 @@ SET default_with_oids = false; CREATE TABLE advertisement_hits ( id integer NOT NULL, - advertisement_id integer NOT NULL, - ip_addr inet NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + advertisement_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + ip_addr inet ); @@ -420,8 +475,8 @@ CREATE TABLE advertisement_hits ( CREATE SEQUENCE advertisement_hits_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -438,16 +493,15 @@ ALTER SEQUENCE advertisement_hits_id_seq OWNED BY advertisement_hits.id; CREATE TABLE advertisements ( id integer NOT NULL, - referral_url text NOT NULL, + referral_url character varying(1000) NOT NULL, ad_type character varying(255) NOT NULL, status character varying(255) NOT NULL, hit_count integer DEFAULT 0 NOT NULL, width integer NOT NULL, height integer NOT NULL, - file_name character varying(255) NOT NULL, is_work_safe boolean DEFAULT false NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + file_name character varying(255), + created_at timestamp without time zone ); @@ -458,8 +512,8 @@ CREATE TABLE advertisements ( CREATE SEQUENCE advertisements_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -477,8 +531,8 @@ ALTER SEQUENCE advertisements_id_seq OWNED BY advertisements.id; CREATE TABLE amazon_backups ( id integer NOT NULL, last_id integer, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -489,8 +543,8 @@ CREATE TABLE amazon_backups ( CREATE SEQUENCE amazon_backups_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -510,8 +564,8 @@ CREATE TABLE artist_urls ( artist_id integer NOT NULL, url text NOT NULL, normalized_url text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone DEFAULT now() NOT NULL, + updated_at timestamp without time zone DEFAULT now() NOT NULL ); @@ -522,8 +576,8 @@ CREATE TABLE artist_urls ( CREATE SEQUENCE artist_urls_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -540,17 +594,17 @@ ALTER SEQUENCE artist_urls_id_seq OWNED BY artist_urls.id; CREATE TABLE artist_versions ( id integer NOT NULL, - artist_id integer NOT NULL, - name character varying(255) NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - is_active boolean DEFAULT true NOT NULL, - other_names text, - group_name character varying(255), + artist_id integer, + name text, + updater_id integer, url_string text, + created_at timestamp without time zone, + updated_at timestamp without time zone, + is_active boolean DEFAULT true NOT NULL, + group_name character varying(255), is_banned boolean DEFAULT false NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updater_ip_addr inet DEFAULT '127.0.0.1'::inet, + other_names text DEFAULT ''::text ); @@ -561,8 +615,8 @@ CREATE TABLE artist_versions ( CREATE SEQUENCE artist_versions_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -579,15 +633,15 @@ ALTER SEQUENCE artist_versions_id_seq OWNED BY artist_versions.id; CREATE TABLE artists ( id integer NOT NULL, - name character varying(255) NOT NULL, - creator_id integer NOT NULL, + created_at timestamp without time zone DEFAULT now() NOT NULL, + name text NOT NULL, + updated_at timestamp without time zone DEFAULT now() NOT NULL, + creator_id integer, is_active boolean DEFAULT true NOT NULL, - is_banned boolean DEFAULT false NOT NULL, - other_names text, - other_names_index tsvector, group_name character varying(255), - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + is_banned boolean DEFAULT false NOT NULL, + other_names text DEFAULT ''::text, + other_names_index tsvector ); @@ -598,8 +652,8 @@ CREATE TABLE artists ( CREATE SEQUENCE artists_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -616,12 +670,12 @@ ALTER SEQUENCE artists_id_seq OWNED BY artists.id; CREATE TABLE bans ( id integer NOT NULL, - user_id integer, + user_id integer NOT NULL, reason text NOT NULL, - banner_id integer NOT NULL, expires_at timestamp without time zone NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + banner_id integer NOT NULL, + created_at timestamp without time zone DEFAULT now() NOT NULL, + updated_at timestamp without time zone DEFAULT now() NOT NULL ); @@ -632,8 +686,8 @@ CREATE TABLE bans ( CREATE SEQUENCE bans_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -652,9 +706,9 @@ CREATE TABLE comment_votes ( id integer NOT NULL, comment_id integer NOT NULL, user_id integer NOT NULL, - score integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone, + score integer DEFAULT 0 NOT NULL ); @@ -665,8 +719,8 @@ CREATE TABLE comment_votes ( CREATE SEQUENCE comment_votes_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -683,14 +737,14 @@ ALTER SEQUENCE comment_votes_id_seq OWNED BY comment_votes.id; CREATE TABLE comments ( id integer NOT NULL, + created_at timestamp without time zone NOT NULL, post_id integer NOT NULL, - creator_id integer NOT NULL, + creator_id integer, body text NOT NULL, ip_addr inet NOT NULL, - body_index tsvector NOT NULL, + body_index tsvector, score integer DEFAULT 0 NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updated_at timestamp without time zone ); @@ -701,8 +755,8 @@ CREATE TABLE comments ( CREATE SEQUENCE comments_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -727,8 +781,8 @@ CREATE TABLE delayed_jobs ( locked_at timestamp without time zone, failed_at timestamp without time zone, locked_by character varying(255), - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -739,8 +793,8 @@ CREATE TABLE delayed_jobs ( CREATE SEQUENCE delayed_jobs_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -765,8 +819,8 @@ CREATE TABLE dmails ( message_index tsvector NOT NULL, is_read boolean DEFAULT false NOT NULL, is_deleted boolean DEFAULT false NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -777,8 +831,8 @@ CREATE TABLE dmails ( CREATE SEQUENCE dmails_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -804,8 +858,7 @@ CREATE TABLE favorites ( -- Name: favorites_0; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_0 ( - CONSTRAINT favorites_0_user_id_check CHECK (((user_id % 100) = 0)) +CREATE TABLE favorites_0 (CONSTRAINT favorites_0_user_id_check CHECK (((user_id % 100) = 0)) ) INHERITS (favorites); @@ -814,8 +867,7 @@ INHERITS (favorites); -- Name: favorites_1; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_1 ( - CONSTRAINT favorites_1_user_id_check CHECK (((user_id % 100) = 1)) +CREATE TABLE favorites_1 (CONSTRAINT favorites_1_user_id_check CHECK (((user_id % 100) = 1)) ) INHERITS (favorites); @@ -824,8 +876,7 @@ INHERITS (favorites); -- Name: favorites_10; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_10 ( - CONSTRAINT favorites_10_user_id_check CHECK (((user_id % 100) = 10)) +CREATE TABLE favorites_10 (CONSTRAINT favorites_10_user_id_check CHECK (((user_id % 100) = 10)) ) INHERITS (favorites); @@ -834,8 +885,7 @@ INHERITS (favorites); -- Name: favorites_11; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_11 ( - CONSTRAINT favorites_11_user_id_check CHECK (((user_id % 100) = 11)) +CREATE TABLE favorites_11 (CONSTRAINT favorites_11_user_id_check CHECK (((user_id % 100) = 11)) ) INHERITS (favorites); @@ -844,8 +894,7 @@ INHERITS (favorites); -- Name: favorites_12; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_12 ( - CONSTRAINT favorites_12_user_id_check CHECK (((user_id % 100) = 12)) +CREATE TABLE favorites_12 (CONSTRAINT favorites_12_user_id_check CHECK (((user_id % 100) = 12)) ) INHERITS (favorites); @@ -854,8 +903,7 @@ INHERITS (favorites); -- Name: favorites_13; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_13 ( - CONSTRAINT favorites_13_user_id_check CHECK (((user_id % 100) = 13)) +CREATE TABLE favorites_13 (CONSTRAINT favorites_13_user_id_check CHECK (((user_id % 100) = 13)) ) INHERITS (favorites); @@ -864,8 +912,7 @@ INHERITS (favorites); -- Name: favorites_14; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_14 ( - CONSTRAINT favorites_14_user_id_check CHECK (((user_id % 100) = 14)) +CREATE TABLE favorites_14 (CONSTRAINT favorites_14_user_id_check CHECK (((user_id % 100) = 14)) ) INHERITS (favorites); @@ -874,8 +921,7 @@ INHERITS (favorites); -- Name: favorites_15; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_15 ( - CONSTRAINT favorites_15_user_id_check CHECK (((user_id % 100) = 15)) +CREATE TABLE favorites_15 (CONSTRAINT favorites_15_user_id_check CHECK (((user_id % 100) = 15)) ) INHERITS (favorites); @@ -884,8 +930,7 @@ INHERITS (favorites); -- Name: favorites_16; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_16 ( - CONSTRAINT favorites_16_user_id_check CHECK (((user_id % 100) = 16)) +CREATE TABLE favorites_16 (CONSTRAINT favorites_16_user_id_check CHECK (((user_id % 100) = 16)) ) INHERITS (favorites); @@ -894,8 +939,7 @@ INHERITS (favorites); -- Name: favorites_17; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_17 ( - CONSTRAINT favorites_17_user_id_check CHECK (((user_id % 100) = 17)) +CREATE TABLE favorites_17 (CONSTRAINT favorites_17_user_id_check CHECK (((user_id % 100) = 17)) ) INHERITS (favorites); @@ -904,8 +948,7 @@ INHERITS (favorites); -- Name: favorites_18; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_18 ( - CONSTRAINT favorites_18_user_id_check CHECK (((user_id % 100) = 18)) +CREATE TABLE favorites_18 (CONSTRAINT favorites_18_user_id_check CHECK (((user_id % 100) = 18)) ) INHERITS (favorites); @@ -914,8 +957,7 @@ INHERITS (favorites); -- Name: favorites_19; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_19 ( - CONSTRAINT favorites_19_user_id_check CHECK (((user_id % 100) = 19)) +CREATE TABLE favorites_19 (CONSTRAINT favorites_19_user_id_check CHECK (((user_id % 100) = 19)) ) INHERITS (favorites); @@ -924,8 +966,7 @@ INHERITS (favorites); -- Name: favorites_2; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_2 ( - CONSTRAINT favorites_2_user_id_check CHECK (((user_id % 100) = 2)) +CREATE TABLE favorites_2 (CONSTRAINT favorites_2_user_id_check CHECK (((user_id % 100) = 2)) ) INHERITS (favorites); @@ -934,8 +975,7 @@ INHERITS (favorites); -- Name: favorites_20; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_20 ( - CONSTRAINT favorites_20_user_id_check CHECK (((user_id % 100) = 20)) +CREATE TABLE favorites_20 (CONSTRAINT favorites_20_user_id_check CHECK (((user_id % 100) = 20)) ) INHERITS (favorites); @@ -944,8 +984,7 @@ INHERITS (favorites); -- Name: favorites_21; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_21 ( - CONSTRAINT favorites_21_user_id_check CHECK (((user_id % 100) = 21)) +CREATE TABLE favorites_21 (CONSTRAINT favorites_21_user_id_check CHECK (((user_id % 100) = 21)) ) INHERITS (favorites); @@ -954,8 +993,7 @@ INHERITS (favorites); -- Name: favorites_22; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_22 ( - CONSTRAINT favorites_22_user_id_check CHECK (((user_id % 100) = 22)) +CREATE TABLE favorites_22 (CONSTRAINT favorites_22_user_id_check CHECK (((user_id % 100) = 22)) ) INHERITS (favorites); @@ -964,8 +1002,7 @@ INHERITS (favorites); -- Name: favorites_23; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_23 ( - CONSTRAINT favorites_23_user_id_check CHECK (((user_id % 100) = 23)) +CREATE TABLE favorites_23 (CONSTRAINT favorites_23_user_id_check CHECK (((user_id % 100) = 23)) ) INHERITS (favorites); @@ -974,8 +1011,7 @@ INHERITS (favorites); -- Name: favorites_24; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_24 ( - CONSTRAINT favorites_24_user_id_check CHECK (((user_id % 100) = 24)) +CREATE TABLE favorites_24 (CONSTRAINT favorites_24_user_id_check CHECK (((user_id % 100) = 24)) ) INHERITS (favorites); @@ -984,8 +1020,7 @@ INHERITS (favorites); -- Name: favorites_25; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_25 ( - CONSTRAINT favorites_25_user_id_check CHECK (((user_id % 100) = 25)) +CREATE TABLE favorites_25 (CONSTRAINT favorites_25_user_id_check CHECK (((user_id % 100) = 25)) ) INHERITS (favorites); @@ -994,8 +1029,7 @@ INHERITS (favorites); -- Name: favorites_26; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_26 ( - CONSTRAINT favorites_26_user_id_check CHECK (((user_id % 100) = 26)) +CREATE TABLE favorites_26 (CONSTRAINT favorites_26_user_id_check CHECK (((user_id % 100) = 26)) ) INHERITS (favorites); @@ -1004,8 +1038,7 @@ INHERITS (favorites); -- Name: favorites_27; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_27 ( - CONSTRAINT favorites_27_user_id_check CHECK (((user_id % 100) = 27)) +CREATE TABLE favorites_27 (CONSTRAINT favorites_27_user_id_check CHECK (((user_id % 100) = 27)) ) INHERITS (favorites); @@ -1014,8 +1047,7 @@ INHERITS (favorites); -- Name: favorites_28; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_28 ( - CONSTRAINT favorites_28_user_id_check CHECK (((user_id % 100) = 28)) +CREATE TABLE favorites_28 (CONSTRAINT favorites_28_user_id_check CHECK (((user_id % 100) = 28)) ) INHERITS (favorites); @@ -1024,8 +1056,7 @@ INHERITS (favorites); -- Name: favorites_29; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_29 ( - CONSTRAINT favorites_29_user_id_check CHECK (((user_id % 100) = 29)) +CREATE TABLE favorites_29 (CONSTRAINT favorites_29_user_id_check CHECK (((user_id % 100) = 29)) ) INHERITS (favorites); @@ -1034,8 +1065,7 @@ INHERITS (favorites); -- Name: favorites_3; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_3 ( - CONSTRAINT favorites_3_user_id_check CHECK (((user_id % 100) = 3)) +CREATE TABLE favorites_3 (CONSTRAINT favorites_3_user_id_check CHECK (((user_id % 100) = 3)) ) INHERITS (favorites); @@ -1044,8 +1074,7 @@ INHERITS (favorites); -- Name: favorites_30; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_30 ( - CONSTRAINT favorites_30_user_id_check CHECK (((user_id % 100) = 30)) +CREATE TABLE favorites_30 (CONSTRAINT favorites_30_user_id_check CHECK (((user_id % 100) = 30)) ) INHERITS (favorites); @@ -1054,8 +1083,7 @@ INHERITS (favorites); -- Name: favorites_31; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_31 ( - CONSTRAINT favorites_31_user_id_check CHECK (((user_id % 100) = 31)) +CREATE TABLE favorites_31 (CONSTRAINT favorites_31_user_id_check CHECK (((user_id % 100) = 31)) ) INHERITS (favorites); @@ -1064,8 +1092,7 @@ INHERITS (favorites); -- Name: favorites_32; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_32 ( - CONSTRAINT favorites_32_user_id_check CHECK (((user_id % 100) = 32)) +CREATE TABLE favorites_32 (CONSTRAINT favorites_32_user_id_check CHECK (((user_id % 100) = 32)) ) INHERITS (favorites); @@ -1074,8 +1101,7 @@ INHERITS (favorites); -- Name: favorites_33; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_33 ( - CONSTRAINT favorites_33_user_id_check CHECK (((user_id % 100) = 33)) +CREATE TABLE favorites_33 (CONSTRAINT favorites_33_user_id_check CHECK (((user_id % 100) = 33)) ) INHERITS (favorites); @@ -1084,8 +1110,7 @@ INHERITS (favorites); -- Name: favorites_34; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_34 ( - CONSTRAINT favorites_34_user_id_check CHECK (((user_id % 100) = 34)) +CREATE TABLE favorites_34 (CONSTRAINT favorites_34_user_id_check CHECK (((user_id % 100) = 34)) ) INHERITS (favorites); @@ -1094,8 +1119,7 @@ INHERITS (favorites); -- Name: favorites_35; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_35 ( - CONSTRAINT favorites_35_user_id_check CHECK (((user_id % 100) = 35)) +CREATE TABLE favorites_35 (CONSTRAINT favorites_35_user_id_check CHECK (((user_id % 100) = 35)) ) INHERITS (favorites); @@ -1104,8 +1128,7 @@ INHERITS (favorites); -- Name: favorites_36; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_36 ( - CONSTRAINT favorites_36_user_id_check CHECK (((user_id % 100) = 36)) +CREATE TABLE favorites_36 (CONSTRAINT favorites_36_user_id_check CHECK (((user_id % 100) = 36)) ) INHERITS (favorites); @@ -1114,8 +1137,7 @@ INHERITS (favorites); -- Name: favorites_37; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_37 ( - CONSTRAINT favorites_37_user_id_check CHECK (((user_id % 100) = 37)) +CREATE TABLE favorites_37 (CONSTRAINT favorites_37_user_id_check CHECK (((user_id % 100) = 37)) ) INHERITS (favorites); @@ -1124,8 +1146,7 @@ INHERITS (favorites); -- Name: favorites_38; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_38 ( - CONSTRAINT favorites_38_user_id_check CHECK (((user_id % 100) = 38)) +CREATE TABLE favorites_38 (CONSTRAINT favorites_38_user_id_check CHECK (((user_id % 100) = 38)) ) INHERITS (favorites); @@ -1134,8 +1155,7 @@ INHERITS (favorites); -- Name: favorites_39; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_39 ( - CONSTRAINT favorites_39_user_id_check CHECK (((user_id % 100) = 39)) +CREATE TABLE favorites_39 (CONSTRAINT favorites_39_user_id_check CHECK (((user_id % 100) = 39)) ) INHERITS (favorites); @@ -1144,8 +1164,7 @@ INHERITS (favorites); -- Name: favorites_4; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_4 ( - CONSTRAINT favorites_4_user_id_check CHECK (((user_id % 100) = 4)) +CREATE TABLE favorites_4 (CONSTRAINT favorites_4_user_id_check CHECK (((user_id % 100) = 4)) ) INHERITS (favorites); @@ -1154,8 +1173,7 @@ INHERITS (favorites); -- Name: favorites_40; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_40 ( - CONSTRAINT favorites_40_user_id_check CHECK (((user_id % 100) = 40)) +CREATE TABLE favorites_40 (CONSTRAINT favorites_40_user_id_check CHECK (((user_id % 100) = 40)) ) INHERITS (favorites); @@ -1164,8 +1182,7 @@ INHERITS (favorites); -- Name: favorites_41; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_41 ( - CONSTRAINT favorites_41_user_id_check CHECK (((user_id % 100) = 41)) +CREATE TABLE favorites_41 (CONSTRAINT favorites_41_user_id_check CHECK (((user_id % 100) = 41)) ) INHERITS (favorites); @@ -1174,8 +1191,7 @@ INHERITS (favorites); -- Name: favorites_42; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_42 ( - CONSTRAINT favorites_42_user_id_check CHECK (((user_id % 100) = 42)) +CREATE TABLE favorites_42 (CONSTRAINT favorites_42_user_id_check CHECK (((user_id % 100) = 42)) ) INHERITS (favorites); @@ -1184,8 +1200,7 @@ INHERITS (favorites); -- Name: favorites_43; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_43 ( - CONSTRAINT favorites_43_user_id_check CHECK (((user_id % 100) = 43)) +CREATE TABLE favorites_43 (CONSTRAINT favorites_43_user_id_check CHECK (((user_id % 100) = 43)) ) INHERITS (favorites); @@ -1194,8 +1209,7 @@ INHERITS (favorites); -- Name: favorites_44; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_44 ( - CONSTRAINT favorites_44_user_id_check CHECK (((user_id % 100) = 44)) +CREATE TABLE favorites_44 (CONSTRAINT favorites_44_user_id_check CHECK (((user_id % 100) = 44)) ) INHERITS (favorites); @@ -1204,8 +1218,7 @@ INHERITS (favorites); -- Name: favorites_45; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_45 ( - CONSTRAINT favorites_45_user_id_check CHECK (((user_id % 100) = 45)) +CREATE TABLE favorites_45 (CONSTRAINT favorites_45_user_id_check CHECK (((user_id % 100) = 45)) ) INHERITS (favorites); @@ -1214,8 +1227,7 @@ INHERITS (favorites); -- Name: favorites_46; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_46 ( - CONSTRAINT favorites_46_user_id_check CHECK (((user_id % 100) = 46)) +CREATE TABLE favorites_46 (CONSTRAINT favorites_46_user_id_check CHECK (((user_id % 100) = 46)) ) INHERITS (favorites); @@ -1224,8 +1236,7 @@ INHERITS (favorites); -- Name: favorites_47; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_47 ( - CONSTRAINT favorites_47_user_id_check CHECK (((user_id % 100) = 47)) +CREATE TABLE favorites_47 (CONSTRAINT favorites_47_user_id_check CHECK (((user_id % 100) = 47)) ) INHERITS (favorites); @@ -1234,8 +1245,7 @@ INHERITS (favorites); -- Name: favorites_48; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_48 ( - CONSTRAINT favorites_48_user_id_check CHECK (((user_id % 100) = 48)) +CREATE TABLE favorites_48 (CONSTRAINT favorites_48_user_id_check CHECK (((user_id % 100) = 48)) ) INHERITS (favorites); @@ -1244,8 +1254,7 @@ INHERITS (favorites); -- Name: favorites_49; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_49 ( - CONSTRAINT favorites_49_user_id_check CHECK (((user_id % 100) = 49)) +CREATE TABLE favorites_49 (CONSTRAINT favorites_49_user_id_check CHECK (((user_id % 100) = 49)) ) INHERITS (favorites); @@ -1254,8 +1263,7 @@ INHERITS (favorites); -- Name: favorites_5; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_5 ( - CONSTRAINT favorites_5_user_id_check CHECK (((user_id % 100) = 5)) +CREATE TABLE favorites_5 (CONSTRAINT favorites_5_user_id_check CHECK (((user_id % 100) = 5)) ) INHERITS (favorites); @@ -1264,8 +1272,7 @@ INHERITS (favorites); -- Name: favorites_50; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_50 ( - CONSTRAINT favorites_50_user_id_check CHECK (((user_id % 100) = 50)) +CREATE TABLE favorites_50 (CONSTRAINT favorites_50_user_id_check CHECK (((user_id % 100) = 50)) ) INHERITS (favorites); @@ -1274,8 +1281,7 @@ INHERITS (favorites); -- Name: favorites_51; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_51 ( - CONSTRAINT favorites_51_user_id_check CHECK (((user_id % 100) = 51)) +CREATE TABLE favorites_51 (CONSTRAINT favorites_51_user_id_check CHECK (((user_id % 100) = 51)) ) INHERITS (favorites); @@ -1284,8 +1290,7 @@ INHERITS (favorites); -- Name: favorites_52; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_52 ( - CONSTRAINT favorites_52_user_id_check CHECK (((user_id % 100) = 52)) +CREATE TABLE favorites_52 (CONSTRAINT favorites_52_user_id_check CHECK (((user_id % 100) = 52)) ) INHERITS (favorites); @@ -1294,8 +1299,7 @@ INHERITS (favorites); -- Name: favorites_53; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_53 ( - CONSTRAINT favorites_53_user_id_check CHECK (((user_id % 100) = 53)) +CREATE TABLE favorites_53 (CONSTRAINT favorites_53_user_id_check CHECK (((user_id % 100) = 53)) ) INHERITS (favorites); @@ -1304,8 +1308,7 @@ INHERITS (favorites); -- Name: favorites_54; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_54 ( - CONSTRAINT favorites_54_user_id_check CHECK (((user_id % 100) = 54)) +CREATE TABLE favorites_54 (CONSTRAINT favorites_54_user_id_check CHECK (((user_id % 100) = 54)) ) INHERITS (favorites); @@ -1314,8 +1317,7 @@ INHERITS (favorites); -- Name: favorites_55; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_55 ( - CONSTRAINT favorites_55_user_id_check CHECK (((user_id % 100) = 55)) +CREATE TABLE favorites_55 (CONSTRAINT favorites_55_user_id_check CHECK (((user_id % 100) = 55)) ) INHERITS (favorites); @@ -1324,8 +1326,7 @@ INHERITS (favorites); -- Name: favorites_56; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_56 ( - CONSTRAINT favorites_56_user_id_check CHECK (((user_id % 100) = 56)) +CREATE TABLE favorites_56 (CONSTRAINT favorites_56_user_id_check CHECK (((user_id % 100) = 56)) ) INHERITS (favorites); @@ -1334,8 +1335,7 @@ INHERITS (favorites); -- Name: favorites_57; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_57 ( - CONSTRAINT favorites_57_user_id_check CHECK (((user_id % 100) = 57)) +CREATE TABLE favorites_57 (CONSTRAINT favorites_57_user_id_check CHECK (((user_id % 100) = 57)) ) INHERITS (favorites); @@ -1344,8 +1344,7 @@ INHERITS (favorites); -- Name: favorites_58; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_58 ( - CONSTRAINT favorites_58_user_id_check CHECK (((user_id % 100) = 58)) +CREATE TABLE favorites_58 (CONSTRAINT favorites_58_user_id_check CHECK (((user_id % 100) = 58)) ) INHERITS (favorites); @@ -1354,8 +1353,7 @@ INHERITS (favorites); -- Name: favorites_59; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_59 ( - CONSTRAINT favorites_59_user_id_check CHECK (((user_id % 100) = 59)) +CREATE TABLE favorites_59 (CONSTRAINT favorites_59_user_id_check CHECK (((user_id % 100) = 59)) ) INHERITS (favorites); @@ -1364,8 +1362,7 @@ INHERITS (favorites); -- Name: favorites_6; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_6 ( - CONSTRAINT favorites_6_user_id_check CHECK (((user_id % 100) = 6)) +CREATE TABLE favorites_6 (CONSTRAINT favorites_6_user_id_check CHECK (((user_id % 100) = 6)) ) INHERITS (favorites); @@ -1374,8 +1371,7 @@ INHERITS (favorites); -- Name: favorites_60; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_60 ( - CONSTRAINT favorites_60_user_id_check CHECK (((user_id % 100) = 60)) +CREATE TABLE favorites_60 (CONSTRAINT favorites_60_user_id_check CHECK (((user_id % 100) = 60)) ) INHERITS (favorites); @@ -1384,8 +1380,7 @@ INHERITS (favorites); -- Name: favorites_61; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_61 ( - CONSTRAINT favorites_61_user_id_check CHECK (((user_id % 100) = 61)) +CREATE TABLE favorites_61 (CONSTRAINT favorites_61_user_id_check CHECK (((user_id % 100) = 61)) ) INHERITS (favorites); @@ -1394,8 +1389,7 @@ INHERITS (favorites); -- Name: favorites_62; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_62 ( - CONSTRAINT favorites_62_user_id_check CHECK (((user_id % 100) = 62)) +CREATE TABLE favorites_62 (CONSTRAINT favorites_62_user_id_check CHECK (((user_id % 100) = 62)) ) INHERITS (favorites); @@ -1404,8 +1398,7 @@ INHERITS (favorites); -- Name: favorites_63; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_63 ( - CONSTRAINT favorites_63_user_id_check CHECK (((user_id % 100) = 63)) +CREATE TABLE favorites_63 (CONSTRAINT favorites_63_user_id_check CHECK (((user_id % 100) = 63)) ) INHERITS (favorites); @@ -1414,8 +1407,7 @@ INHERITS (favorites); -- Name: favorites_64; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_64 ( - CONSTRAINT favorites_64_user_id_check CHECK (((user_id % 100) = 64)) +CREATE TABLE favorites_64 (CONSTRAINT favorites_64_user_id_check CHECK (((user_id % 100) = 64)) ) INHERITS (favorites); @@ -1424,8 +1416,7 @@ INHERITS (favorites); -- Name: favorites_65; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_65 ( - CONSTRAINT favorites_65_user_id_check CHECK (((user_id % 100) = 65)) +CREATE TABLE favorites_65 (CONSTRAINT favorites_65_user_id_check CHECK (((user_id % 100) = 65)) ) INHERITS (favorites); @@ -1434,8 +1425,7 @@ INHERITS (favorites); -- Name: favorites_66; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_66 ( - CONSTRAINT favorites_66_user_id_check CHECK (((user_id % 100) = 66)) +CREATE TABLE favorites_66 (CONSTRAINT favorites_66_user_id_check CHECK (((user_id % 100) = 66)) ) INHERITS (favorites); @@ -1444,8 +1434,7 @@ INHERITS (favorites); -- Name: favorites_67; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_67 ( - CONSTRAINT favorites_67_user_id_check CHECK (((user_id % 100) = 67)) +CREATE TABLE favorites_67 (CONSTRAINT favorites_67_user_id_check CHECK (((user_id % 100) = 67)) ) INHERITS (favorites); @@ -1454,8 +1443,7 @@ INHERITS (favorites); -- Name: favorites_68; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_68 ( - CONSTRAINT favorites_68_user_id_check CHECK (((user_id % 100) = 68)) +CREATE TABLE favorites_68 (CONSTRAINT favorites_68_user_id_check CHECK (((user_id % 100) = 68)) ) INHERITS (favorites); @@ -1464,8 +1452,7 @@ INHERITS (favorites); -- Name: favorites_69; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_69 ( - CONSTRAINT favorites_69_user_id_check CHECK (((user_id % 100) = 69)) +CREATE TABLE favorites_69 (CONSTRAINT favorites_69_user_id_check CHECK (((user_id % 100) = 69)) ) INHERITS (favorites); @@ -1474,8 +1461,7 @@ INHERITS (favorites); -- Name: favorites_7; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_7 ( - CONSTRAINT favorites_7_user_id_check CHECK (((user_id % 100) = 7)) +CREATE TABLE favorites_7 (CONSTRAINT favorites_7_user_id_check CHECK (((user_id % 100) = 7)) ) INHERITS (favorites); @@ -1484,8 +1470,7 @@ INHERITS (favorites); -- Name: favorites_70; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_70 ( - CONSTRAINT favorites_70_user_id_check CHECK (((user_id % 100) = 70)) +CREATE TABLE favorites_70 (CONSTRAINT favorites_70_user_id_check CHECK (((user_id % 100) = 70)) ) INHERITS (favorites); @@ -1494,8 +1479,7 @@ INHERITS (favorites); -- Name: favorites_71; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_71 ( - CONSTRAINT favorites_71_user_id_check CHECK (((user_id % 100) = 71)) +CREATE TABLE favorites_71 (CONSTRAINT favorites_71_user_id_check CHECK (((user_id % 100) = 71)) ) INHERITS (favorites); @@ -1504,8 +1488,7 @@ INHERITS (favorites); -- Name: favorites_72; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_72 ( - CONSTRAINT favorites_72_user_id_check CHECK (((user_id % 100) = 72)) +CREATE TABLE favorites_72 (CONSTRAINT favorites_72_user_id_check CHECK (((user_id % 100) = 72)) ) INHERITS (favorites); @@ -1514,8 +1497,7 @@ INHERITS (favorites); -- Name: favorites_73; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_73 ( - CONSTRAINT favorites_73_user_id_check CHECK (((user_id % 100) = 73)) +CREATE TABLE favorites_73 (CONSTRAINT favorites_73_user_id_check CHECK (((user_id % 100) = 73)) ) INHERITS (favorites); @@ -1524,8 +1506,7 @@ INHERITS (favorites); -- Name: favorites_74; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_74 ( - CONSTRAINT favorites_74_user_id_check CHECK (((user_id % 100) = 74)) +CREATE TABLE favorites_74 (CONSTRAINT favorites_74_user_id_check CHECK (((user_id % 100) = 74)) ) INHERITS (favorites); @@ -1534,8 +1515,7 @@ INHERITS (favorites); -- Name: favorites_75; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_75 ( - CONSTRAINT favorites_75_user_id_check CHECK (((user_id % 100) = 75)) +CREATE TABLE favorites_75 (CONSTRAINT favorites_75_user_id_check CHECK (((user_id % 100) = 75)) ) INHERITS (favorites); @@ -1544,8 +1524,7 @@ INHERITS (favorites); -- Name: favorites_76; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_76 ( - CONSTRAINT favorites_76_user_id_check CHECK (((user_id % 100) = 76)) +CREATE TABLE favorites_76 (CONSTRAINT favorites_76_user_id_check CHECK (((user_id % 100) = 76)) ) INHERITS (favorites); @@ -1554,8 +1533,7 @@ INHERITS (favorites); -- Name: favorites_77; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_77 ( - CONSTRAINT favorites_77_user_id_check CHECK (((user_id % 100) = 77)) +CREATE TABLE favorites_77 (CONSTRAINT favorites_77_user_id_check CHECK (((user_id % 100) = 77)) ) INHERITS (favorites); @@ -1564,8 +1542,7 @@ INHERITS (favorites); -- Name: favorites_78; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_78 ( - CONSTRAINT favorites_78_user_id_check CHECK (((user_id % 100) = 78)) +CREATE TABLE favorites_78 (CONSTRAINT favorites_78_user_id_check CHECK (((user_id % 100) = 78)) ) INHERITS (favorites); @@ -1574,8 +1551,7 @@ INHERITS (favorites); -- Name: favorites_79; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_79 ( - CONSTRAINT favorites_79_user_id_check CHECK (((user_id % 100) = 79)) +CREATE TABLE favorites_79 (CONSTRAINT favorites_79_user_id_check CHECK (((user_id % 100) = 79)) ) INHERITS (favorites); @@ -1584,8 +1560,7 @@ INHERITS (favorites); -- Name: favorites_8; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_8 ( - CONSTRAINT favorites_8_user_id_check CHECK (((user_id % 100) = 8)) +CREATE TABLE favorites_8 (CONSTRAINT favorites_8_user_id_check CHECK (((user_id % 100) = 8)) ) INHERITS (favorites); @@ -1594,8 +1569,7 @@ INHERITS (favorites); -- Name: favorites_80; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_80 ( - CONSTRAINT favorites_80_user_id_check CHECK (((user_id % 100) = 80)) +CREATE TABLE favorites_80 (CONSTRAINT favorites_80_user_id_check CHECK (((user_id % 100) = 80)) ) INHERITS (favorites); @@ -1604,8 +1578,7 @@ INHERITS (favorites); -- Name: favorites_81; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_81 ( - CONSTRAINT favorites_81_user_id_check CHECK (((user_id % 100) = 81)) +CREATE TABLE favorites_81 (CONSTRAINT favorites_81_user_id_check CHECK (((user_id % 100) = 81)) ) INHERITS (favorites); @@ -1614,8 +1587,7 @@ INHERITS (favorites); -- Name: favorites_82; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_82 ( - CONSTRAINT favorites_82_user_id_check CHECK (((user_id % 100) = 82)) +CREATE TABLE favorites_82 (CONSTRAINT favorites_82_user_id_check CHECK (((user_id % 100) = 82)) ) INHERITS (favorites); @@ -1624,8 +1596,7 @@ INHERITS (favorites); -- Name: favorites_83; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_83 ( - CONSTRAINT favorites_83_user_id_check CHECK (((user_id % 100) = 83)) +CREATE TABLE favorites_83 (CONSTRAINT favorites_83_user_id_check CHECK (((user_id % 100) = 83)) ) INHERITS (favorites); @@ -1634,8 +1605,7 @@ INHERITS (favorites); -- Name: favorites_84; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_84 ( - CONSTRAINT favorites_84_user_id_check CHECK (((user_id % 100) = 84)) +CREATE TABLE favorites_84 (CONSTRAINT favorites_84_user_id_check CHECK (((user_id % 100) = 84)) ) INHERITS (favorites); @@ -1644,8 +1614,7 @@ INHERITS (favorites); -- Name: favorites_85; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_85 ( - CONSTRAINT favorites_85_user_id_check CHECK (((user_id % 100) = 85)) +CREATE TABLE favorites_85 (CONSTRAINT favorites_85_user_id_check CHECK (((user_id % 100) = 85)) ) INHERITS (favorites); @@ -1654,8 +1623,7 @@ INHERITS (favorites); -- Name: favorites_86; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_86 ( - CONSTRAINT favorites_86_user_id_check CHECK (((user_id % 100) = 86)) +CREATE TABLE favorites_86 (CONSTRAINT favorites_86_user_id_check CHECK (((user_id % 100) = 86)) ) INHERITS (favorites); @@ -1664,8 +1632,7 @@ INHERITS (favorites); -- Name: favorites_87; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_87 ( - CONSTRAINT favorites_87_user_id_check CHECK (((user_id % 100) = 87)) +CREATE TABLE favorites_87 (CONSTRAINT favorites_87_user_id_check CHECK (((user_id % 100) = 87)) ) INHERITS (favorites); @@ -1674,8 +1641,7 @@ INHERITS (favorites); -- Name: favorites_88; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_88 ( - CONSTRAINT favorites_88_user_id_check CHECK (((user_id % 100) = 88)) +CREATE TABLE favorites_88 (CONSTRAINT favorites_88_user_id_check CHECK (((user_id % 100) = 88)) ) INHERITS (favorites); @@ -1684,8 +1650,7 @@ INHERITS (favorites); -- Name: favorites_89; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_89 ( - CONSTRAINT favorites_89_user_id_check CHECK (((user_id % 100) = 89)) +CREATE TABLE favorites_89 (CONSTRAINT favorites_89_user_id_check CHECK (((user_id % 100) = 89)) ) INHERITS (favorites); @@ -1694,8 +1659,7 @@ INHERITS (favorites); -- Name: favorites_9; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_9 ( - CONSTRAINT favorites_9_user_id_check CHECK (((user_id % 100) = 9)) +CREATE TABLE favorites_9 (CONSTRAINT favorites_9_user_id_check CHECK (((user_id % 100) = 9)) ) INHERITS (favorites); @@ -1704,8 +1668,7 @@ INHERITS (favorites); -- Name: favorites_90; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_90 ( - CONSTRAINT favorites_90_user_id_check CHECK (((user_id % 100) = 90)) +CREATE TABLE favorites_90 (CONSTRAINT favorites_90_user_id_check CHECK (((user_id % 100) = 90)) ) INHERITS (favorites); @@ -1714,8 +1677,7 @@ INHERITS (favorites); -- Name: favorites_91; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_91 ( - CONSTRAINT favorites_91_user_id_check CHECK (((user_id % 100) = 91)) +CREATE TABLE favorites_91 (CONSTRAINT favorites_91_user_id_check CHECK (((user_id % 100) = 91)) ) INHERITS (favorites); @@ -1724,8 +1686,7 @@ INHERITS (favorites); -- Name: favorites_92; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_92 ( - CONSTRAINT favorites_92_user_id_check CHECK (((user_id % 100) = 92)) +CREATE TABLE favorites_92 (CONSTRAINT favorites_92_user_id_check CHECK (((user_id % 100) = 92)) ) INHERITS (favorites); @@ -1734,8 +1695,7 @@ INHERITS (favorites); -- Name: favorites_93; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_93 ( - CONSTRAINT favorites_93_user_id_check CHECK (((user_id % 100) = 93)) +CREATE TABLE favorites_93 (CONSTRAINT favorites_93_user_id_check CHECK (((user_id % 100) = 93)) ) INHERITS (favorites); @@ -1744,8 +1704,7 @@ INHERITS (favorites); -- Name: favorites_94; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_94 ( - CONSTRAINT favorites_94_user_id_check CHECK (((user_id % 100) = 94)) +CREATE TABLE favorites_94 (CONSTRAINT favorites_94_user_id_check CHECK (((user_id % 100) = 94)) ) INHERITS (favorites); @@ -1754,8 +1713,7 @@ INHERITS (favorites); -- Name: favorites_95; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_95 ( - CONSTRAINT favorites_95_user_id_check CHECK (((user_id % 100) = 95)) +CREATE TABLE favorites_95 (CONSTRAINT favorites_95_user_id_check CHECK (((user_id % 100) = 95)) ) INHERITS (favorites); @@ -1764,8 +1722,7 @@ INHERITS (favorites); -- Name: favorites_96; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_96 ( - CONSTRAINT favorites_96_user_id_check CHECK (((user_id % 100) = 96)) +CREATE TABLE favorites_96 (CONSTRAINT favorites_96_user_id_check CHECK (((user_id % 100) = 96)) ) INHERITS (favorites); @@ -1774,8 +1731,7 @@ INHERITS (favorites); -- Name: favorites_97; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_97 ( - CONSTRAINT favorites_97_user_id_check CHECK (((user_id % 100) = 97)) +CREATE TABLE favorites_97 (CONSTRAINT favorites_97_user_id_check CHECK (((user_id % 100) = 97)) ) INHERITS (favorites); @@ -1784,8 +1740,7 @@ INHERITS (favorites); -- Name: favorites_98; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_98 ( - CONSTRAINT favorites_98_user_id_check CHECK (((user_id % 100) = 98)) +CREATE TABLE favorites_98 (CONSTRAINT favorites_98_user_id_check CHECK (((user_id % 100) = 98)) ) INHERITS (favorites); @@ -1794,8 +1749,7 @@ INHERITS (favorites); -- Name: favorites_99; Type: TABLE; Schema: public; Owner: -; Tablespace: -- -CREATE TABLE favorites_99 ( - CONSTRAINT favorites_99_user_id_check CHECK (((user_id % 100) = 99)) +CREATE TABLE favorites_99 (CONSTRAINT favorites_99_user_id_check CHECK (((user_id % 100) = 99)) ) INHERITS (favorites); @@ -1807,8 +1761,8 @@ INHERITS (favorites); CREATE SEQUENCE favorites_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -1825,14 +1779,14 @@ ALTER SEQUENCE favorites_id_seq OWNED BY favorites.id; CREATE TABLE forum_posts ( id integer NOT NULL, - topic_id integer NOT NULL, - creator_id integer NOT NULL, - updater_id integer NOT NULL, - body text NOT NULL, - text_index tsvector NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updated_at timestamp without time zone NOT NULL, + creator_id integer, + body text NOT NULL, + updater_id integer, + text_index tsvector, + is_deleted boolean DEFAULT false NOT NULL, + topic_id integer ); @@ -1843,8 +1797,8 @@ CREATE TABLE forum_posts ( CREATE SEQUENCE forum_posts_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -1867,10 +1821,10 @@ CREATE TABLE forum_topics ( response_count integer DEFAULT 0 NOT NULL, is_sticky boolean DEFAULT false NOT NULL, is_locked boolean DEFAULT false NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, text_index tsvector NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone, + is_deleted boolean DEFAULT false NOT NULL ); @@ -1881,8 +1835,8 @@ CREATE TABLE forum_topics ( CREATE SEQUENCE forum_topics_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -1898,12 +1852,12 @@ ALTER SEQUENCE forum_topics_id_seq OWNED BY forum_topics.id; -- CREATE TABLE ip_bans ( - id integer NOT NULL, creator_id integer NOT NULL, ip_addr inet NOT NULL, - reason text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + reason text, + created_at timestamp without time zone, + updated_at timestamp without time zone, + id integer NOT NULL ); @@ -1914,8 +1868,8 @@ CREATE TABLE ip_bans ( CREATE SEQUENCE ip_bans_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -1931,12 +1885,12 @@ ALTER SEQUENCE ip_bans_id_seq OWNED BY ip_bans.id; -- CREATE TABLE janitor_trials ( - id integer NOT NULL, - creator_id integer NOT NULL, user_id integer NOT NULL, original_level integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone, + id integer NOT NULL, + creator_id integer DEFAULT 1 NOT NULL ); @@ -1947,8 +1901,8 @@ CREATE TABLE janitor_trials ( CREATE SEQUENCE janitor_trials_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -1965,10 +1919,10 @@ ALTER SEQUENCE janitor_trials_id_seq OWNED BY janitor_trials.id; CREATE TABLE mod_actions ( id integer NOT NULL, - creator_id integer NOT NULL, - description text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + creator_id integer, + description text, + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -1979,8 +1933,8 @@ CREATE TABLE mod_actions ( CREATE SEQUENCE mod_actions_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2000,8 +1954,8 @@ CREATE TABLE news_updates ( message text NOT NULL, creator_id integer NOT NULL, updater_id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -2012,8 +1966,8 @@ CREATE TABLE news_updates ( CREATE SEQUENCE news_updates_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2030,18 +1984,18 @@ ALTER SEQUENCE news_updates_id_seq OWNED BY news_updates.id; CREATE TABLE note_versions ( id integer NOT NULL, - note_id integer NOT NULL, - post_id integer NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, x integer NOT NULL, y integer NOT NULL, width integer NOT NULL, height integer NOT NULL, - is_active boolean DEFAULT true NOT NULL, body text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updater_ip_addr inet NOT NULL, + is_active boolean DEFAULT true NOT NULL, + note_id integer NOT NULL, + post_id integer NOT NULL, + updater_id integer ); @@ -2052,8 +2006,8 @@ CREATE TABLE note_versions ( CREATE SEQUENCE note_versions_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2070,17 +2024,17 @@ ALTER SEQUENCE note_versions_id_seq OWNED BY note_versions.id; CREATE TABLE notes ( id integer NOT NULL, - creator_id integer NOT NULL, - post_id integer NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + creator_id integer, x integer NOT NULL, y integer NOT NULL, width integer NOT NULL, height integer NOT NULL, is_active boolean DEFAULT true NOT NULL, + post_id integer NOT NULL, body text NOT NULL, - body_index tsvector NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + body_index tsvector ); @@ -2091,8 +2045,8 @@ CREATE TABLE notes ( CREATE SEQUENCE notes_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2108,13 +2062,13 @@ ALTER SEQUENCE notes_id_seq OWNED BY notes.id; -- CREATE TABLE pool_versions ( - id integer NOT NULL, - pool_id integer, + pool_id integer NOT NULL, post_ids text DEFAULT ''::text NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updater_id integer, + updater_ip_addr inet, + created_at timestamp without time zone DEFAULT now(), + updated_at timestamp without time zone DEFAULT now(), + id integer NOT NULL ); @@ -2125,8 +2079,8 @@ CREATE TABLE pool_versions ( CREATE SEQUENCE pool_versions_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2143,15 +2097,15 @@ ALTER SEQUENCE pool_versions_id_seq OWNED BY pool_versions.id; CREATE TABLE pools ( id integer NOT NULL, - name character varying(255), - creator_id integer NOT NULL, - description text, - is_active boolean DEFAULT true NOT NULL, - post_ids text DEFAULT ''::text NOT NULL, - post_count integer DEFAULT 0 NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, + name text NOT NULL, created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updated_at timestamp without time zone NOT NULL, + creator_id integer NOT NULL, + post_count integer DEFAULT 0 NOT NULL, + description text DEFAULT ''::text NOT NULL, + is_active boolean DEFAULT true NOT NULL, + is_deleted boolean DEFAULT false NOT NULL, + post_ids text DEFAULT ''::text NOT NULL ); @@ -2162,8 +2116,8 @@ CREATE TABLE pools ( CREATE SEQUENCE pools_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2180,12 +2134,12 @@ ALTER SEQUENCE pools_id_seq OWNED BY pools.id; CREATE TABLE post_appeals ( id integer NOT NULL, - post_id integer NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr integer NOT NULL, - reason text, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + post_id integer, + creator_id integer, + reason character varying(255), + creator_ip_addr inet, + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -2196,8 +2150,8 @@ CREATE TABLE post_appeals ( CREATE SEQUENCE post_appeals_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2213,11 +2167,11 @@ ALTER SEQUENCE post_appeals_id_seq OWNED BY post_appeals.id; -- CREATE TABLE post_disapprovals ( - id integer NOT NULL, user_id integer NOT NULL, post_id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone DEFAULT now(), + updated_at timestamp without time zone DEFAULT now(), + id integer NOT NULL ); @@ -2228,8 +2182,8 @@ CREATE TABLE post_disapprovals ( CREATE SEQUENCE post_disapprovals_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2245,14 +2199,14 @@ ALTER SEQUENCE post_disapprovals_id_seq OWNED BY post_disapprovals.id; -- CREATE TABLE post_flags ( - id integer NOT NULL, - post_id integer NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr inet NOT NULL, - reason text, - is_resolved boolean DEFAULT false NOT NULL, created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + post_id integer NOT NULL, + reason text NOT NULL, + creator_id integer NOT NULL, + is_resolved boolean NOT NULL, + creator_ip_addr inet DEFAULT '127.0.0.1'::inet NOT NULL, + updated_at timestamp without time zone DEFAULT now() NOT NULL, + id integer NOT NULL ); @@ -2263,8 +2217,8 @@ CREATE TABLE post_flags ( CREATE SEQUENCE post_flags_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2280,16 +2234,15 @@ ALTER SEQUENCE post_flags_id_seq OWNED BY post_flags.id; -- CREATE TABLE post_versions ( - id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, post_id integer NOT NULL, - tags text DEFAULT ''::text NOT NULL, + tags text NOT NULL, + updater_id integer, + updater_ip_addr inet NOT NULL, + updated_at timestamp without time zone NOT NULL, rating character(1), parent_id integer, source text, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL + id integer NOT NULL ); @@ -2300,8 +2253,8 @@ CREATE TABLE post_versions ( CREATE SEQUENCE post_versions_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2320,9 +2273,9 @@ CREATE TABLE post_votes ( id integer NOT NULL, post_id integer NOT NULL, user_id integer NOT NULL, - score integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone, + score integer DEFAULT 0 NOT NULL ); @@ -2333,8 +2286,8 @@ CREATE TABLE post_votes ( CREATE SEQUENCE post_votes_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2352,40 +2305,40 @@ ALTER SEQUENCE post_votes_id_seq OWNED BY post_votes.id; CREATE TABLE posts ( id integer NOT NULL, created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - up_score integer DEFAULT 0 NOT NULL, - down_score integer DEFAULT 0 NOT NULL, + uploader_id integer, score integer DEFAULT 0 NOT NULL, - source character varying(255), - md5 character varying(255) NOT NULL, - rating character(1) DEFAULT 'q'::bpchar NOT NULL, - is_note_locked boolean DEFAULT false NOT NULL, - is_rating_locked boolean DEFAULT false NOT NULL, - is_status_locked boolean DEFAULT false NOT NULL, - is_pending boolean DEFAULT false NOT NULL, - is_flagged boolean DEFAULT false NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, - uploader_id integer NOT NULL, - uploader_ip_addr inet NOT NULL, - approver_id integer, - fav_string text DEFAULT ''::text NOT NULL, - pool_string text DEFAULT ''::text NOT NULL, - last_noted_at timestamp without time zone, + source text, + md5 text NOT NULL, last_commented_at timestamp without time zone, - fav_count integer DEFAULT 0 NOT NULL, + rating character(1) DEFAULT 'q'::bpchar NOT NULL, + image_width integer, + image_height integer, + uploader_ip_addr inet NOT NULL, tag_string text DEFAULT ''::text NOT NULL, + is_note_locked boolean DEFAULT false NOT NULL, + fav_count integer DEFAULT 0 NOT NULL, + file_ext text DEFAULT ''::text NOT NULL, + last_noted_at timestamp without time zone, + is_rating_locked boolean DEFAULT false NOT NULL, + parent_id integer, + has_children boolean DEFAULT false NOT NULL, + approver_id integer, tag_index tsvector, - tag_count integer DEFAULT 0 NOT NULL, tag_count_general integer DEFAULT 0 NOT NULL, tag_count_artist integer DEFAULT 0 NOT NULL, tag_count_character integer DEFAULT 0 NOT NULL, tag_count_copyright integer DEFAULT 0 NOT NULL, - file_ext character varying(255) NOT NULL, - file_size integer NOT NULL, - image_width integer NOT NULL, - image_height integer NOT NULL, - parent_id integer, - has_children boolean DEFAULT false NOT NULL + file_size integer, + is_status_locked boolean DEFAULT false NOT NULL, + fav_string text DEFAULT ''::text NOT NULL, + pool_string text DEFAULT ''::text NOT NULL, + up_score integer DEFAULT 0 NOT NULL, + down_score integer DEFAULT 0 NOT NULL, + is_pending boolean DEFAULT false NOT NULL, + is_flagged boolean DEFAULT false NOT NULL, + is_deleted boolean DEFAULT false NOT NULL, + tag_count integer DEFAULT 0 NOT NULL, + updated_at timestamp without time zone ); @@ -2396,8 +2349,8 @@ CREATE TABLE posts ( CREATE SEQUENCE posts_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2423,14 +2376,15 @@ CREATE TABLE schema_migrations ( CREATE TABLE tag_aliases ( id integer NOT NULL, - antecedent_name character varying(255) NOT NULL, - consequent_name character varying(255) NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr inet NOT NULL, + antecedent_name text NOT NULL, + reason text DEFAULT ''::text NOT NULL, + creator_id integer, + consequent_name character varying(255) DEFAULT ''::character varying NOT NULL, + status character varying(255) DEFAULT 'active'::character varying NOT NULL, forum_topic_id integer, - status text DEFAULT 'pending'::text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + creator_ip_addr inet DEFAULT '127.0.0.1'::inet NOT NULL, + created_at timestamp without time zone DEFAULT now(), + updated_at timestamp without time zone DEFAULT now() ); @@ -2441,8 +2395,8 @@ CREATE TABLE tag_aliases ( CREATE SEQUENCE tag_aliases_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2459,15 +2413,16 @@ ALTER SEQUENCE tag_aliases_id_seq OWNED BY tag_aliases.id; CREATE TABLE tag_implications ( id integer NOT NULL, - antecedent_name character varying(255) NOT NULL, - consequent_name character varying(255) NOT NULL, - descendant_names text NOT NULL, - creator_id integer NOT NULL, - creator_ip_addr inet NOT NULL, + reason text DEFAULT ''::text NOT NULL, + creator_id integer, + antecedent_name character varying(255) DEFAULT ''::character varying NOT NULL, + consequent_name character varying(255) DEFAULT ''::character varying NOT NULL, + descendant_names text DEFAULT ''::text NOT NULL, + creator_ip_addr inet DEFAULT '127.0.0.1'::inet NOT NULL, + status character varying(255) DEFAULT 'active'::character varying NOT NULL, forum_topic_id integer, - status text DEFAULT 'pending'::text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone DEFAULT now(), + updated_at timestamp without time zone DEFAULT now() ); @@ -2478,8 +2433,8 @@ CREATE TABLE tag_implications ( CREATE SEQUENCE tag_implications_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2495,16 +2450,16 @@ ALTER SEQUENCE tag_implications_id_seq OWNED BY tag_implications.id; -- CREATE TABLE tag_subscriptions ( - id integer NOT NULL, creator_id integer NOT NULL, - name character varying(255) NOT NULL, - tag_query character varying(255) NOT NULL, - post_ids text NOT NULL, + tag_query text NOT NULL, + post_ids text DEFAULT ''::text NOT NULL, + name character varying(255) DEFAULT 'General'::character varying NOT NULL, is_public boolean DEFAULT true NOT NULL, + id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, last_accessed_at timestamp without time zone, - is_opted_in boolean DEFAULT false NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + is_opted_in boolean DEFAULT false NOT NULL ); @@ -2515,8 +2470,8 @@ CREATE TABLE tag_subscriptions ( CREATE SEQUENCE tag_subscriptions_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2533,13 +2488,13 @@ ALTER SEQUENCE tag_subscriptions_id_seq OWNED BY tag_subscriptions.id; CREATE TABLE tags ( id integer NOT NULL, - name character varying(255) NOT NULL, + name text NOT NULL, post_count integer DEFAULT 0 NOT NULL, - category integer DEFAULT 0 NOT NULL, related_tags text, - related_tags_updated_at timestamp without time zone, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + related_tags_updated_at timestamp without time zone DEFAULT now(), + category smallint DEFAULT 0 NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -2550,8 +2505,8 @@ CREATE TABLE tags ( CREATE SEQUENCE tags_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2579,8 +2534,8 @@ CREATE TABLE uploads ( backtrace text, post_id integer, md5_confirmation character varying(255), - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -2591,8 +2546,8 @@ CREATE TABLE uploads ( CREATE SEQUENCE uploads_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2608,13 +2563,13 @@ ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id; -- CREATE TABLE user_feedback ( - id integer NOT NULL, user_id integer NOT NULL, creator_id integer NOT NULL, - category character varying(255) NOT NULL, + created_at timestamp without time zone DEFAULT now() NOT NULL, body text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + category character varying(255) DEFAULT ''::character varying NOT NULL, + id integer NOT NULL, + updated_at timestamp without time zone DEFAULT now() ); @@ -2625,8 +2580,8 @@ CREATE TABLE user_feedback ( CREATE SEQUENCE user_feedback_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2645,8 +2600,8 @@ CREATE TABLE user_password_reset_nonces ( id integer NOT NULL, key character varying(255) NOT NULL, email character varying(255) NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + created_at timestamp without time zone, + updated_at timestamp without time zone ); @@ -2657,8 +2612,8 @@ CREATE TABLE user_password_reset_nonces ( CREATE SEQUENCE user_password_reset_nonces_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2675,31 +2630,31 @@ ALTER SEQUENCE user_password_reset_nonces_id_seq OWNED BY user_password_reset_no CREATE TABLE users ( id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - name character varying(255) NOT NULL, - password_hash character varying(255) NOT NULL, - email character varying(255), - email_verification_key character varying(255), - inviter_id integer, - is_banned boolean DEFAULT false NOT NULL, + name text NOT NULL, + password_hash text NOT NULL, level integer DEFAULT 0 NOT NULL, - base_upload_limit integer DEFAULT 10 NOT NULL, - last_logged_in_at timestamp without time zone, - last_forum_read_at timestamp without time zone, - has_mail boolean DEFAULT false NOT NULL, - recent_tags text, - post_upload_count integer DEFAULT 0 NOT NULL, - post_update_count integer DEFAULT 0 NOT NULL, - note_update_count integer DEFAULT 0 NOT NULL, - favorite_count integer DEFAULT 0 NOT NULL, - receive_email_notifications boolean DEFAULT false NOT NULL, - comment_threshold integer DEFAULT (-1) NOT NULL, + email text DEFAULT ''::text NOT NULL, + recent_tags text DEFAULT ''::text NOT NULL, always_resize_images boolean DEFAULT false NOT NULL, + inviter_id integer, + created_at timestamp without time zone DEFAULT now() NOT NULL, + last_logged_in_at timestamp without time zone DEFAULT now(), + last_forum_read_at timestamp without time zone DEFAULT '1960-01-01 00:00:00'::timestamp without time zone, + has_mail boolean DEFAULT false NOT NULL, + receive_email_notifications boolean DEFAULT false NOT NULL, + base_upload_limit integer, + comment_threshold integer DEFAULT 0 NOT NULL, + updated_at timestamp without time zone, + email_verification_key character varying(255), + is_banned boolean DEFAULT false NOT NULL, default_image_size character varying(255) DEFAULT 'large'::character varying NOT NULL, favorite_tags text, blacklisted_tags text, - time_zone character varying(255) DEFAULT 'Eastern Time (US & Canada)'::character varying NOT NULL + time_zone character varying(255) DEFAULT 'Eastern Time (US & Canada)'::character varying NOT NULL, + post_update_count integer DEFAULT 0 NOT NULL, + note_update_count integer DEFAULT 0 NOT NULL, + favorite_count integer DEFAULT 0 NOT NULL, + post_upload_count integer DEFAULT 0 NOT NULL ); @@ -2710,8 +2665,8 @@ CREATE TABLE users ( CREATE SEQUENCE users_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2728,14 +2683,14 @@ ALTER SEQUENCE users_id_seq OWNED BY users.id; CREATE TABLE wiki_page_versions ( id integer NOT NULL, - wiki_page_id integer NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - title character varying(255) NOT NULL, - body text NOT NULL, - is_locked boolean NOT NULL, created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updated_at timestamp without time zone NOT NULL, + title text NOT NULL, + body text NOT NULL, + updater_id integer, + updater_ip_addr inet NOT NULL, + wiki_page_id integer NOT NULL, + is_locked boolean DEFAULT false NOT NULL ); @@ -2746,8 +2701,8 @@ CREATE TABLE wiki_page_versions ( CREATE SEQUENCE wiki_page_versions_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -2764,13 +2719,13 @@ ALTER SEQUENCE wiki_page_versions_id_seq OWNED BY wiki_page_versions.id; CREATE TABLE wiki_pages ( id integer NOT NULL, - creator_id integer NOT NULL, - title character varying(255) NOT NULL, - body text NOT NULL, - body_index tsvector NOT NULL, - is_locked boolean DEFAULT false NOT NULL, created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL + updated_at timestamp without time zone NOT NULL, + title text NOT NULL, + body text NOT NULL, + creator_id integer, + is_locked boolean DEFAULT false NOT NULL, + body_index tsvector ); @@ -2781,8 +2736,8 @@ CREATE TABLE wiki_pages ( CREATE SEQUENCE wiki_pages_id_seq START WITH 1 INCREMENT BY 1 - NO MINVALUE NO MAXVALUE + NO MINVALUE CACHE 1; @@ -3871,6 +3826,14 @@ ALTER TABLE ONLY forum_topics ADD CONSTRAINT forum_topics_pkey PRIMARY KEY (id); +-- +-- Name: index_artists_on_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- + +ALTER TABLE ONLY artists + ADD CONSTRAINT index_artists_on_name UNIQUE (name); + + -- -- Name: ip_bans_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- @@ -4126,13 +4089,6 @@ CREATE INDEX index_artist_urls_on_url_pattern ON artist_urls USING btree (url te CREATE INDEX index_artist_versions_on_artist_id ON artist_versions USING btree (artist_id); --- --- Name: index_artist_versions_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_versions_on_name ON artist_versions USING btree (name); - - -- -- Name: index_artist_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -4140,20 +4096,6 @@ CREATE INDEX index_artist_versions_on_name ON artist_versions USING btree (name) CREATE INDEX index_artist_versions_on_updater_id ON artist_versions USING btree (updater_id); --- --- Name: index_artists_on_group_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artists_on_group_name ON artists USING btree (group_name); - - --- --- Name: index_artists_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_artists_on_name ON artists USING btree (name); - - -- -- Name: index_artists_on_other_names_index; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -4204,10 +4146,10 @@ CREATE INDEX index_comment_votes_on_user_id ON comment_votes USING btree (user_i -- --- Name: index_comments_on_body_index; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_comments_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_comments_on_body_index ON comments USING gin (body_index); +CREATE INDEX index_comments_on_creator_id ON comments USING btree (creator_id); -- @@ -4217,6 +4159,13 @@ CREATE INDEX index_comments_on_body_index ON comments USING gin (body_index); CREATE INDEX index_comments_on_post_id ON comments USING btree (post_id); +-- +-- Name: index_comments_on_text_search_index; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_comments_on_text_search_index ON comments USING gin (body_index); + + -- -- Name: index_delayed_jobs_on_run_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -5659,6 +5608,13 @@ CREATE INDEX index_forum_posts_on_text_index ON forum_posts USING gin (text_inde CREATE INDEX index_forum_posts_on_topic_id ON forum_posts USING btree (topic_id); +-- +-- Name: index_forum_posts_on_updated_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_forum_posts_on_updated_at ON forum_posts USING btree (updated_at); + + -- -- Name: index_forum_topics_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -5677,14 +5633,28 @@ CREATE INDEX index_forum_topics_on_text_index ON forum_topics USING gin (text_in -- Name: index_ip_bans_on_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE UNIQUE INDEX index_ip_bans_on_ip_addr ON ip_bans USING btree (ip_addr); +CREATE INDEX index_ip_bans_on_ip_addr ON ip_bans USING btree (ip_addr); -- --- Name: index_janitor_trials_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_janitor_trials_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_janitor_trials_on_user_id ON janitor_trials USING btree (user_id); +CREATE INDEX index_janitor_trials_on_creator_id ON janitor_trials USING btree (user_id); + + +-- +-- Name: index_mod_actions_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_mod_actions_on_created_at ON mod_actions USING btree (created_at); + + +-- +-- Name: index_mod_actions_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_mod_actions_on_creator_id ON mod_actions USING btree (creator_id); -- @@ -5772,10 +5742,10 @@ CREATE INDEX index_pools_on_creator_id ON pools USING btree (creator_id); -- --- Name: index_pools_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_post_appeals_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_pools_on_name ON pools USING btree (name); +CREATE INDEX index_post_appeals_on_created_at ON post_appeals USING btree (created_at); -- @@ -5855,6 +5825,13 @@ CREATE INDEX index_post_versions_on_updater_id ON post_versions USING btree (upd CREATE INDEX index_post_versions_on_updater_ip_addr ON post_versions USING btree (updater_ip_addr); +-- +-- Name: index_post_votes_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_post_votes_on_created_at ON post_votes USING btree (created_at); + + -- -- Name: index_post_votes_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -5869,6 +5846,13 @@ CREATE INDEX index_post_votes_on_post_id ON post_votes USING btree (post_id); CREATE INDEX index_post_votes_on_user_id ON post_votes USING btree (user_id); +-- +-- Name: index_posts_on_approver_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_posts_on_approver_id ON posts USING btree (approver_id); + + -- -- Name: index_posts_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -5908,14 +5892,14 @@ CREATE INDEX index_posts_on_image_width ON posts USING btree (image_width); -- Name: index_posts_on_last_commented_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_posts_on_last_commented_at ON posts USING btree (last_commented_at); +CREATE INDEX index_posts_on_last_commented_at ON posts USING btree (last_commented_at) WHERE (last_commented_at IS NOT NULL); -- -- Name: index_posts_on_last_noted_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_posts_on_last_noted_at ON posts USING btree (last_noted_at); +CREATE INDEX index_posts_on_last_noted_at ON posts USING btree (last_noted_at) WHERE (last_noted_at IS NOT NULL); -- @@ -5936,7 +5920,7 @@ CREATE INDEX index_posts_on_mpixels ON posts USING btree (((((image_width * imag -- Name: index_posts_on_parent_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_posts_on_parent_id ON posts USING btree (parent_id); +CREATE INDEX index_posts_on_parent_id ON posts USING btree (parent_id) WHERE (parent_id IS NOT NULL); -- @@ -5954,17 +5938,17 @@ CREATE INDEX index_posts_on_source_pattern ON posts USING btree (source text_pat -- --- Name: index_posts_on_tags_index; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_posts_on_tag_index; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_posts_on_tags_index ON posts USING gin (tag_index); +CREATE INDEX index_posts_on_tag_index ON posts USING gin (tag_index); -- -- Name: index_posts_on_uploader_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_posts_on_uploader_id ON posts USING btree (uploader_id); +CREATE INDEX index_posts_on_uploader_id ON posts USING btree (uploader_id) WHERE (uploader_id IS NOT NULL); -- @@ -5978,7 +5962,7 @@ CREATE INDEX index_posts_on_uploader_ip_addr ON posts USING btree (uploader_ip_a -- Name: index_tag_aliases_on_antecedent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING btree (antecedent_name); +CREATE UNIQUE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING btree (antecedent_name); -- @@ -5988,20 +5972,6 @@ CREATE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING btree (an CREATE INDEX index_tag_aliases_on_consequent_name ON tag_aliases USING btree (consequent_name); --- --- Name: index_tag_implications_on_antecedent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_implications_on_antecedent_name ON tag_implications USING btree (antecedent_name); - - --- --- Name: index_tag_implications_on_consequent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_implications_on_consequent_name ON tag_implications USING btree (consequent_name); - - -- -- Name: index_tag_subscriptions_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -6030,6 +6000,13 @@ CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name); CREATE INDEX index_tags_on_name_pattern ON tags USING btree (name text_pattern_ops); +-- +-- Name: index_tags_on_post_count; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_tags_on_post_count ON tags USING btree (post_count); + + -- -- Name: index_uploads_on_uploader_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -6044,13 +6021,6 @@ CREATE INDEX index_uploads_on_uploader_id ON uploads USING btree (uploader_id); CREATE INDEX index_uploads_on_uploader_ip_addr ON uploads USING btree (uploader_ip_addr); --- --- Name: index_user_feedback_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_user_feedback_on_creator_id ON user_feedback USING btree (creator_id); - - -- -- Name: index_user_feedback_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -6062,14 +6032,28 @@ CREATE INDEX index_user_feedback_on_user_id ON user_feedback USING btree (user_i -- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE UNIQUE INDEX index_users_on_email ON users USING btree (email); +CREATE INDEX index_users_on_email ON users USING btree (email) WHERE (email IS NOT NULL); + + +-- +-- Name: index_users_on_inviter_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_users_on_inviter_id ON users USING btree (inviter_id) WHERE (inviter_id IS NOT NULL); -- -- Name: index_users_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE UNIQUE INDEX index_users_on_name ON users USING btree (lower((name)::text)); +CREATE INDEX index_users_on_name ON users USING btree (lower(name)); + + +-- +-- Name: index_wiki_page_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_wiki_page_versions_on_updater_id ON wiki_page_versions USING btree (updater_id); -- @@ -6080,10 +6064,10 @@ CREATE INDEX index_wiki_page_versions_on_wiki_page_id ON wiki_page_versions USIN -- --- Name: index_wiki_pages_on_body_index_index; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_wiki_pages_on_body_index; Type: INDEX; Schema: public; Owner: -; Tablespace: -- -CREATE INDEX index_wiki_pages_on_body_index_index ON wiki_pages USING gin (body_index); +CREATE INDEX index_wiki_pages_on_body_index ON wiki_pages USING gin (body_index); -- @@ -6100,6 +6084,13 @@ CREATE UNIQUE INDEX index_wiki_pages_on_title ON wiki_pages USING btree (title); CREATE INDEX index_wiki_pages_on_title_pattern ON wiki_pages USING btree (title text_pattern_ops); +-- +-- Name: index_wiki_pages_on_updated_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_wiki_pages_on_updated_at ON wiki_pages USING btree (updated_at); + + -- -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -6111,63 +6102,90 @@ CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (v -- Name: insert_favorites_trigger; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER insert_favorites_trigger BEFORE INSERT ON favorites FOR EACH ROW EXECUTE PROCEDURE favorites_insert_trigger(); +CREATE TRIGGER insert_favorites_trigger + BEFORE INSERT ON favorites + FOR EACH ROW + EXECUTE PROCEDURE favorites_insert_trigger(); -- -- Name: trigger_artists_on_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_artists_on_update BEFORE INSERT OR UPDATE ON artists FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('other_names_index', 'public.danbooru', 'other_names'); +CREATE TRIGGER trigger_artists_on_update + BEFORE INSERT OR UPDATE ON artists + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('other_names_index', 'public.danbooru', 'other_names'); -- -- Name: trigger_comments_on_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_comments_on_update BEFORE INSERT OR UPDATE ON comments FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body'); +CREATE TRIGGER trigger_comments_on_update + BEFORE INSERT OR UPDATE ON comments + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body'); -- -- Name: trigger_dmails_on_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_dmails_on_update BEFORE INSERT OR UPDATE ON dmails FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('message_index', 'pg_catalog.english', 'title', 'body'); +CREATE TRIGGER trigger_dmails_on_update + BEFORE INSERT OR UPDATE ON dmails + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('message_index', 'pg_catalog.english', 'title', 'body'); -- -- Name: trigger_forum_posts_on_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_forum_posts_on_update BEFORE INSERT OR UPDATE ON forum_posts FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'body'); +CREATE TRIGGER trigger_forum_posts_on_update + BEFORE INSERT OR UPDATE ON forum_posts + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'body'); -- -- Name: trigger_forum_topics_on_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_forum_topics_on_update BEFORE INSERT OR UPDATE ON forum_topics FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'title'); +CREATE TRIGGER trigger_forum_topics_on_update + BEFORE INSERT OR UPDATE ON forum_topics + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'title'); -- -- Name: trigger_notes_on_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_notes_on_update BEFORE INSERT OR UPDATE ON notes FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body'); +CREATE TRIGGER trigger_notes_on_update + BEFORE INSERT OR UPDATE ON notes + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body'); -- -- Name: trigger_posts_on_tag_index_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_posts_on_tag_index_update BEFORE INSERT OR UPDATE ON posts FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('tag_index', 'public.danbooru', 'tag_string', 'fav_string', 'pool_string'); +CREATE TRIGGER trigger_posts_on_tag_index_update + BEFORE INSERT OR UPDATE ON posts + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('tag_index', 'public.danbooru', 'tag_string', 'fav_string', 'pool_string'); -- -- Name: trigger_wiki_pages_on_update; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER trigger_wiki_pages_on_update BEFORE INSERT OR UPDATE ON wiki_pages FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'public.danbooru', 'body', 'title'); +CREATE TRIGGER trigger_wiki_pages_on_update + BEFORE INSERT OR UPDATE ON wiki_pages + FOR EACH ROW + EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'public.danbooru', 'body', 'title'); -- diff --git a/db/test_structure.sql b/db/test_structure.sql deleted file mode 100644 index f916be439..000000000 --- a/db/test_structure.sql +++ /dev/null @@ -1,2914 +0,0 @@ --- --- PostgreSQL database dump --- - -SET statement_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = off; -SET check_function_bodies = false; -SET client_min_messages = warning; -SET escape_string_warning = off; - -SET search_path = public, pg_catalog; - --- --- Name: testprs_end(internal); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_end(internal) RETURNS void - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_end'; - - --- --- Name: testprs_getlexeme(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_getlexeme(internal, internal, internal) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_getlexeme'; - - --- --- Name: testprs_lextype(internal); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_lextype(internal) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_lextype'; - - --- --- Name: testprs_start(internal, integer); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION testprs_start(internal, integer) RETURNS internal - LANGUAGE c STRICT - AS '$libdir/test_parser', 'testprs_start'; - - --- --- Name: testparser; Type: TEXT SEARCH PARSER; Schema: public; Owner: - --- - -CREATE TEXT SEARCH PARSER testparser ( - START = testprs_start, - GETTOKEN = testprs_getlexeme, - END = testprs_end, - HEADLINE = prsd_headline, - LEXTYPES = testprs_lextype ); - - --- --- Name: danbooru; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: - --- - -CREATE TEXT SEARCH CONFIGURATION danbooru ( - PARSER = testparser ); - -ALTER TEXT SEARCH CONFIGURATION danbooru - ADD MAPPING FOR word WITH simple; - - -SET default_tablespace = ''; - -SET default_with_oids = false; - --- --- Name: advertisement_hits; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE advertisement_hits ( - id integer NOT NULL, - advertisement_id integer NOT NULL, - ip_addr inet NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: advertisement_hits_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE advertisement_hits_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: advertisement_hits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE advertisement_hits_id_seq OWNED BY advertisement_hits.id; - - --- --- Name: advertisements; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE advertisements ( - id integer NOT NULL, - referral_url text NOT NULL, - ad_type character varying(255) NOT NULL, - status character varying(255) NOT NULL, - hit_count integer DEFAULT 0 NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - file_name character varying(255) NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: advertisements_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE advertisements_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: advertisements_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE advertisements_id_seq OWNED BY advertisements.id; - - --- --- Name: artist_urls; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE artist_urls ( - id integer NOT NULL, - artist_id integer NOT NULL, - url text NOT NULL, - normalized_url text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: artist_urls_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE artist_urls_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: artist_urls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE artist_urls_id_seq OWNED BY artist_urls.id; - - --- --- Name: artist_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE artist_versions ( - id integer NOT NULL, - artist_id integer NOT NULL, - name character varying(255) NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - is_active boolean DEFAULT true NOT NULL, - other_names text, - group_name character varying(255), - url_string text, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: artist_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE artist_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: artist_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE artist_versions_id_seq OWNED BY artist_versions.id; - - --- --- Name: artists; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE artists ( - id integer NOT NULL, - name character varying(255) NOT NULL, - creator_id integer NOT NULL, - is_active boolean DEFAULT true NOT NULL, - other_names text, - other_names_index tsvector, - group_name character varying(255), - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: artists_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE artists_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: artists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE artists_id_seq OWNED BY artists.id; - - --- --- Name: bans; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE bans ( - id integer NOT NULL, - user_id integer, - reason text NOT NULL, - banner_id integer NOT NULL, - expires_at timestamp without time zone NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: bans_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE bans_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE bans_id_seq OWNED BY bans.id; - - --- --- Name: comment_votes; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE comment_votes ( - id integer NOT NULL, - comment_id integer NOT NULL, - user_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: comment_votes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE comment_votes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: comment_votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE comment_votes_id_seq OWNED BY comment_votes.id; - - --- --- Name: comments; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE comments ( - id integer NOT NULL, - post_id integer NOT NULL, - creator_id integer NOT NULL, - body text NOT NULL, - ip_addr inet NOT NULL, - body_index tsvector NOT NULL, - score integer DEFAULT 0 NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE comments_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE comments_id_seq OWNED BY comments.id; - - --- --- Name: dmails; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE dmails ( - id integer NOT NULL, - owner_id integer NOT NULL, - from_id integer NOT NULL, - to_id integer NOT NULL, - parent_id integer, - title character varying(255) NOT NULL, - body text NOT NULL, - message_index tsvector NOT NULL, - is_read boolean DEFAULT false NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: dmails_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE dmails_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: dmails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE dmails_id_seq OWNED BY dmails.id; - - --- --- Name: favorites_0; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_0 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_0_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_0_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_0_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_0_id_seq OWNED BY favorites_0.id; - - --- --- Name: favorites_1; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_1 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_1_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_1_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_1_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_1_id_seq OWNED BY favorites_1.id; - - --- --- Name: favorites_2; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_2 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_2_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_2_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_2_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_2_id_seq OWNED BY favorites_2.id; - - --- --- Name: favorites_3; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_3 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_3_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_3_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_3_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_3_id_seq OWNED BY favorites_3.id; - - --- --- Name: favorites_4; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_4 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_4_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_4_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_4_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_4_id_seq OWNED BY favorites_4.id; - - --- --- Name: favorites_5; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_5 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_5_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_5_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_5_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_5_id_seq OWNED BY favorites_5.id; - - --- --- Name: favorites_6; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_6 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_6_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_6_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_6_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_6_id_seq OWNED BY favorites_6.id; - - --- --- Name: favorites_7; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_7 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_7_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_7_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_7_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_7_id_seq OWNED BY favorites_7.id; - - --- --- Name: favorites_8; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_8 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_8_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_8_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_8_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_8_id_seq OWNED BY favorites_8.id; - - --- --- Name: favorites_9; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE favorites_9 ( - id integer NOT NULL, - post_id integer, - user_id integer -); - - --- --- Name: favorites_9_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE favorites_9_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: favorites_9_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE favorites_9_id_seq OWNED BY favorites_9.id; - - --- --- Name: forum_posts; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE forum_posts ( - id integer NOT NULL, - topic_id integer NOT NULL, - creator_id integer NOT NULL, - body text NOT NULL, - text_index tsvector NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: forum_posts_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE forum_posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: forum_posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE forum_posts_id_seq OWNED BY forum_posts.id; - - --- --- Name: forum_topics; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE forum_topics ( - id integer NOT NULL, - creator_id integer NOT NULL, - title character varying(255) NOT NULL, - response_count integer DEFAULT 0 NOT NULL, - is_sticky boolean DEFAULT false NOT NULL, - is_locked boolean DEFAULT false NOT NULL, - text_index tsvector NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: forum_topics_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE forum_topics_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: forum_topics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE forum_topics_id_seq OWNED BY forum_topics.id; - - --- --- Name: ip_bans; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE ip_bans ( - id integer NOT NULL, - creator_id integer NOT NULL, - ip_addr inet NOT NULL, - reason text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: ip_bans_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE ip_bans_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: ip_bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE ip_bans_id_seq OWNED BY ip_bans.id; - - --- --- Name: janitor_trials; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE janitor_trials ( - id integer NOT NULL, - user_id integer NOT NULL, - promoted_at timestamp without time zone, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: janitor_trials_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE janitor_trials_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: janitor_trials_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE janitor_trials_id_seq OWNED BY janitor_trials.id; - - --- --- Name: jobs; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE jobs ( - id integer NOT NULL, - category character varying(255) NOT NULL, - status character varying(255) NOT NULL, - message text NOT NULL, - data_as_json text NOT NULL, - repeat_count integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE jobs_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE jobs_id_seq OWNED BY jobs.id; - - --- --- Name: note_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE note_versions ( - id integer NOT NULL, - note_id integer NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - x integer NOT NULL, - y integer NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - is_active boolean DEFAULT true NOT NULL, - body text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: note_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE note_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: note_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE note_versions_id_seq OWNED BY note_versions.id; - - --- --- Name: notes; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE notes ( - id integer NOT NULL, - creator_id integer NOT NULL, - post_id integer NOT NULL, - x integer NOT NULL, - y integer NOT NULL, - width integer NOT NULL, - height integer NOT NULL, - is_active boolean DEFAULT true NOT NULL, - body text NOT NULL, - text_index tsvector NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE notes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE notes_id_seq OWNED BY notes.id; - - --- --- Name: pool_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE pool_versions ( - id integer NOT NULL, - pool_id integer, - post_ids text DEFAULT ''::text NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: pool_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE pool_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: pool_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE pool_versions_id_seq OWNED BY pool_versions.id; - - --- --- Name: pools; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE pools ( - id integer NOT NULL, - name character varying(255), - creator_id integer NOT NULL, - description text, - is_public boolean DEFAULT true NOT NULL, - is_active boolean DEFAULT true NOT NULL, - post_ids text DEFAULT ''::text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: pools_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE pools_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: pools_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE pools_id_seq OWNED BY pools.id; - - --- --- Name: post_moderation_details; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_moderation_details ( - id integer NOT NULL, - user_id integer NOT NULL, - post_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: post_moderation_details_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_moderation_details_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: post_moderation_details_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_moderation_details_id_seq OWNED BY post_moderation_details.id; - - --- --- Name: post_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_versions ( - id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - post_id integer NOT NULL, - source character varying(255), - rating character(1) DEFAULT 'q'::bpchar NOT NULL, - tag_string text NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL -); - - --- --- Name: post_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: post_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_versions_id_seq OWNED BY post_versions.id; - - --- --- Name: post_votes; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE post_votes ( - id integer NOT NULL, - post_id integer NOT NULL, - user_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: post_votes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE post_votes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: post_votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE post_votes_id_seq OWNED BY post_votes.id; - - --- --- Name: posts; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE posts ( - id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - score integer DEFAULT 0 NOT NULL, - source character varying(255), - md5 character varying(255) NOT NULL, - rating character(1) DEFAULT 'q'::bpchar NOT NULL, - is_note_locked boolean DEFAULT false NOT NULL, - is_rating_locked boolean DEFAULT false NOT NULL, - is_pending boolean DEFAULT false NOT NULL, - is_flagged boolean DEFAULT false NOT NULL, - is_deleted boolean DEFAULT false NOT NULL, - uploader_string character varying(255) NOT NULL, - uploader_ip_addr inet NOT NULL, - approver_string character varying(255) DEFAULT ''::character varying NOT NULL, - fav_string text DEFAULT ''::text NOT NULL, - pool_string text DEFAULT ''::text NOT NULL, - view_count integer DEFAULT 0 NOT NULL, - last_noted_at timestamp without time zone, - last_commented_at timestamp without time zone, - tag_string text DEFAULT ''::text NOT NULL, - tag_index tsvector, - tag_count integer DEFAULT 0 NOT NULL, - tag_count_general integer DEFAULT 0 NOT NULL, - tag_count_artist integer DEFAULT 0 NOT NULL, - tag_count_character integer DEFAULT 0 NOT NULL, - tag_count_copyright integer DEFAULT 0 NOT NULL, - file_ext character varying(255) NOT NULL, - file_size integer NOT NULL, - image_width integer NOT NULL, - image_height integer NOT NULL -); - - --- --- Name: posts_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE posts_id_seq OWNED BY posts.id; - - --- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE schema_migrations ( - version character varying(255) NOT NULL -); - - --- --- Name: tag_aliases; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tag_aliases ( - id integer NOT NULL, - antecedent_name character varying(255) NOT NULL, - consequent_name character varying(255) NOT NULL, - creator_id integer NOT NULL, - request_ids character varying(255), - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tag_aliases_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tag_aliases_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: tag_aliases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tag_aliases_id_seq OWNED BY tag_aliases.id; - - --- --- Name: tag_implications; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tag_implications ( - id integer NOT NULL, - antecedent_name character varying(255) NOT NULL, - consequent_name character varying(255) NOT NULL, - descendant_names text NOT NULL, - creator_id integer NOT NULL, - request_ids character varying(255), - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tag_implications_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tag_implications_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: tag_implications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tag_implications_id_seq OWNED BY tag_implications.id; - - --- --- Name: tag_subscriptions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tag_subscriptions ( - id integer NOT NULL, - owner_id integer NOT NULL, - name character varying(255) NOT NULL, - tag_query character varying(255) NOT NULL, - post_ids text NOT NULL, - is_visible_on_profile boolean DEFAULT true NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tag_subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tag_subscriptions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: tag_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tag_subscriptions_id_seq OWNED BY tag_subscriptions.id; - - --- --- Name: tags; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE tags ( - id integer NOT NULL, - name character varying(255) NOT NULL, - post_count integer DEFAULT 0 NOT NULL, - view_count integer DEFAULT 0 NOT NULL, - category integer DEFAULT 0 NOT NULL, - related_tags text, - related_tags_updated_at timestamp without time zone, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: tags_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE tags_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE tags_id_seq OWNED BY tags.id; - - --- --- Name: unapprovals; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE unapprovals ( - id integer NOT NULL, - post_id integer NOT NULL, - reason text, - unapprover_id integer NOT NULL, - unapprover_ip_addr inet NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: unapprovals_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE unapprovals_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: unapprovals_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE unapprovals_id_seq OWNED BY unapprovals.id; - - --- --- Name: uploads; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE uploads ( - id integer NOT NULL, - source character varying(255), - file_path character varying(255), - content_type character varying(255), - rating character(1) NOT NULL, - uploader_id integer NOT NULL, - uploader_ip_addr inet NOT NULL, - tag_string text NOT NULL, - status character varying(255) DEFAULT 'pending'::character varying NOT NULL, - post_id integer, - md5_confirmation character varying(255), - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE uploads_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id; - - --- --- Name: user_feedback; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE user_feedback ( - id integer NOT NULL, - user_id integer NOT NULL, - creator_id integer NOT NULL, - is_positive boolean NOT NULL, - body text NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: user_feedback_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE user_feedback_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: user_feedback_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE user_feedback_id_seq OWNED BY user_feedback.id; - - --- --- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE users ( - id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - name character varying(255) NOT NULL, - password_hash character varying(255) NOT NULL, - email character varying(255), - email_verification_key character varying(255), - inviter_id integer, - is_banned boolean DEFAULT false NOT NULL, - is_privileged boolean DEFAULT false NOT NULL, - is_contributor boolean DEFAULT false NOT NULL, - is_janitor boolean DEFAULT false NOT NULL, - is_moderator boolean DEFAULT false NOT NULL, - is_admin boolean DEFAULT false NOT NULL, - base_upload_limit integer DEFAULT 10 NOT NULL, - last_logged_in_at timestamp without time zone, - last_forum_read_at timestamp without time zone, - has_mail boolean DEFAULT false NOT NULL, - receive_email_notifications boolean DEFAULT false NOT NULL, - comment_threshold integer DEFAULT (-1) NOT NULL, - always_resize_images boolean DEFAULT false NOT NULL, - default_image_size character varying(255) DEFAULT 'large'::character varying NOT NULL, - favorite_tags text, - blacklisted_tags text, - time_zone character varying(255) DEFAULT 'Eastern Time (US & Canada)'::character varying NOT NULL -); - - --- --- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE users_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE users_id_seq OWNED BY users.id; - - --- --- Name: wiki_page_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE wiki_page_versions ( - id integer NOT NULL, - wiki_page_id integer NOT NULL, - updater_id integer NOT NULL, - updater_ip_addr inet NOT NULL, - title character varying(255) NOT NULL, - body text NOT NULL, - is_locked boolean NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: wiki_page_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE wiki_page_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: wiki_page_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE wiki_page_versions_id_seq OWNED BY wiki_page_versions.id; - - --- --- Name: wiki_pages; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE wiki_pages ( - id integer NOT NULL, - creator_id integer NOT NULL, - title character varying(255) NOT NULL, - body text NOT NULL, - body_index tsvector NOT NULL, - is_locked boolean DEFAULT false NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone -); - - --- --- Name: wiki_pages_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE wiki_pages_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - - --- --- Name: wiki_pages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE wiki_pages_id_seq OWNED BY wiki_pages.id; - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE advertisement_hits ALTER COLUMN id SET DEFAULT nextval('advertisement_hits_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE advertisements ALTER COLUMN id SET DEFAULT nextval('advertisements_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE artist_urls ALTER COLUMN id SET DEFAULT nextval('artist_urls_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE artist_versions ALTER COLUMN id SET DEFAULT nextval('artist_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE artists ALTER COLUMN id SET DEFAULT nextval('artists_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE bans ALTER COLUMN id SET DEFAULT nextval('bans_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE comment_votes ALTER COLUMN id SET DEFAULT nextval('comment_votes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE comments ALTER COLUMN id SET DEFAULT nextval('comments_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE dmails ALTER COLUMN id SET DEFAULT nextval('dmails_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_0 ALTER COLUMN id SET DEFAULT nextval('favorites_0_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_1 ALTER COLUMN id SET DEFAULT nextval('favorites_1_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_2 ALTER COLUMN id SET DEFAULT nextval('favorites_2_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_3 ALTER COLUMN id SET DEFAULT nextval('favorites_3_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_4 ALTER COLUMN id SET DEFAULT nextval('favorites_4_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_5 ALTER COLUMN id SET DEFAULT nextval('favorites_5_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_6 ALTER COLUMN id SET DEFAULT nextval('favorites_6_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_7 ALTER COLUMN id SET DEFAULT nextval('favorites_7_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_8 ALTER COLUMN id SET DEFAULT nextval('favorites_8_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE favorites_9 ALTER COLUMN id SET DEFAULT nextval('favorites_9_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE forum_posts ALTER COLUMN id SET DEFAULT nextval('forum_posts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE forum_topics ALTER COLUMN id SET DEFAULT nextval('forum_topics_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ip_bans ALTER COLUMN id SET DEFAULT nextval('ip_bans_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE janitor_trials ALTER COLUMN id SET DEFAULT nextval('janitor_trials_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE jobs ALTER COLUMN id SET DEFAULT nextval('jobs_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE note_versions ALTER COLUMN id SET DEFAULT nextval('note_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE pool_versions ALTER COLUMN id SET DEFAULT nextval('pool_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE pools ALTER COLUMN id SET DEFAULT nextval('pools_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_moderation_details ALTER COLUMN id SET DEFAULT nextval('post_moderation_details_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_versions ALTER COLUMN id SET DEFAULT nextval('post_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE post_votes ALTER COLUMN id SET DEFAULT nextval('post_votes_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE posts ALTER COLUMN id SET DEFAULT nextval('posts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tag_aliases ALTER COLUMN id SET DEFAULT nextval('tag_aliases_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tag_implications ALTER COLUMN id SET DEFAULT nextval('tag_implications_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tag_subscriptions ALTER COLUMN id SET DEFAULT nextval('tag_subscriptions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE tags ALTER COLUMN id SET DEFAULT nextval('tags_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE unapprovals ALTER COLUMN id SET DEFAULT nextval('unapprovals_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE user_feedback ALTER COLUMN id SET DEFAULT nextval('user_feedback_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE wiki_page_versions ALTER COLUMN id SET DEFAULT nextval('wiki_page_versions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE wiki_pages ALTER COLUMN id SET DEFAULT nextval('wiki_pages_id_seq'::regclass); - - --- --- Name: advertisement_hits_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY advertisement_hits - ADD CONSTRAINT advertisement_hits_pkey PRIMARY KEY (id); - - --- --- Name: advertisements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY advertisements - ADD CONSTRAINT advertisements_pkey PRIMARY KEY (id); - - --- --- Name: artist_urls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY artist_urls - ADD CONSTRAINT artist_urls_pkey PRIMARY KEY (id); - - --- --- Name: artist_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY artist_versions - ADD CONSTRAINT artist_versions_pkey PRIMARY KEY (id); - - --- --- Name: artists_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY artists - ADD CONSTRAINT artists_pkey PRIMARY KEY (id); - - --- --- Name: bans_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY bans - ADD CONSTRAINT bans_pkey PRIMARY KEY (id); - - --- --- Name: comment_votes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY comment_votes - ADD CONSTRAINT comment_votes_pkey PRIMARY KEY (id); - - --- --- Name: comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY comments - ADD CONSTRAINT comments_pkey PRIMARY KEY (id); - - --- --- Name: dmails_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY dmails - ADD CONSTRAINT dmails_pkey PRIMARY KEY (id); - - --- --- Name: favorites_0_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_0 - ADD CONSTRAINT favorites_0_pkey PRIMARY KEY (id); - - --- --- Name: favorites_1_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_1 - ADD CONSTRAINT favorites_1_pkey PRIMARY KEY (id); - - --- --- Name: favorites_2_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_2 - ADD CONSTRAINT favorites_2_pkey PRIMARY KEY (id); - - --- --- Name: favorites_3_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_3 - ADD CONSTRAINT favorites_3_pkey PRIMARY KEY (id); - - --- --- Name: favorites_4_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_4 - ADD CONSTRAINT favorites_4_pkey PRIMARY KEY (id); - - --- --- Name: favorites_5_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_5 - ADD CONSTRAINT favorites_5_pkey PRIMARY KEY (id); - - --- --- Name: favorites_6_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_6 - ADD CONSTRAINT favorites_6_pkey PRIMARY KEY (id); - - --- --- Name: favorites_7_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_7 - ADD CONSTRAINT favorites_7_pkey PRIMARY KEY (id); - - --- --- Name: favorites_8_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_8 - ADD CONSTRAINT favorites_8_pkey PRIMARY KEY (id); - - --- --- Name: favorites_9_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY favorites_9 - ADD CONSTRAINT favorites_9_pkey PRIMARY KEY (id); - - --- --- Name: forum_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY forum_posts - ADD CONSTRAINT forum_posts_pkey PRIMARY KEY (id); - - --- --- Name: forum_topics_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY forum_topics - ADD CONSTRAINT forum_topics_pkey PRIMARY KEY (id); - - --- --- Name: ip_bans_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY ip_bans - ADD CONSTRAINT ip_bans_pkey PRIMARY KEY (id); - - --- --- Name: janitor_trials_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY janitor_trials - ADD CONSTRAINT janitor_trials_pkey PRIMARY KEY (id); - - --- --- Name: jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY jobs - ADD CONSTRAINT jobs_pkey PRIMARY KEY (id); - - --- --- Name: note_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY note_versions - ADD CONSTRAINT note_versions_pkey PRIMARY KEY (id); - - --- --- Name: notes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY notes - ADD CONSTRAINT notes_pkey PRIMARY KEY (id); - - --- --- Name: pool_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY pool_versions - ADD CONSTRAINT pool_versions_pkey PRIMARY KEY (id); - - --- --- Name: pools_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY pools - ADD CONSTRAINT pools_pkey PRIMARY KEY (id); - - --- --- Name: post_moderation_details_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_moderation_details - ADD CONSTRAINT post_moderation_details_pkey PRIMARY KEY (id); - - --- --- Name: post_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_versions - ADD CONSTRAINT post_versions_pkey PRIMARY KEY (id); - - --- --- Name: post_votes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY post_votes - ADD CONSTRAINT post_votes_pkey PRIMARY KEY (id); - - --- --- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY posts - ADD CONSTRAINT posts_pkey PRIMARY KEY (id); - - --- --- Name: tag_aliases_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tag_aliases - ADD CONSTRAINT tag_aliases_pkey PRIMARY KEY (id); - - --- --- Name: tag_implications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tag_implications - ADD CONSTRAINT tag_implications_pkey PRIMARY KEY (id); - - --- --- Name: tag_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tag_subscriptions - ADD CONSTRAINT tag_subscriptions_pkey PRIMARY KEY (id); - - --- --- Name: tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY tags - ADD CONSTRAINT tags_pkey PRIMARY KEY (id); - - --- --- Name: unapprovals_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY unapprovals - ADD CONSTRAINT unapprovals_pkey PRIMARY KEY (id); - - --- --- Name: uploads_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY uploads - ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); - - --- --- Name: user_feedback_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY user_feedback - ADD CONSTRAINT user_feedback_pkey PRIMARY KEY (id); - - --- --- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- Name: wiki_page_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY wiki_page_versions - ADD CONSTRAINT wiki_page_versions_pkey PRIMARY KEY (id); - - --- --- Name: wiki_pages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY wiki_pages - ADD CONSTRAINT wiki_pages_pkey PRIMARY KEY (id); - - --- --- Name: index_advertisement_hits_on_advertisement_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_advertisement_hits_on_advertisement_id ON advertisement_hits USING btree (advertisement_id); - - --- --- Name: index_advertisement_hits_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_advertisement_hits_on_created_at ON advertisement_hits USING btree (created_at); - - --- --- Name: index_advertisements_on_ad_type; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_advertisements_on_ad_type ON advertisements USING btree (ad_type); - - --- --- Name: index_artist_urls_on_artist_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_urls_on_artist_id ON artist_urls USING btree (artist_id); - - --- --- Name: index_artist_urls_on_normalized_url; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_urls_on_normalized_url ON artist_urls USING btree (normalized_url); - - --- --- Name: index_artist_versions_on_artist_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_versions_on_artist_id ON artist_versions USING btree (artist_id); - - --- --- Name: index_artist_versions_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_versions_on_name ON artist_versions USING btree (name); - - --- --- Name: index_artist_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artist_versions_on_updater_id ON artist_versions USING btree (updater_id); - - --- --- Name: index_artists_on_group_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artists_on_group_name ON artists USING btree (group_name); - - --- --- Name: index_artists_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_artists_on_name ON artists USING btree (name); - - --- --- Name: index_artists_on_other_names_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_artists_on_other_names_index ON artists USING gin (other_names_index); - - --- --- Name: index_bans_on_expires_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_bans_on_expires_at ON bans USING btree (expires_at); - - --- --- Name: index_bans_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_bans_on_user_id ON bans USING btree (user_id); - - --- --- Name: index_comment_votes_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comment_votes_on_user_id ON comment_votes USING btree (user_id); - - --- --- Name: index_comments_on_body_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comments_on_body_index ON comments USING gin (body_index); - - --- --- Name: index_comments_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_comments_on_post_id ON comments USING btree (post_id); - - --- --- Name: index_dmails_on_message_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_dmails_on_message_index ON dmails USING gin (message_index); - - --- --- Name: index_dmails_on_owner_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_dmails_on_owner_id ON dmails USING btree (owner_id); - - --- --- Name: index_dmails_on_parent_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_dmails_on_parent_id ON dmails USING btree (parent_id); - - --- --- Name: index_favorites_0_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_0_on_post_id ON favorites_0 USING btree (post_id); - - --- --- Name: index_favorites_0_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_0_on_user_id ON favorites_0 USING btree (user_id); - - --- --- Name: index_favorites_1_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_1_on_post_id ON favorites_1 USING btree (post_id); - - --- --- Name: index_favorites_1_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_1_on_user_id ON favorites_1 USING btree (user_id); - - --- --- Name: index_favorites_2_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_2_on_post_id ON favorites_2 USING btree (post_id); - - --- --- Name: index_favorites_2_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_2_on_user_id ON favorites_2 USING btree (user_id); - - --- --- Name: index_favorites_3_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_3_on_post_id ON favorites_3 USING btree (post_id); - - --- --- Name: index_favorites_3_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_3_on_user_id ON favorites_3 USING btree (user_id); - - --- --- Name: index_favorites_4_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_4_on_post_id ON favorites_4 USING btree (post_id); - - --- --- Name: index_favorites_4_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_4_on_user_id ON favorites_4 USING btree (user_id); - - --- --- Name: index_favorites_5_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_5_on_post_id ON favorites_5 USING btree (post_id); - - --- --- Name: index_favorites_5_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_5_on_user_id ON favorites_5 USING btree (user_id); - - --- --- Name: index_favorites_6_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_6_on_post_id ON favorites_6 USING btree (post_id); - - --- --- Name: index_favorites_6_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_6_on_user_id ON favorites_6 USING btree (user_id); - - --- --- Name: index_favorites_7_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_7_on_post_id ON favorites_7 USING btree (post_id); - - --- --- Name: index_favorites_7_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_7_on_user_id ON favorites_7 USING btree (user_id); - - --- --- Name: index_favorites_8_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_8_on_post_id ON favorites_8 USING btree (post_id); - - --- --- Name: index_favorites_8_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_8_on_user_id ON favorites_8 USING btree (user_id); - - --- --- Name: index_favorites_9_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_9_on_post_id ON favorites_9 USING btree (post_id); - - --- --- Name: index_favorites_9_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_favorites_9_on_user_id ON favorites_9 USING btree (user_id); - - --- --- Name: index_forum_posts_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_posts_on_creator_id ON forum_posts USING btree (creator_id); - - --- --- Name: index_forum_posts_on_text_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_posts_on_text_index ON forum_posts USING gin (text_index); - - --- --- Name: index_forum_posts_on_topic_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_posts_on_topic_id ON forum_posts USING btree (topic_id); - - --- --- Name: index_forum_topics_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_topics_on_creator_id ON forum_topics USING btree (creator_id); - - --- --- Name: index_forum_topics_on_text_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_forum_topics_on_text_index ON forum_topics USING gin (text_index); - - --- --- Name: index_ip_bans_on_ip_addr; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_ip_bans_on_ip_addr ON ip_bans USING btree (ip_addr); - - --- --- Name: index_janitor_trials_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_janitor_trials_on_user_id ON janitor_trials USING btree (user_id); - - --- --- Name: index_note_versions_on_note_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_note_versions_on_note_id ON note_versions USING btree (note_id); - - --- --- Name: index_note_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_note_versions_on_updater_id ON note_versions USING btree (updater_id); - - --- --- Name: index_notes_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_notes_on_creator_id ON notes USING btree (creator_id); - - --- --- Name: index_notes_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_notes_on_post_id ON notes USING btree (post_id); - - --- --- Name: index_notes_on_text_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_notes_on_text_index ON notes USING gin (text_index); - - --- --- Name: index_pool_versions_on_pool_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pool_versions_on_pool_id ON pool_versions USING btree (pool_id); - - --- --- Name: index_pools_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pools_on_creator_id ON pools USING btree (creator_id); - - --- --- Name: index_pools_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_pools_on_name ON pools USING btree (name); - - --- --- Name: index_post_moderation_details_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_moderation_details_on_post_id ON post_moderation_details USING btree (post_id); - - --- --- Name: index_post_moderation_details_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_moderation_details_on_user_id ON post_moderation_details USING btree (user_id); - - --- --- Name: index_post_versions_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_versions_on_post_id ON post_versions USING btree (post_id); - - --- --- Name: index_post_versions_on_updater_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_post_versions_on_updater_id ON post_versions USING btree (updater_id); - - --- --- Name: index_posts_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_created_at ON posts USING btree (created_at); - - --- --- Name: index_posts_on_file_size; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_file_size ON posts USING btree (file_size); - - --- --- Name: index_posts_on_image_height; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_image_height ON posts USING btree (image_height); - - --- --- Name: index_posts_on_image_width; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_image_width ON posts USING btree (image_width); - - --- --- Name: index_posts_on_last_commented_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_last_commented_at ON posts USING btree (last_commented_at); - - --- --- Name: index_posts_on_last_noted_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_last_noted_at ON posts USING btree (last_noted_at); - - --- --- Name: index_posts_on_md5; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_posts_on_md5 ON posts USING btree (md5); - - --- --- Name: index_posts_on_mpixels; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_mpixels ON posts USING btree (((((image_width * image_height))::numeric / 1000000.0))); - - --- --- Name: index_posts_on_source; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_source ON posts USING btree (source); - - --- --- Name: index_posts_on_tags_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_tags_index ON posts USING gin (tag_index); - - --- --- Name: index_posts_on_view_count; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_posts_on_view_count ON posts USING btree (view_count); - - --- --- Name: index_tag_aliases_on_antecedent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING btree (antecedent_name); - - --- --- Name: index_tag_aliases_on_consequent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_aliases_on_consequent_name ON tag_aliases USING btree (consequent_name); - - --- --- Name: index_tag_implications_on_antecedent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_implications_on_antecedent_name ON tag_implications USING btree (antecedent_name); - - --- --- Name: index_tag_implications_on_consequent_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_implications_on_consequent_name ON tag_implications USING btree (consequent_name); - - --- --- Name: index_tag_subscriptions_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_subscriptions_on_name ON tag_subscriptions USING btree (name); - - --- --- Name: index_tag_subscriptions_on_owner_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_tag_subscriptions_on_owner_id ON tag_subscriptions USING btree (owner_id); - - --- --- Name: index_tags_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name); - - --- --- Name: index_unapprovals_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_unapprovals_on_post_id ON unapprovals USING btree (post_id); - - --- --- Name: index_user_feedback_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_user_feedback_on_user_id ON user_feedback USING btree (user_id); - - --- --- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_users_on_email ON users USING btree (email); - - --- --- Name: index_users_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_users_on_name ON users USING btree (lower((name)::text)); - - --- --- Name: index_wiki_page_versions_on_wiki_page_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_wiki_page_versions_on_wiki_page_id ON wiki_page_versions USING btree (wiki_page_id); - - --- --- Name: index_wiki_pages_on_body_index_index; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_wiki_pages_on_body_index_index ON wiki_pages USING gin (body_index); - - --- --- Name: index_wiki_pages_on_title; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_wiki_pages_on_title ON wiki_pages USING btree (title); - - --- --- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version); - - --- --- Name: trigger_artists_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_artists_on_update - BEFORE INSERT OR UPDATE ON artists - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('other_names_index', 'public.danbooru', 'other_names'); - - --- --- Name: trigger_comments_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_comments_on_update - BEFORE INSERT OR UPDATE ON comments - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body'); - - --- --- Name: trigger_dmails_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_dmails_on_update - BEFORE INSERT OR UPDATE ON dmails - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('message_index', 'pg_catalog.english', 'title', 'body'); - - --- --- Name: trigger_forum_posts_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_forum_posts_on_update - BEFORE INSERT OR UPDATE ON forum_posts - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'body'); - - --- --- Name: trigger_forum_topics_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_forum_topics_on_update - BEFORE INSERT OR UPDATE ON forum_topics - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'title'); - - --- --- Name: trigger_notes_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_notes_on_update - BEFORE INSERT OR UPDATE ON notes - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'body'); - - --- --- Name: trigger_posts_on_tag_index_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_posts_on_tag_index_update - BEFORE INSERT OR UPDATE ON posts - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('tag_index', 'public.danbooru', 'tag_string', 'fav_string', 'pool_string', 'uploader_string', 'approver_string'); - - --- --- Name: trigger_wiki_pages_on_update; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER trigger_wiki_pages_on_update - BEFORE INSERT OR UPDATE ON wiki_pages - FOR EACH ROW - EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'public.danbooru', 'body', 'title'); - - --- --- PostgreSQL database dump complete --- - -INSERT INTO schema_migrations (version) VALUES ('20100204211522'); - -INSERT INTO schema_migrations (version) VALUES ('20100204214746'); - -INSERT INTO schema_migrations (version) VALUES ('20100205162521'); - -INSERT INTO schema_migrations (version) VALUES ('20100205163027'); - -INSERT INTO schema_migrations (version) VALUES ('20100205224030'); - -INSERT INTO schema_migrations (version) VALUES ('20100209201251'); - -INSERT INTO schema_migrations (version) VALUES ('20100211025616'); - -INSERT INTO schema_migrations (version) VALUES ('20100211181944'); - -INSERT INTO schema_migrations (version) VALUES ('20100211191709'); - -INSERT INTO schema_migrations (version) VALUES ('20100211191716'); - -INSERT INTO schema_migrations (version) VALUES ('20100213181847'); - -INSERT INTO schema_migrations (version) VALUES ('20100213183712'); - -INSERT INTO schema_migrations (version) VALUES ('20100214080549'); - -INSERT INTO schema_migrations (version) VALUES ('20100214080557'); - -INSERT INTO schema_migrations (version) VALUES ('20100214080605'); - -INSERT INTO schema_migrations (version) VALUES ('20100215182234'); - -INSERT INTO schema_migrations (version) VALUES ('20100215213756'); - -INSERT INTO schema_migrations (version) VALUES ('20100215223541'); - -INSERT INTO schema_migrations (version) VALUES ('20100215224629'); - -INSERT INTO schema_migrations (version) VALUES ('20100215224635'); - -INSERT INTO schema_migrations (version) VALUES ('20100215225710'); - -INSERT INTO schema_migrations (version) VALUES ('20100215230642'); - -INSERT INTO schema_migrations (version) VALUES ('20100219230537'); - -INSERT INTO schema_migrations (version) VALUES ('20100221003655'); - -INSERT INTO schema_migrations (version) VALUES ('20100221005812'); - -INSERT INTO schema_migrations (version) VALUES ('20100221012656'); - -INSERT INTO schema_migrations (version) VALUES ('20100223001012'); - -INSERT INTO schema_migrations (version) VALUES ('20100224171915'); - -INSERT INTO schema_migrations (version) VALUES ('20100224172146'); - -INSERT INTO schema_migrations (version) VALUES ('20100307073438'); - -INSERT INTO schema_migrations (version) VALUES ('20100309211553'); - -INSERT INTO schema_migrations (version) VALUES ('20100318213503'); \ No newline at end of file diff --git a/script/upgrade_schema.sql b/script/upgrade_schema.sql index cc76bbfe9..5b45b026b 100755 --- a/script/upgrade_schema.sql +++ b/script/upgrade_schema.sql @@ -2,10 +2,10 @@ alter table posts add column fav_string text not null default ''; alter table posts add column pool_string text not null default ''; -- TODO: REVERT -update posts set fav_string = (select coalesce(string_agg('fav:' || _.user_id, ' '), '') from favorites _ where _.post_id = posts.id) where posts.id < 1000; +update posts set fav_string = (select coalesce(array_to_string(array_agg('fav:' || _.user_id), ' '), '') from favorites _ where _.post_id = posts.id) where posts.id < 1000; -- TODO: REVERT -update posts set pool_string = (select coalesce(string_agg('pool:' || _.pool_id, ' '), '') from pools_posts _ where _.post_id = posts.id) where posts.id < 1000; +update posts set pool_string = (select coalesce(array_to_string(array_agg('pool:' || _.pool_id), ' '), '') from pools_posts _ where _.post_id = posts.id) where posts.id < 1000; create index index_advertisements_on_ad_type on advertisements (ad_type); @@ -2986,7 +2986,7 @@ alter table pools rename column user_id to creator_id; alter table pools drop column is_public; alter table pools add column post_ids text not null default ''; alter index pools_user_id_idx rename to index_pools_on_creator_id; -update pools set post_ids = (select coalesce(string_agg(x.post_id, ' '), '') from (select _.post_id::text from pools_posts _ where _.pool_id = pools.id order by _.sequence) x); +update pools set post_ids = (select coalesce(array_to_string(array_agg(x.post_id), ' '), '') from (select _.post_id::text from pools_posts _ where _.pool_id = pools.id order by _.sequence) x); alter table post_tag_histories rename to post_versions; alter table post_versions drop constraint fk_post_tag_histories__post; @@ -3166,7 +3166,7 @@ alter index idx_users__name rename to index_users_on_name; create index index_users_on_email on users (email) where email is not null; create index index_users_on_inviter_id on users (inviter_id) where inviter_id is not null; update users set post_upload_count = (select count(*) from posts where uploader_id = users.id); -update users set blacklisted_tags = (select string_agg(_.tags, E'\n') from user_blacklisted_tags _ where _.user_id = users.id); +update users set blacklisted_tags = (select array_to_string(array_agg(_.tags), E'\n') from user_blacklisted_tags _ where _.user_id = users.id); update users set post_update_count = (select count(*) from post_versions where updater_id = users.id); update users set note_update_count = (select count(*) from note_versions where updater_id = users.id); update users set favorite_count = (select count(*) from favorites where user_id = users.id);