summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/08to09_pg.sql13
-rw-r--r--db/statusnet_pg.sql10
2 files changed, 18 insertions, 5 deletions
diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql
index de6a82209..b312d47dd 100644
--- a/db/08to09_pg.sql
+++ b/db/08to09_pg.sql
@@ -49,4 +49,15 @@ DROP index subscription_subscribed_idx;
CREATE index subscription_subscribed_idx ON subscription (subscribed,created);
DROP index notice_profile_id_idx;
-CREATE index notice_profile_id_idx ON notice (profile_id,created,id); \ No newline at end of file
+CREATE index notice_profile_id_idx ON notice (profile_id,created,id);
+
+ALTER TABLE notice ADD COLUMN lat decimal(10, 7) /* comment 'latitude'*/;
+ALTER TABLE notice ADD COLUMN lon decimal(10,7) /* comment 'longitude'*/;
+ALTER TABLE notice ADD COLUMN location_id integer /* comment 'location id if possible'*/ ;
+ALTER TABLE notice ADD COLUMN location_ns integer /* comment 'namespace for location'*/;
+
+ALTER TABLE profile ADD COLUMN lat decimal(10,7) /*comment 'latitude'*/ ;
+ALTER TABLE profile ADD COLUMN lon decimal(10,7) /*comment 'longitude'*/;
+ALTER TABLE profile ADD COLUMN location_id integer /* comment 'location id if possible'*/;
+ALTER TABLE profile ADD COLUMN location_ns integer /* comment 'namespace for location'*/;
+ \ No newline at end of file
diff --git a/db/statusnet_pg.sql b/db/statusnet_pg.sql
index 27b189e28..cd72d66ea 100644
--- a/db/statusnet_pg.sql
+++ b/db/statusnet_pg.sql
@@ -1,5 +1,4 @@
/* local and remote users have profiles */
-
create sequence profile_seq;
create table profile (
id bigint default nextval('profile_seq') primary key /* comment 'unique identifier' */,
@@ -132,11 +131,14 @@ create table notice (
reply_to integer /* comment 'notice replied to (usually a guess)' */ references notice (id) ,
is_local integer default 0 /* comment 'notice was generated by a user' */,
source varchar(32) /* comment 'source of comment, like "web", "im", or "clientname"' */,
- conversation integer /*id of root notice in this conversation' */ references notice (id)
-
-
+ conversation integer /*id of root notice in this conversation' */ references notice (id),
+ lat decimal(10,7) /* comment 'latitude'*/ ,
+ lon decimal(10,7) /* comment 'longitude'*/ ,
+ location_id integer /* comment 'location id if possible'*/ ,
+ location_ns integer /* comment 'namespace for location'*/
/* FULLTEXT(content) */
);
+
create index notice_profile_id_idx on notice using btree(profile_id,created,id);
create index notice_created_idx on notice using btree(created);