From 2393fbec6062da4e681b4315e89b27c934a641f1 Mon Sep 17 00:00:00 2001
From: Evan Prodromou <evan@controlyourself.ca>
Date: Mon, 9 Feb 2009 14:47:23 -0500
Subject: add some indices for performance

---
 db/laconica.sql | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'db/laconica.sql')

diff --git a/db/laconica.sql b/db/laconica.sql
index 012270b51..16f482134 100644
--- a/db/laconica.sql
+++ b/db/laconica.sql
@@ -258,7 +258,8 @@ create table notice_tag (
     created datetime not null comment 'date this record was created',
 
     constraint primary key (tag, notice_id),
-    index notice_tag_created_idx (created)
+    index notice_tag_created_idx (created),
+    index notice_tag_notice_id_idx (notice_id)
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
 /* Synching with foreign services */
@@ -356,7 +357,8 @@ create table profile_tag (
 
    constraint primary key (tagger, tagged, tag),
    index profile_tag_modified_idx (modified),
-   index profile_tag_tagger_tag_idx (tagger, tag)
+   index profile_tag_tagger_tag_idx (tagger, tag),
+   index profile_tag_tagged_idx (tagged)
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
 create table profile_block (
@@ -400,7 +402,9 @@ create table group_member (
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
 
-    constraint primary key (group_id, profile_id)
+    constraint primary key (group_id, profile_id),
+    index group_member_profile_id_idx (profile_id),
+    index group_member_created_idx (created)
 
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
-- 
cgit v1.2.3-54-g00ecf


From e686ef042b0f4b3cd8243fa9536092039798837b Mon Sep 17 00:00:00 2001
From: Evan Prodromou <evan@controlyourself.ca>
Date: Thu, 12 Feb 2009 14:16:58 -0500
Subject: Make ID of SMS Carrier not autoincrement

Since we're doing fixed IDs for SMS Carrier, we change the definition
so it's not auto increment.
---
 classes/laconica.ini | 3 ++-
 db/laconica.sql      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

(limited to 'db/laconica.sql')

diff --git a/classes/laconica.ini b/classes/laconica.ini
index 255122a97..19267f268 100755
--- a/classes/laconica.ini
+++ b/classes/laconica.ini
@@ -292,7 +292,8 @@ created = 142
 modified = 384
 
 [sms_carrier__keys]
-id = N
+id = K
+name = U
 
 [subscription]
 subscriber = 129
diff --git a/db/laconica.sql b/db/laconica.sql
index 16f482134..15f03a978 100644
--- a/db/laconica.sql
+++ b/db/laconica.sql
@@ -31,7 +31,7 @@ create table avatar (
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
 create table sms_carrier (
-    id integer auto_increment primary key comment 'primary key for SMS carrier',
+    id integer primary key comment 'primary key for SMS carrier',
     name varchar(64) unique key comment 'name of the carrier',
     email_pattern varchar(255) not null comment 'sprintf pattern for making an email address from a phone number',
     created datetime not null comment 'date this record was created',
-- 
cgit v1.2.3-54-g00ecf


From affb2f9359ee498c2c20240b592a0f62a770e8c8 Mon Sep 17 00:00:00 2001
From: Evan Prodromou <evan@controlyourself.ca>
Date: Mon, 16 Feb 2009 18:24:43 -0500
Subject: add email notify flag for @-replies

---
 classes/User.php     | 7 +++++--
 classes/laconica.ini | 1 +
 db/laconica.sql      | 1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

(limited to 'db/laconica.sql')

diff --git a/classes/User.php b/classes/User.php
index a6a1b11b9..495a98236 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -40,6 +40,7 @@ class User extends Memcached_DataObject
     public $emailnotifyfav;                  // tinyint(1)   default_1
     public $emailnotifynudge;                // tinyint(1)   default_1
     public $emailnotifymsg;                  // tinyint(1)   default_1
+    public $emailnotifyattn;                 // tinyint(1)   default_1
     public $emailmicroid;                    // tinyint(1)   default_1
     public $language;                        // varchar(50)
     public $timezone;                        // varchar(50)
@@ -62,8 +63,10 @@ class User extends Memcached_DataObject
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
     /* Static get */
-    function staticGet($k,$v=null)
-    { return Memcached_DataObject::staticGet('User',$k,$v); }
+    function staticGet($k,$v=NULL)
+    {
+        return Memcached_DataObject::staticGet('User',$k,$v);
+    }
 
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
diff --git a/classes/laconica.ini b/classes/laconica.ini
index 19267f268..5fd2cd1f8 100755
--- a/classes/laconica.ini
+++ b/classes/laconica.ini
@@ -332,6 +332,7 @@ emailnotifysub = 17
 emailnotifyfav = 17
 emailnotifynudge = 17
 emailnotifymsg = 17
+emailnotifyattn = 17
 emailmicroid = 17
 language = 2
 timezone = 2
diff --git a/db/laconica.sql b/db/laconica.sql
index 15f03a978..dd93a727b 100644
--- a/db/laconica.sql
+++ b/db/laconica.sql
@@ -50,6 +50,7 @@ create table user (
     emailnotifyfav tinyint default 1 comment 'Notify by email of favorites',
     emailnotifynudge tinyint default 1 comment 'Notify by email of nudges',
     emailnotifymsg tinyint default 1 comment 'Notify by email of direct messages',
+    emailnotifyattn tinyint default 1 comment 'Notify by email of @-replies',
     emailmicroid tinyint default 1 comment 'whether to publish email microid',
     language varchar(50) comment 'preferred language',
     timezone varchar(50) comment 'timezone',
-- 
cgit v1.2.3-54-g00ecf

