Skip to content

Commit

Permalink
Index fingerprints on identities
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Sep 19, 2013
1 parent 8f2a707 commit bb27450
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
25 changes: 16 additions & 9 deletions db/development_structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--

SET statement_timeout = 0;
SET client_encoding = 'SQL_ASCII';
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
Expand Down Expand Up @@ -87,8 +87,8 @@ CREATE TABLE accounts (
image_url text,
email text,
synced_at timestamp without time zone,
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
);


Expand Down Expand Up @@ -277,8 +277,8 @@ CREATE TABLE identities (
realm_id integer NOT NULL,
primary_account_id integer,
god boolean DEFAULT false,
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,
last_seen_on date,
fingerprints tsvector,
tags tsvector
Expand Down Expand Up @@ -385,8 +385,8 @@ CREATE TABLE realms (
title text,
label text NOT NULL,
service_keys text,
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,
primary_domain_id integer
);

Expand Down Expand Up @@ -427,8 +427,8 @@ CREATE TABLE sessions (
id integer NOT NULL,
identity_id integer,
key text,
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
);


Expand Down Expand Up @@ -701,6 +701,13 @@ CREATE UNIQUE INDEX index_domains_on_name ON domains USING btree (name);
CREATE INDEX index_domains_on_realm_id ON domains USING btree (realm_id);


--
-- Name: index_fingerprints_on_identities; Type: INDEX; Schema: public; Owner: -; Tablespace:
--

CREATE INDEX index_fingerprints_on_identities ON identities USING gist (fingerprints);


--
-- Name: index_group_subtrees_on_group_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
Expand Down
9 changes: 9 additions & 0 deletions db/migrate/20130919084945_add_fingerprints_index.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddFingerprintsIndex < ActiveRecord::Migration
def self.up
execute "create index index_fingerprints_on_identities on identities using gist(fingerprints)"
end

def self.down
execute "drop index index_fingerprints_on_identities"
end
end

0 comments on commit bb27450

Please sign in to comment.