User:Woozle/Friendica/2017 upgrade/item

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< User:Woozle‎ | Friendica‎ | 2017 upgrade
Revision as of 14:31, 8 April 2017 by Woozle (talk | contribs) (Created page with "{| | valign=top | ==create table== <mysql>CREATE TABLE IF NOT EXISTS `item` ( `id` int(10) unsigned NOT NULL auto_increment, `guid` varchar(255) NOT NULL DEFAULT '', `uri`...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

create table

<mysql>CREATE TABLE IF NOT EXISTS `item` ( `id` int(10) unsigned NOT NULL auto_increment, `guid` varchar(255) NOT NULL DEFAULT , `uri` varchar(255) NOT NULL DEFAULT , `uid` int(10) unsigned NOT NULL DEFAULT 0, `contact-id` int(11) NOT NULL DEFAULT 0, `gcontact-id` int(11) unsigned NOT NULL DEFAULT 0, `type` varchar(255) NOT NULL DEFAULT , `wall` tinyint(1) NOT NULL DEFAULT 0, `gravity` tinyint(1) NOT NULL DEFAULT 0, `parent` int(10) unsigned NOT NULL DEFAULT 0, `parent-uri` varchar(255) NOT NULL DEFAULT , `extid` varchar(255) NOT NULL DEFAULT , `thr-parent` varchar(255) NOT NULL DEFAULT , `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `edited` datetime DEFAULT NULL, `commented` datetime DEFAULT NULL, `received` datetime DEFAULT NULL, `changed` datetime DEFAULT NULL, `owner-id` int(11) NOT NULL DEFAULT 0, `owner-name` varchar(255) NOT NULL DEFAULT , `owner-link` varchar(255) NOT NULL DEFAULT , `owner-avatar` varchar(255) NOT NULL DEFAULT , `author-id` int(11) NOT NULL DEFAULT 0, `author-name` varchar(255) NOT NULL DEFAULT , `author-link` varchar(255) NOT NULL DEFAULT , `author-avatar` varchar(255) NOT NULL DEFAULT , `title` varchar(255) NOT NULL DEFAULT , `body` mediumtext, `app` varchar(255) NOT NULL DEFAULT , `verb` varchar(255) NOT NULL DEFAULT , `object-type` varchar(255) NOT NULL DEFAULT , `object` text, `target-type` varchar(255) NOT NULL DEFAULT , `target` text, `postopts` text, `plink` varchar(255) NOT NULL DEFAULT , `resource-id` varchar(255) NOT NULL DEFAULT , `event-id` int(11) NOT NULL DEFAULT 0, `tag` mediumtext, `attach` mediumtext, `inform` mediumtext, `file` mediumtext, `location` varchar(255) NOT NULL DEFAULT , `coord` varchar(255) NOT NULL DEFAULT , `allow_cid` mediumtext, `allow_gid` mediumtext, `deny_cid` mediumtext, `deny_gid` mediumtext, `private` tinyint(1) NOT NULL DEFAULT 0, `pubmail` tinyint(1) NOT NULL DEFAULT 0, `moderated` tinyint(1) NOT NULL DEFAULT 0, `visible` tinyint(1) NOT NULL DEFAULT 0, `spam` tinyint(1) NOT NULL DEFAULT 0, `starred` tinyint(1) NOT NULL DEFAULT 0, `bookmark` tinyint(1) NOT NULL DEFAULT 0, `unseen` tinyint(1) NOT NULL DEFAULT 1, `deleted` tinyint(1) NOT NULL DEFAULT 0, `origin` tinyint(1) NOT NULL DEFAULT 0, `forum_mode` tinyint(1) NOT NULL DEFAULT 0, `last-child` tinyint(1) unsigned NOT NULL DEFAULT 1, `mention` tinyint(1) NOT NULL DEFAULT 0, `network` varchar(32) NOT NULL DEFAULT , `rendered-hash` varchar(32) NOT NULL DEFAULT , `rendered-html` mediumtext, `global` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY(`id`), INDEX `guid` (`guid`), INDEX `uri` (`uri`), INDEX `parent` (`parent`), INDEX `parent-uri` (`parent-uri`), INDEX `extid` (`extid`), INDEX `uid_id` (`uid`,`id`), INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`), INDEX `uid_created` (`uid`,`created`), INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`), INDEX `uid_network_received` (`uid`,`network`,`received`), INDEX `uid_network_commented` (`uid`,`network`,`commented`), INDEX `uid_thrparent` (`uid`,`thr-parent`), INDEX `uid_parenturi` (`uid`,`parent-uri`), INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`), INDEX `authorid_created` (`author-id`,`created`), INDEX `uid_uri` (`uid`,`uri`), INDEX `resource-id` (`resource-id`), INDEX `contactid_allowcid_allowpid_denycid_denygid` (`contact-id`,`allow_cid`(10),`allow_gid`(10),`deny_cid`(10),`deny_gid`(10)), INDEX `uid_type_changed` (`uid`,`type`,`changed`), INDEX `contactid_verb` (`contact-id`,`verb`), INDEX `deleted_changed` (`deleted`,`changed`), INDEX `uid_wall_changed` (`uid`,`wall`,`changed`), INDEX `uid_eventid` (`uid`,`event-id`), INDEX `uid_authorlink` (`uid`,`author-link`), INDEX `uid_ownerlink` (`uid`,`owner-link`) ) DEFAULT CHARSET=utf8mb4;</mysql>

copy data

<mysql>INSERT INTO `icms-fka`.`item` (`id`, `guid`, `uri`, `uid`, `contact-id`, `type`, `wall`, `gravity`, `parent`, `parent-uri`, `extid`, `thr-parent`, `created`, `edited`, `commented`, `received`, `changed`, `owner-name`, `owner-link`, `owner-avatar`, `author-name`, `author-link`, `author-avatar`, `title`, `body`, `app`, `verb`, `object-type`, `object`, `target-type`, `target`, `postopts`, `plink`, `resource-id`, `event-id`, `tag`, `attach`, `inform`, `file`, `location`, `coord`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `moderated`, `visible`, `spam`, `starred`, `bookmark`, `unseen`, `deleted`, `origin`, `forum_mode`, `last-child`, `mention`, `network`) SELECT id, guid, uri, uid, `contact-id`, type, wall, gravity, parent, `parent-uri`, extid, `thr-parent`, created, edited,

IF(UNIX_TIMESTAMP(commented)=0,NULL,commented),

received, changed, `owner-name`, `owner-link`, `owner-avatar`, `author-name`, `author-link`, `author-avatar`, title, body, app, verb, `object-type`, object, `target-type`, target, postopts, plink, `resource-id`, `event-id`, tag, attach, inform, file, location, coord, `allow_cid`, `allow_gid`, deny_cid, deny_gid, private, pubmail, moderated, visible, spam, starred, bookmark, unseen, deleted, origin, forum_mode, `last-child`, mention, network FROM `OLD-item`;</mysql>