]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
change DB so OpenIDPlugin manages OpenID tables
authorEvan Prodromou <evan@status.net>
Thu, 1 Oct 2009 19:43:57 +0000 (15:43 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 1 Oct 2009 19:43:57 +0000 (15:43 -0400)
db/statusnet.sql
plugins/OpenID/OpenIDPlugin.php

index 221d60ce37a6b336ee6bf0be95bae0e44226d96b..dfcddb643c8b8004d1043c73053329c69c45852a 100644 (file)
@@ -195,18 +195,6 @@ create table nonce (
     constraint primary key (consumer_key, ts, nonce)
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
-/* One-to-many relationship of user to openid_url */
-
-create table user_openid (
-    canonical varchar(255) primary key comment 'Canonical true URL',
-    display varchar(255) not null unique key comment 'URL for viewing, may be different from canonical',
-    user_id integer not null comment 'user owning this URL' references user (id),
-    created datetime not null comment 'date this record was created',
-    modified timestamp comment 'date this record was modified',
-
-    index user_openid_user_id_idx (user_id)
-) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
-
 /* These are used by JanRain OpenID library */
 
 create table oid_associations (
index 91bddf381f4f989ee41362eb83fdba083feea173..a933a1155510296983c2cd1bf2cdcbc7d2776bb9 100644 (file)
@@ -222,4 +222,19 @@ class OpenIDPlugin extends Plugin
 
         return true;
     }
+
+    function onCheckSchema() {
+        $schema = Schema::get();
+        $schema->ensureTable('user_openid',
+                             array(new ColumnDef('canonical', 'varchar',
+                                                 '255', false, 'PRI'),
+                                   new ColumnDef('display', 'varchar',
+                                                 '255', false),
+                                   new ColumnDef('user_id', 'integer',
+                                                 null, false, 'MUL'),
+                                   new ColumnDef('created', 'datetime',
+                                                 null, false),
+                                   new ColumnDef('modified', 'timestamp')));
+        return true;
+    }
 }