We now store the uri data in a separate table (#5560)

* We now have a item-uri table

* Fixing line endings

* New item uri table

* Rescued ItemURI.php file

* Reverting some git problem

* Corrected the dbstructure file

* Updated database.sql / we now store content in the new id fields
This commit is contained in:
Michael Vogel 2018-08-05 13:09:59 +02:00 committed by Tobias Diekershoff
parent ffe16be7d6
commit fa46e97f27
5 changed files with 103 additions and 5 deletions

View file

@ -211,7 +211,7 @@
"conversation": {
"comment": "Raw data and structure information for messages",
"fields": {
"item-uri": {"type": "varbinary(255)", "not null": "1", "primary": "1", "comment": "URI of the item"},
"item-uri": {"type": "varbinary(255)", "not null": "1", "primary": "1", "comment": "Original URI of the item - unrelated to the table with the same name"},
"reply-to-uri": {"type": "varbinary(255)", "not null": "1", "default": "", "comment": "URI to which this item is a reply"},
"conversation-uri": {"type": "varbinary(255)", "not null": "1", "default": "", "comment": "GNU Social conversation URI"},
"conversation-href": {"type": "varbinary(255)", "not null": "1", "default": "", "comment": "GNU Social conversation link"},
@ -471,10 +471,13 @@
"id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "relation": {"thread": "iid"}},
"guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "A unique identifier for this item"},
"uri": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
"uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table entry that contains the item uri"},
"uri-hash": {"type": "varchar(80)", "not null": "1", "default": "", "comment": "RIPEMD-128 hash from uri"},
"parent": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"item": "id"}, "comment": "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"},
"parent-uri": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "uri of the parent to this item"},
"parent-uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table that contains the parent uri"},
"thr-parent": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"},
"thr-parent-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table that contains the thread parent uri"},
"created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Creation timestamp."},
"edited": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of last edit (default is created)"},
"commented": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of last comment/reply to this item"},
@ -571,6 +574,7 @@
"fields": {
"id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "relation": {"thread": "iid"}},
"uri": {"type": "varchar(255)", "comment": ""},
"uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table entry that contains the item uri"},
"uri-hash": {"type": "varchar(80)", "not null": "1", "default": "", "comment": "RIPEMD-128 hash from uri"},
"activity": {"type": "smallint unsigned", "not null": "1", "default": "0", "comment": ""}
},
@ -585,6 +589,7 @@
"fields": {
"id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "relation": {"thread": "iid"}},
"uri": {"type": "varchar(255)", "comment": ""},
"uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table entry that contains the item uri"},
"uri-plink-hash": {"type": "varchar(80)", "not null": "1", "default": "", "comment": "RIPEMD-128 hash from uri"},
"title": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "item title"},
"content-warning": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
@ -619,6 +624,19 @@
"PRIMARY": ["iid"]
}
},
"item-uri": {
"comment": "URI and GUID for items",
"fields": {
"id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1"},
"uri": {"type": "varbinary(255)", "not null": "1", "comment": "URI of an item"},
"guid": {"type": "varbinary(255)", "comment": "A unique identifier for an item"}
},
"indexes": {
"PRIMARY": ["id"],
"uri": ["UNIQUE", "uri"],
"guid": ["guid"]
}
},
"locks": {
"comment": "",
"fields": {
@ -1247,4 +1265,4 @@
"done_executed": ["done", "executed"]
}
}
}
}