]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add database tables for foreign services
authorEvan Prodromou <evan@prodromou.name>
Tue, 19 Aug 2008 22:12:14 +0000 (18:12 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 19 Aug 2008 22:12:14 +0000 (18:12 -0400)
darcs-hash:20080819221214-84dde-15683b1e146b9e29064aa8ae04bc7daebfaf2e92.gz

classes/Foreign_service.php [new file with mode: 0644]
classes/Foreign_subscription.php [new file with mode: 0644]
classes/Foreign_user.php [new file with mode: 0644]
classes/stoica.ini
db/laconica.sql

diff --git a/classes/Foreign_service.php b/classes/Foreign_service.php
new file mode 100644 (file)
index 0000000..ec38c54
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Table Definition for foreign_service
+ */
+require_once 'DB/DataObject.php';
+
+class Foreign_service extends DB_DataObject 
+{
+    ###START_AUTOCODE
+    /* the code below is auto generated do not remove the above tag */
+
+    public $__table = 'foreign_service';                 // table name
+    public $id;                              // int(4)  primary_key not_null
+    public $name;                            // varchar(32)  unique_key not_null
+    public $description;                     // varchar(255)  
+    public $created;                         // datetime()   not_null
+    public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
+
+    /* Static get */
+    function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Foreign_service',$k,$v); }
+
+    /* the code above is auto generated do not remove the tag below */
+    ###END_AUTOCODE
+}
diff --git a/classes/Foreign_subscription.php b/classes/Foreign_subscription.php
new file mode 100644 (file)
index 0000000..b8cbed8
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Table Definition for foreign_subscription
+ */
+require_once 'DB/DataObject.php';
+
+class Foreign_subscription extends DB_DataObject 
+{
+    ###START_AUTOCODE
+    /* the code below is auto generated do not remove the above tag */
+
+    public $__table = 'foreign_subscription';            // table name
+    public $service;                         // int(4)  primary_key not_null
+    public $subscriber;                      // int(4)  primary_key not_null
+    public $subscribed;                      // int(4)  primary_key not_null
+    public $created;                         // datetime()   not_null
+
+    /* Static get */
+    function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Foreign_subscription',$k,$v); }
+
+    /* the code above is auto generated do not remove the tag below */
+    ###END_AUTOCODE
+}
diff --git a/classes/Foreign_user.php b/classes/Foreign_user.php
new file mode 100644 (file)
index 0000000..98034df
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Table Definition for foreign_user
+ */
+require_once 'DB/DataObject.php';
+
+class Foreign_user extends DB_DataObject 
+{
+    ###START_AUTOCODE
+    /* the code below is auto generated do not remove the above tag */
+
+    public $__table = 'foreign_user';                    // table name
+    public $id;                              // int(4)  primary_key not_null
+    public $service;                         // int(4)  primary_key not_null
+    public $uri;                             // varchar(255)  unique_key not_null
+    public $nickname;                        // varchar(255)  
+    public $user_id;                         // int(4)  
+    public $credentials;                     // varchar(255)  
+    public $created;                         // datetime()   not_null
+    public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
+
+    /* Static get */
+    function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Foreign_user',$k,$v); }
+
+    /* the code above is auto generated do not remove the tag below */
+    ###END_AUTOCODE
+}
index 8a21d33ceb6c983f68ab81d86d1d2bc83b2eaa15..4dead961001856f69c6774ead0253e50eb6df503 100644 (file)
@@ -47,6 +47,43 @@ modified = 384
 notice_id = K
 user_id = K
 
+[foreign_service]
+id = 129
+name = 130
+description = 2
+created = 142
+modified = 384
+
+[foreign_service__keys]
+id = K
+name = U
+
+[foreign_subscription]
+service = 129
+subscriber = 129
+subscribed = 129
+created = 142
+
+[foreign_subscription__keys]
+service = K
+subscriber = K
+subscribed = K
+
+[foreign_user]
+id = 129
+service = 129
+uri = 130
+nickname = 2
+user_id = 1
+credentials = 2
+created = 142
+modified = 384
+
+[foreign_user__keys]
+id = K
+service = K
+uri = U
+
 [nonce]
 consumer_key = 130
 tok = 130
index 16faf53a0bd81a18d70023fa764bb1ddb2979d00..da2a1c89dfff14245a7c066843c5197480ef5ea8 100644 (file)
@@ -251,3 +251,38 @@ create table notice_tag (
     constraint primary key (tag, notice_id),
     index notice_tag_created_idx (created)
 ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;
+
+/* Synching with foreign services */
+
+create table foreign_service (
+     id int not null primary key comment 'numeric key for service',
+     name varchar(32) not null unique key comment 'name of the service',
+     description varchar(255) comment 'description',
+     created datetime not null comment 'date this record was created',
+     modified timestamp comment 'date this record was modified'
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table foreign_user (
+     id int not null comment 'unique numeric key on foreign service',
+     service int not null comment 'foreign key to service' references foreign_service(id),
+     uri varchar(255) not null unique key comment 'identifying URI',
+     nickname varchar(255) comment 'nickname on foreign service',
+     user_id int comment 'link to user on this system, if exists' references user (id), 
+     credentials varchar(255) comment 'authc credentials, typically a password',
+     created datetime not null comment 'date this record was created',
+     modified timestamp comment 'date this record was modified',
+     
+     constraint primary key (id, service),
+     index foreign_user_user_id_idx (user_id)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table foreign_subscription (
+     service int not null comment 'service where relationship happens' references foreign_service(id),
+     subscriber int not null comment 'subscriber on foreign service' references foreign_user (id),
+     subscribed int not null comment 'subscribed user' references foreign_user (id),
+     created datetime not null comment 'date this record was created',
+     
+     constraint primary key (service, subscriber, subscribed),
+     index foreign_subscription_subscriber_idx (subscriber),
+     index foreign_subscription_subscribed_idx (subscribed)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;