utf8mb4 conversion on database with index adjusts
This commit is contained in:
@@ -62,7 +62,7 @@ class FeedSub extends Managed_DataObject
|
||||
public $__table = 'feedsub';
|
||||
|
||||
public $id;
|
||||
public $uri;
|
||||
public $uri; // varchar(191) not 255 because utf8mb4 takes more space
|
||||
|
||||
// PuSH subscription data
|
||||
public $huburi;
|
||||
@@ -80,7 +80,7 @@ class FeedSub extends Managed_DataObject
|
||||
return array(
|
||||
'fields' => array(
|
||||
'id' => array('type' => 'serial', 'not null' => true, 'description' => 'FeedSub local unique id'),
|
||||
'uri' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'FeedSub uri'),
|
||||
'uri' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'FeedSub uri'),
|
||||
'huburi' => array('type' => 'text', 'description' => 'FeedSub hub-uri'),
|
||||
'secret' => array('type' => 'text', 'description' => 'FeedSub stored secret'),
|
||||
'sub_state' => array('type' => 'enum("subscribe","active","unsubscribe","inactive","nohub")', 'not null' => true, 'description' => 'subscription state'),
|
||||
|
@@ -31,8 +31,8 @@ class HubSub extends Managed_DataObject
|
||||
public $__table = 'hubsub';
|
||||
|
||||
public $hashkey; // sha1(topic . '|' . $callback); (topic, callback) key is too long for myisam in utf8
|
||||
public $topic;
|
||||
public $callback;
|
||||
public $topic; // varchar(191) not 255 because utf8mb4 takes more space
|
||||
public $callback; // varchar(191) not 255 because utf8mb4 takes more space
|
||||
public $secret;
|
||||
public $lease;
|
||||
public $sub_start;
|
||||
@@ -55,8 +55,8 @@ class HubSub extends Managed_DataObject
|
||||
return array(
|
||||
'fields' => array(
|
||||
'hashkey' => array('type' => 'char', 'not null' => true, 'length' => 40, 'description' => 'HubSub hashkey'),
|
||||
'topic' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'HubSub topic'),
|
||||
'callback' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'HubSub callback'),
|
||||
'topic' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'HubSub topic'),
|
||||
'callback' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'HubSub callback'),
|
||||
'secret' => array('type' => 'text', 'description' => 'HubSub stored secret'),
|
||||
'lease' => array('type' => 'int', 'description' => 'HubSub leasetime'),
|
||||
'sub_start' => array('type' => 'datetime', 'description' => 'subscription start'),
|
||||
|
@@ -51,12 +51,12 @@ class Ostatus_profile extends Managed_DataObject
|
||||
{
|
||||
return array(
|
||||
'fields' => array(
|
||||
'uri' => array('type' => 'varchar', 'length' => 255, 'not null' => true),
|
||||
'uri' => array('type' => 'varchar', 'length' => 191, 'not null' => true),
|
||||
'profile_id' => array('type' => 'integer'),
|
||||
'group_id' => array('type' => 'integer'),
|
||||
'peopletag_id' => array('type' => 'integer'),
|
||||
'feeduri' => array('type' => 'varchar', 'length' => 255),
|
||||
'salmonuri' => array('type' => 'varchar', 'length' => 255),
|
||||
'feeduri' => array('type' => 'varchar', 'length' => 191),
|
||||
'salmonuri' => array('type' => 'varchar', 'length' => 191),
|
||||
'avatar' => array('type' => 'text'),
|
||||
'created' => array('type' => 'datetime', 'not null' => true),
|
||||
'modified' => array('type' => 'datetime', 'not null' => true),
|
||||
@@ -1806,8 +1806,8 @@ class Ostatus_profile extends Managed_DataObject
|
||||
}
|
||||
|
||||
if (!empty($location)) {
|
||||
if (mb_strlen($location) > 255) {
|
||||
$location = mb_substr($note, 0, 255 - 3) . ' … ';
|
||||
if (mb_strlen($location) > 191) { // not 255 because utf8mb4 takes more space
|
||||
$location = mb_substr($note, 0, 191 - 3) . ' … ';
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@ class Ostatus_source extends Managed_DataObject
|
||||
return array(
|
||||
'fields' => array(
|
||||
'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'Notice ID relation'),
|
||||
'profile_uri' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'Profile URI'),
|
||||
'profile_uri' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'Profile URI'),
|
||||
'method' => array('type' => 'enum("push","salmon")', 'not null' => true, 'description' => 'source method'),
|
||||
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
|
||||
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
|
||||
|
Reference in New Issue
Block a user