summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-10-01 15:43:57 -0400
committerEvan Prodromou <evan@status.net>2009-10-01 15:43:57 -0400
commitf65baaaa4f48b84392200bb54161887669440cab (patch)
tree0cb37b09233d85fe834bb9ad8cc0b847e4b3faf6
parent544c58d263e61e2eda3b2c54a4f0a1a6bbfa4910 (diff)
change DB so OpenIDPlugin manages OpenID tables
-rw-r--r--db/statusnet.sql12
-rw-r--r--plugins/OpenID/OpenIDPlugin.php15
2 files changed, 15 insertions, 12 deletions
diff --git a/db/statusnet.sql b/db/statusnet.sql
index 221d60ce3..dfcddb643 100644
--- a/db/statusnet.sql
+++ b/db/statusnet.sql
@@ -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 (
diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php
index 91bddf381..a933a1155 100644
--- a/plugins/OpenID/OpenIDPlugin.php
+++ b/plugins/OpenID/OpenIDPlugin.php
@@ -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;
+ }
}