diff --git a/app/assets/stylesheets/specific/comments.css.scss b/app/assets/stylesheets/specific/comments.css.scss
index b4c6b353f..c7c793c4e 100644
--- a/app/assets/stylesheets/specific/comments.css.scss
+++ b/app/assets/stylesheets/specific/comments.css.scss
@@ -23,7 +23,7 @@ div.comments-for-post {
menu {
li {
- margin-right: 0.5em;
+ margin-right: 1em;
}
}
}
diff --git a/app/models/upload.rb b/app/models/upload.rb
index 5454eb8d4..a0aba0c9c 100644
--- a/app/models/upload.rb
+++ b/app/models/upload.rb
@@ -220,7 +220,7 @@ class Upload < ActiveRecord::Base
"#{Rails.root}/public/data/preview/#{prefix}#{md5}.jpg"
when Danbooru.config.large_image_width
- "#{Rails.root}/public/data/sample/#{prefix}#{md5}.jpg"
+ "#{Rails.root}/public/data/sample/#{Danbooru.config.large_image_prefix}#{prefix}#{md5}.jpg"
end
end
diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb
index 50c0370eb..fbe67bd63 100644
--- a/app/presenters/post_presenter.rb
+++ b/app/presenters/post_presenter.rb
@@ -43,6 +43,17 @@ class PostPresenter < Presenter
@tag_set_presenter.tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_privileged?))
end
+ def post_footer_for_pool_html(template)
+ if template.params[:pool_id]
+ pool = Pool.where(:id => template.params[:pool_id]).first
+ return if pool.nil?
+ return if pool.neighbors(@post).next.nil?
+ template.link_to("Next in #{pool.name}", template.post_path(pool.neighbors(@post).next))
+ else
+ nil
+ end
+ end
+
def pool_html(template)
html = ["
"]
diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb
index bc69f0274..e3826e2e4 100644
--- a/app/views/layouts/default.html.erb
+++ b/app/views/layouts/default.html.erb
@@ -1,5 +1,5 @@
-
+
<%= yield :page_title %>
diff --git a/app/views/posts/partials/show/_share.html.erb b/app/views/posts/partials/show/_share.html.erb
index 675f3d322..3c4f9160e 100644
--- a/app/views/posts/partials/show/_share.html.erb
+++ b/app/views/posts/partials/show/_share.html.erb
@@ -7,7 +7,14 @@
-
+
+
diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb
index 89746af03..b34ff2270 100644
--- a/app/views/posts/show.html.erb
+++ b/app/views/posts/show.html.erb
@@ -93,8 +93,8 @@
-
-
+
+
<% end %>
diff --git a/db/seeds.rb b/db/seeds.rb
index ef744505c..dbc259d59 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,3 +1,5 @@
+CurrentUser.ip_addr = "127.0.0.1"
+
if User.count == 0
puts "Creating users"
user = User.create(
@@ -15,11 +17,10 @@ if User.count == 0
end
else
puts "Skipping users"
- user = User.first
+ user = User.find_by_name("albert")
end
CurrentUser.user = user
-CurrentUser.ip_addr = "127.0.0.1"
if Upload.count == 0
puts "Creating uploads"
@@ -28,7 +29,7 @@ if Upload.count == 0
color2 = rand(4096).to_s(16)
width = rand(2000) + 100
height = rand(2000) + 100
- url = "http://dummyimage.com/#{width}x#{height}/#{color1}/#{color2}"
+ url = "http://ipsumimage.appspot.com/#{width}x#{height}"
tags = (i * i * i).to_s.scan(/./).uniq.join(" ")
Upload.create(:source => url, :content_type => "image/gif", :rating => "q", :tag_string => tags)
diff --git a/db/structure.sql b/db/structure.sql
index 185f9b83b..814d82196 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -18,32 +18,6 @@ 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: -
--
@@ -54,8 +28,7 @@ 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
@@ -358,28 +331,6 @@ 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: -
--
@@ -416,18 +367,6 @@ 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: -
--
@@ -461,10 +400,10 @@ SET default_with_oids = false;
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
+ 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
);
@@ -493,15 +432,16 @@ ALTER SEQUENCE advertisement_hits_id_seq OWNED BY advertisement_hits.id;
CREATE TABLE advertisements (
id integer NOT NULL,
- referral_url character varying(1000) 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,
- file_name character varying(255),
- created_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -531,8 +471,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,
- updated_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -564,8 +504,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 DEFAULT now() NOT NULL,
- updated_at timestamp without time zone DEFAULT now() NOT NULL
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -594,17 +534,17 @@ ALTER SEQUENCE artist_urls_id_seq OWNED BY artist_urls.id;
CREATE TABLE artist_versions (
id integer NOT NULL,
- artist_id integer,
- name text,
- updater_id integer,
- url_string text,
- created_at timestamp without time zone,
- updated_at timestamp without time zone,
+ 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,
- updater_ip_addr inet DEFAULT '127.0.0.1'::inet,
- other_names text DEFAULT ''::text
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -633,15 +573,15 @@ ALTER SEQUENCE artist_versions_id_seq OWNED BY artist_versions.id;
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,
- creator_id integer,
+ name character varying(255) NOT NULL,
+ creator_id integer NOT NULL,
is_active boolean DEFAULT true NOT NULL,
- group_name character varying(255),
is_banned boolean DEFAULT false NOT NULL,
- other_names text DEFAULT ''::text,
- other_names_index tsvector
+ 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
);
@@ -670,12 +610,12 @@ ALTER SEQUENCE artists_id_seq OWNED BY artists.id;
CREATE TABLE bans (
id integer NOT NULL,
- user_id integer NOT NULL,
+ user_id integer,
reason text NOT NULL,
- expires_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
+ expires_at timestamp without time zone NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -706,9 +646,9 @@ 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,
- score integer DEFAULT 0 NOT NULL
+ score integer NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -737,14 +677,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,
+ creator_id integer NOT NULL,
body text NOT NULL,
ip_addr inet NOT NULL,
- body_index tsvector,
+ body_index tsvector NOT NULL,
score integer DEFAULT 0 NOT NULL,
- updated_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -781,8 +721,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,
- updated_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -819,8 +759,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,
- updated_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -1779,14 +1719,14 @@ ALTER SEQUENCE favorites_id_seq OWNED BY favorites.id;
CREATE TABLE forum_posts (
id integer NOT NULL,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL,
- creator_id integer,
+ topic_id integer NOT NULL,
+ creator_id integer NOT NULL,
+ updater_id integer NOT NULL,
body text NOT NULL,
- updater_id integer,
- text_index tsvector,
+ text_index tsvector NOT NULL,
is_deleted boolean DEFAULT false NOT NULL,
- topic_id integer
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -1821,10 +1761,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,
- updated_at timestamp without time zone,
- is_deleted boolean DEFAULT false NOT NULL
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -1852,12 +1792,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,
- created_at timestamp without time zone,
- updated_at timestamp without time zone,
- id integer NOT NULL
+ reason text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -1885,12 +1825,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,
- updated_at timestamp without time zone,
- id integer NOT NULL,
- creator_id integer DEFAULT 1 NOT NULL
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -1919,10 +1859,10 @@ ALTER SEQUENCE janitor_trials_id_seq OWNED BY janitor_trials.id;
CREATE TABLE mod_actions (
id integer NOT NULL,
- creator_id integer,
- description text,
- created_at timestamp without time zone,
- updated_at timestamp without time zone
+ 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
);
@@ -1954,8 +1894,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,
- updated_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -1984,18 +1924,18 @@ ALTER SEQUENCE news_updates_id_seq OWNED BY news_updates.id;
CREATE TABLE note_versions (
id integer NOT NULL,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone 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,
- body text 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
+ body text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2024,17 +1964,17 @@ ALTER SEQUENCE note_versions_id_seq OWNED BY note_versions.id;
CREATE TABLE notes (
id integer NOT NULL,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL,
- creator_id integer,
+ 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,
- post_id integer NOT NULL,
body text NOT NULL,
- body_index tsvector
+ body_index tsvector NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2062,13 +2002,13 @@ ALTER SEQUENCE notes_id_seq OWNED BY notes.id;
--
CREATE TABLE pool_versions (
- pool_id integer NOT NULL,
+ id integer NOT NULL,
+ pool_id integer,
post_ids text DEFAULT ''::text 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
+ 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
);
@@ -2097,15 +2037,15 @@ ALTER SEQUENCE pool_versions_id_seq OWNED BY pool_versions.id;
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,
+ name character varying(255),
creator_id integer NOT NULL,
- post_count integer DEFAULT 0 NOT NULL,
- description text DEFAULT ''::text 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,
- post_ids text DEFAULT ''::text NOT NULL
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2134,12 +2074,12 @@ ALTER SEQUENCE pools_id_seq OWNED BY pools.id;
CREATE TABLE post_appeals (
id integer 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
+ 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
);
@@ -2167,11 +2107,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 DEFAULT now(),
- updated_at timestamp without time zone DEFAULT now(),
- id integer NOT NULL
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2199,14 +2139,14 @@ ALTER SEQUENCE post_disapprovals_id_seq OWNED BY post_disapprovals.id;
--
CREATE TABLE post_flags (
- created_at timestamp without time zone NOT NULL,
+ id integer 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
+ 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
);
@@ -2234,15 +2174,16 @@ ALTER SEQUENCE post_flags_id_seq OWNED BY post_flags.id;
--
CREATE TABLE post_versions (
- post_id integer NOT NULL,
- tags text NOT NULL,
- updater_id integer,
- updater_ip_addr inet NOT NULL,
+ 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,
rating character(1),
parent_id integer,
source text,
- id integer NOT NULL
+ updater_id integer NOT NULL,
+ updater_ip_addr inet NOT NULL
);
@@ -2273,9 +2214,9 @@ 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
+ score integer NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2305,40 +2246,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,
- uploader_id integer,
+ updated_at timestamp without time zone NOT NULL,
+ up_score integer DEFAULT 0 NOT NULL,
+ down_score integer DEFAULT 0 NOT NULL,
score integer DEFAULT 0 NOT NULL,
- source text,
- md5 text NOT NULL,
- last_commented_at timestamp without time zone,
+ source character varying(255),
+ md5 character varying(255) 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,
+ 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_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
+ 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
);
@@ -2376,15 +2317,14 @@ CREATE TABLE schema_migrations (
CREATE TABLE tag_aliases (
id integer 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,
+ 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,
- 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()
+ status text DEFAULT 'pending'::text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2413,16 +2353,15 @@ ALTER SEQUENCE tag_aliases_id_seq OWNED BY tag_aliases.id;
CREATE TABLE tag_implications (
id integer 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,
+ 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,
- created_at timestamp without time zone DEFAULT now(),
- updated_at timestamp without time zone DEFAULT now()
+ status text DEFAULT 'pending'::text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2450,16 +2389,16 @@ ALTER SEQUENCE tag_implications_id_seq OWNED BY tag_implications.id;
--
CREATE TABLE tag_subscriptions (
- creator_id integer 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,
+ 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
+ is_opted_in boolean DEFAULT false NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2488,13 +2427,13 @@ ALTER SEQUENCE tag_subscriptions_id_seq OWNED BY tag_subscriptions.id;
CREATE TABLE tags (
id integer NOT NULL,
- name text 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 DEFAULT now(),
- category smallint DEFAULT 0 NOT NULL,
- created_at timestamp without time zone,
- updated_at timestamp without time zone
+ related_tags_updated_at timestamp without time zone,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2534,8 +2473,8 @@ CREATE TABLE uploads (
backtrace text,
post_id integer,
md5_confirmation character varying(255),
- created_at timestamp without time zone,
- updated_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2563,13 +2502,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,
- created_at timestamp without time zone DEFAULT now() NOT NULL,
+ category character varying(255) NOT NULL,
body text NOT NULL,
- category character varying(255) DEFAULT ''::character varying NOT NULL,
- id integer NOT NULL,
- updated_at timestamp without time zone DEFAULT now()
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2600,8 +2539,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,
- updated_at timestamp without time zone
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -2630,31 +2569,31 @@ ALTER SEQUENCE user_password_reset_nonces_id_seq OWNED BY user_password_reset_no
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,
- 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,
+ 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,
- 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,
+ 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,
- post_upload_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
);
@@ -2683,14 +2622,14 @@ ALTER SEQUENCE users_id_seq OWNED BY users.id;
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,
- 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
+ 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
);
@@ -2719,13 +2658,13 @@ ALTER SEQUENCE wiki_page_versions_id_seq OWNED BY wiki_page_versions.id;
CREATE TABLE wiki_pages (
id integer NOT NULL,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL,
- title text NOT NULL,
+ creator_id integer NOT NULL,
+ title character varying(255) NOT NULL,
body text NOT NULL,
- creator_id integer,
+ body_index tsvector NOT NULL,
is_locked boolean DEFAULT false NOT NULL,
- body_index tsvector
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
);
@@ -3826,14 +3765,6 @@ 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:
--
@@ -4089,6 +4020,13 @@ 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:
--
@@ -4096,6 +4034,20 @@ CREATE INDEX index_artist_versions_on_artist_id ON artist_versions USING btree (
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:
--
@@ -4146,10 +4098,10 @@ CREATE INDEX index_comment_votes_on_user_id ON comment_votes USING btree (user_i
--
--- Name: index_comments_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_comments_on_body_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_comments_on_creator_id ON comments USING btree (creator_id);
+CREATE INDEX index_comments_on_body_index ON comments USING gin (body_index);
--
@@ -4159,13 +4111,6 @@ CREATE INDEX index_comments_on_creator_id ON comments USING btree (creator_id);
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:
--
@@ -5608,13 +5553,6 @@ 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:
--
@@ -5633,28 +5571,14 @@ 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 INDEX index_ip_bans_on_ip_addr ON ip_bans USING btree (ip_addr);
+CREATE UNIQUE INDEX index_ip_bans_on_ip_addr ON ip_bans USING btree (ip_addr);
--
--- Name: index_janitor_trials_on_creator_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_janitor_trials_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-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);
+CREATE INDEX index_janitor_trials_on_user_id ON janitor_trials USING btree (user_id);
--
@@ -5742,10 +5666,10 @@ CREATE INDEX index_pools_on_creator_id ON pools USING btree (creator_id);
--
--- Name: index_post_appeals_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_pools_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_post_appeals_on_created_at ON post_appeals USING btree (created_at);
+CREATE INDEX index_pools_on_name ON pools USING btree (name);
--
@@ -5825,13 +5749,6 @@ 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:
--
@@ -5846,13 +5763,6 @@ 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:
--
@@ -5892,14 +5802,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) WHERE (last_commented_at IS NOT NULL);
+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) WHERE (last_noted_at IS NOT NULL);
+CREATE INDEX index_posts_on_last_noted_at ON posts USING btree (last_noted_at);
--
@@ -5920,7 +5830,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) WHERE (parent_id IS NOT NULL);
+CREATE INDEX index_posts_on_parent_id ON posts USING btree (parent_id);
--
@@ -5938,17 +5848,17 @@ CREATE INDEX index_posts_on_source_pattern ON posts USING btree (source text_pat
--
--- Name: index_posts_on_tag_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_posts_on_tags_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_posts_on_tag_index ON posts USING gin (tag_index);
+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) WHERE (uploader_id IS NOT NULL);
+CREATE INDEX index_posts_on_uploader_id ON posts USING btree (uploader_id);
--
@@ -5962,7 +5872,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 UNIQUE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING btree (antecedent_name);
+CREATE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING btree (antecedent_name);
--
@@ -5972,6 +5882,20 @@ CREATE UNIQUE INDEX index_tag_aliases_on_antecedent_name ON tag_aliases USING bt
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:
--
@@ -6000,13 +5924,6 @@ 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:
--
@@ -6021,6 +5938,13 @@ 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:
--
@@ -6032,28 +5956,14 @@ 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 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);
+CREATE UNIQUE INDEX index_users_on_email ON users USING btree (email);
--
-- Name: index_users_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-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);
+CREATE UNIQUE INDEX index_users_on_name ON users USING btree (lower((name)::text));
--
@@ -6064,10 +5974,10 @@ CREATE INDEX index_wiki_page_versions_on_wiki_page_id ON wiki_page_versions USIN
--
--- Name: index_wiki_pages_on_body_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+-- Name: index_wiki_pages_on_body_index_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
-CREATE INDEX index_wiki_pages_on_body_index ON wiki_pages USING gin (body_index);
+CREATE INDEX index_wiki_pages_on_body_index_index ON wiki_pages USING gin (body_index);
--
@@ -6084,13 +5994,6 @@ 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:
--