diff --git a/src/Entity/Avatar.php b/src/Entity/Avatar.php index 195a8b7eb1..85453b726a 100644 --- a/src/Entity/Avatar.php +++ b/src/Entity/Avatar.php @@ -143,8 +143,8 @@ class Avatar extends Entity return [ 'name' => 'avatar', 'fields' => [ - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to gsactor table'], - 'file_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'File.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to file table'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to gsactor table'], + 'file_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'File.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to file table'], 'created' => ['type' => 'datetime', 'not null' => true, 'description' => 'date this record was created', 'default' => 'CURRENT_TIMESTAMP'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified', 'default' => 'CURRENT_TIMESTAMP'], ], diff --git a/src/Entity/Conversation.php b/src/Entity/Conversation.php index 59e1fe8353..b55cd55c84 100644 --- a/src/Entity/Conversation.php +++ b/src/Entity/Conversation.php @@ -96,7 +96,7 @@ class Conversation extends Entity 'name' => 'conversation', 'fields' => [ 'id' => ['type' => 'serial', 'not null' => true, 'description' => 'Unique identifier'], - 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'Root of note for this conversation'], + 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'Root of note for this conversation'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], diff --git a/src/Entity/Favourite.php b/src/Entity/Favourite.php index 36d53581ad..53bd64655b 100644 --- a/src/Entity/Favourite.php +++ b/src/Entity/Favourite.php @@ -81,8 +81,8 @@ class Favourite extends Entity return [ 'name' => 'favourite', 'fields' => [ - 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'note that is the favorite of'], - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'actor who favourited this note'], // note: formerly referenced notice.id, but we can now record remote users' favorites + 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'note that is the favorite of'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'actor who favourited this note'], // note: formerly referenced notice.id, but we can now record remote users' favorites 'created' => ['type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'], ], diff --git a/src/Entity/File.php b/src/Entity/File.php index bbabadcca0..5c5a3104ec 100644 --- a/src/Entity/File.php +++ b/src/Entity/File.php @@ -237,7 +237,7 @@ class File extends Entity 'url' => ['type' => 'text', 'description' => 'URL after following possible redirections'], 'url_hash' => ['type' => 'varchar', 'length' => 64, 'description' => 'sha256 of destination URL (url field)'], 'file_hash' => ['type' => 'varchar', 'length' => 64, 'description' => 'sha256 of the file contents, if the file is stored locally'], - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'description' => 'If set, used so each actor can have a version of this file (for avatars, for instance)'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'description' => 'If set, used so each actor can have a version of this file (for avatars, for instance)'], 'mimetype' => ['type' => 'varchar', 'length' => 50, 'description' => 'mime type of resource'], 'title' => ['type' => 'text', 'description' => 'title of resource when available'], 'filename' => ['type' => 'varchar', 'length' => 191, 'description' => 'title of resource when available'], diff --git a/src/Entity/FileThumbnail.php b/src/Entity/FileThumbnail.php index 1a723008ad..7a22fd50d7 100644 --- a/src/Entity/FileThumbnail.php +++ b/src/Entity/FileThumbnail.php @@ -104,7 +104,7 @@ class FileThumbnail extends Entity return [ 'name' => 'file_thumbnail', 'fields' => [ - 'file_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'File.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'thumbnail for what file'], + 'file_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'File.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'thumbnail for what file'], 'width' => ['type' => 'int', 'not null' => true, 'description' => 'width of thumbnail'], 'height' => ['type' => 'int', 'not null' => true, 'description' => 'height of thumbnail'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], diff --git a/src/Entity/FileToNote.php b/src/Entity/FileToNote.php index 22787651c4..0aafd04400 100644 --- a/src/Entity/FileToNote.php +++ b/src/Entity/FileToNote.php @@ -83,8 +83,8 @@ class FileToNote extends Entity return [ 'name' => 'file_to_note', 'fields' => [ - 'file_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'File.id', 'mutiplicity' => 'one to one', 'name' => 'file_to_note_file_id_fkey', 'not null' => true, 'description' => 'id of file'], - 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'mutiplicity' => 'one to one', 'name' => 'file_to_note_note_id_fkey', 'not null' => true, 'description' => 'id of the note it belongs to'], + 'file_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'File.id', 'multiplicity' => 'one to one', 'name' => 'file_to_note_file_id_fkey', 'not null' => true, 'description' => 'id of file'], + 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'multiplicity' => 'one to one', 'name' => 'file_to_note_note_id_fkey', 'not null' => true, 'description' => 'id of the note it belongs to'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['file_id', 'note_id'], diff --git a/src/Entity/Follow.php b/src/Entity/Follow.php index fc4a00918c..2edde5f757 100644 --- a/src/Entity/Follow.php +++ b/src/Entity/Follow.php @@ -96,8 +96,8 @@ class Follow extends Entity return [ 'name' => 'follow', 'fields' => [ - 'follower' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'name' => 'follow_follower_fkey', 'not null' => true, 'description' => 'gsactor listening'], - 'followed' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'name' => 'follow_followed_fkey', 'not null' => true, 'description' => 'gsactor being listened to'], + 'follower' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'name' => 'follow_follower_fkey', 'not null' => true, 'description' => 'gsactor listening'], + 'followed' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'name' => 'follow_followed_fkey', 'not null' => true, 'description' => 'gsactor being listened to'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], diff --git a/src/Entity/FollowQueue.php b/src/Entity/FollowQueue.php index 2091c68e04..980c0fed93 100644 --- a/src/Entity/FollowQueue.php +++ b/src/Entity/FollowQueue.php @@ -84,14 +84,14 @@ class FollowQueue extends Entity 'name' => 'follow_queue', 'description' => 'Holder for Follow requests awaiting moderation.', 'fields' => [ - 'follower' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'many to many', 'name' => 'Follow_queue_follower_fkey', 'not null' => true, 'description' => 'gsactor making the request'], - 'followed' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'many to many', 'name' => 'Follow_queue_followed_fkey', 'not null' => true, 'description' => 'gsactor being followed'], + 'follower' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'Follow_queue_follower_fkey', 'not null' => true, 'description' => 'gsactor making the request'], + 'followed' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'Follow_queue_followed_fkey', 'not null' => true, 'description' => 'gsactor being followed'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], ], 'primary key' => ['follower', 'followed'], 'indexes' => [ - 'Follow_queue_follower_created_idx' => ['follower', 'created'], - 'Follow_queue_followed_created_idx' => ['followed', 'created'], + 'follow_queue_follower_created_idx' => ['follower', 'created'], + 'follow_queue_followed_created_idx' => ['followed', 'created'], ], ]; } diff --git a/src/Entity/GSActorBlock.php b/src/Entity/GSActorBlock.php index de55af5acd..4d7a42794e 100644 --- a/src/Entity/GSActorBlock.php +++ b/src/Entity/GSActorBlock.php @@ -83,8 +83,8 @@ class GSActorBlock extends Entity return [ 'name' => 'gsactor_block', 'fields' => [ - 'blocker' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'many to many', 'name' => 'gsactor_block_blocker_fkey', 'not null' => true, 'description' => 'user making the block'], - 'blocked' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'many to many', 'name' => 'gsactor_block_blocked_fkey', 'not null' => true, 'description' => 'gsactor that is blocked'], + 'blocker' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'gsactor_block_blocker_fkey', 'not null' => true, 'description' => 'user making the block'], + 'blocked' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'gsactor_block_blocked_fkey', 'not null' => true, 'description' => 'gsactor that is blocked'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['blocker', 'blocked'], diff --git a/src/Entity/GSActorCircle.php b/src/Entity/GSActorCircle.php index 4e87c9b152..e4444e452c 100644 --- a/src/Entity/GSActorCircle.php +++ b/src/Entity/GSActorCircle.php @@ -129,22 +129,18 @@ class GSActorCircle extends Entity public static function schemaDef(): array { return [ - 'name' => 'gsactor_list', + 'name' => 'gsactor_circle', 'description' => 'a gsactor can have lists of gsactors, to separate their timeline', 'fields' => [ - 'id' => ['type' => 'int', 'not null' => true, 'description' => 'unique identifier'], - 'tagger' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'many to one', 'name' => 'gsactor_list_tagger_fkey', 'not null' => true, 'description' => 'user making the tag'], - 'tag' => ['type' => 'varchar', 'foreign key' => true, 'length' => 64, 'target' => 'GSActorTag.tag', 'mutiplicity' => 'many to many', 'not null' => true, 'description' => 'gsactor tag'], // Join with GSActorTag + 'tagger' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'gsactor_list_tagger_fkey', 'not null' => true, 'description' => 'user making the tag'], + 'tag' => ['type' => 'varchar', 'foreign key' => true, 'length' => 64, 'target' => 'GSActorTag.tag', 'multiplicity' => 'many to one', 'not null' => true, 'description' => 'gsactor tag'], // Join with GSActorTag 'description' => ['type' => 'text', 'description' => 'description of the people tag'], 'private' => ['type' => 'bool', 'default' => false, 'description' => 'is this tag private'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['tagger', 'tag'], - 'unique keys' => [ - 'gsactor_list_id_key' => ['id'], - ], - 'indexes' => [ + 'indexes' => [ 'gsactor_list_modified_idx' => ['modified'], 'gsactor_list_tag_idx' => ['tag'], 'gsactor_list_tagger_tag_idx' => ['tagger', 'tag'], diff --git a/src/Entity/GSActorTag.php b/src/Entity/GSActorTag.php index 006f2f0bf9..b125710c7a 100644 --- a/src/Entity/GSActorTag.php +++ b/src/Entity/GSActorTag.php @@ -95,8 +95,8 @@ class GSActorTag extends Entity return [ 'name' => 'gsactor_tag', 'fields' => [ - 'tagger' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'nmae' => 'gsactor_tag_tagger_fkey', 'not null' => true, 'description' => 'user making the tag'], - 'tagged' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'name' => 'gsactor_tag_tagged_fkey', 'not null' => true, 'description' => 'gsactor tagged'], + 'tagger' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'nmae' => 'gsactor_tag_tagger_fkey', 'not null' => true, 'description' => 'user making the tag'], + 'tagged' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'name' => 'gsactor_tag_tagged_fkey', 'not null' => true, 'description' => 'gsactor tagged'], 'tag' => ['type' => 'varchar', 'length' => 64, 'not null' => true, 'description' => 'hash tag associated with this notice'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], diff --git a/src/Entity/GSActorTagFollow.php b/src/Entity/GSActorTagFollow.php index 927d5e7d01..b052909576 100644 --- a/src/Entity/GSActorTagFollow.php +++ b/src/Entity/GSActorTagFollow.php @@ -95,8 +95,8 @@ class GSActorTagFollow extends Entity return [ 'name' => 'gsactor_tag_follow', 'fields' => [ - 'gsactor_tag' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActorTag.tag', 'mutiplicity' => 'one to one', 'name' => 'gsactor_tag_follow_gsactor_tag_fkey', 'not null' => true, 'description' => 'foreign key to gsactor_tag'], - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'name' => 'gsactor_tag_follow_gsactor_id_fkey', 'not null' => true, 'description' => 'foreign key to gsactor table'], + 'gsactor_tag' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActorTag.tag', 'multiplicity' => 'one to one', 'name' => 'gsactor_tag_follow_gsactor_tag_fkey', 'not null' => true, 'description' => 'foreign key to gsactor_tag'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'name' => 'gsactor_tag_follow_gsactor_id_fkey', 'not null' => true, 'description' => 'foreign key to gsactor table'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], diff --git a/src/Entity/Group.php b/src/Entity/Group.php index 463611c7b5..a7c304fe5a 100644 --- a/src/Entity/Group.php +++ b/src/Entity/Group.php @@ -264,7 +264,7 @@ class Group extends Entity 'name' => '`group`', 'fields' => [ 'id' => ['type' => 'serial', 'not null' => true], - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'many to one', 'not null' => true, 'description' => 'foreign key to gsactor table'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'not null' => true, 'description' => 'foreign key to gsactor table'], 'nickname' => ['type' => 'varchar', 'length' => 64, 'description' => 'nickname for addressing'], 'fullname' => ['type' => 'varchar', 'length' => 191, 'description' => 'display name'], 'homepage' => ['type' => 'varchar', 'length' => 191, 'description' => 'URL, cached so we dont regenerate'], diff --git a/src/Entity/GroupAlias.php b/src/Entity/GroupAlias.php index 0eaddd0ff9..2c34e57433 100644 --- a/src/Entity/GroupAlias.php +++ b/src/Entity/GroupAlias.php @@ -84,7 +84,7 @@ class GroupAlias extends Entity 'name' => 'group_alias', 'fields' => [ 'alias' => ['type' => 'varchar', 'length' => 64, 'not null' => true, 'description' => 'additional nickname for the group'], - 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'many to one', 'not null' => true, 'description' => 'group id which this is an alias of'], + 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'many to one', 'not null' => true, 'description' => 'group id which this is an alias of'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['alias'], diff --git a/src/Entity/GroupBlock.php b/src/Entity/GroupBlock.php index cf018689ce..ffab33a006 100644 --- a/src/Entity/GroupBlock.php +++ b/src/Entity/GroupBlock.php @@ -95,9 +95,9 @@ class GroupBlock extends Entity return [ 'name' => 'group_block', 'fields' => [ - 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'many to one', 'not null' => true, 'description' => 'group gsactor is blocked from'], - 'blocked_gsactor' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'gsactor that is blocked'], - 'blocker_user' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'user making the block'], + 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'many to one', 'not null' => true, 'description' => 'group gsactor is blocked from'], + 'blocked_gsactor' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'gsactor that is blocked'], + 'blocker_user' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'user making the block'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['group_id', 'blocked_gsactor'], diff --git a/src/Entity/GroupInbox.php b/src/Entity/GroupInbox.php index 74869a4cb5..0cff2ee247 100644 --- a/src/Entity/GroupInbox.php +++ b/src/Entity/GroupInbox.php @@ -84,8 +84,8 @@ class GroupInbox extends Entity 'name' => 'group_inbox', 'description' => 'Many-many table listing activities posted to a given group, or which groups a given activity was posted to', 'fields' => [ - 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'one to one', 'name' => 'group_inbox_group_id_fkey', 'not null' => true, 'description' => 'group receiving the activity'], - 'activity_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Activity.id', 'mutiplicity' => 'many to one', 'name' => 'group_inbox_activity_id_fkey', 'not null' => true, 'description' => 'activity received'], + 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'one to one', 'name' => 'group_inbox_group_id_fkey', 'not null' => true, 'description' => 'group receiving the activity'], + 'activity_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Activity.id', 'multiplicity' => 'many to one', 'name' => 'group_inbox_activity_id_fkey', 'not null' => true, 'description' => 'activity received'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], ], 'primary key' => ['group_id', 'activity_id'], diff --git a/src/Entity/GroupJoinQueue.php b/src/Entity/GroupJoinQueue.php index 36de8477d8..962baeb72e 100644 --- a/src/Entity/GroupJoinQueue.php +++ b/src/Entity/GroupJoinQueue.php @@ -71,8 +71,8 @@ class GroupJoinQueue extends Entity 'name' => 'group_join_queue', 'description' => 'Holder for group join requests awaiting moderation.', 'fields' => [ - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'many to many', 'name' => 'group_join_queue_gsactor_id_fkey', 'not null' => true, 'description' => 'remote or local gsactor making the request'], - 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'one to one', 'name' => 'group_join_queue_group_id_fkey', 'not null' => true, 'description' => 'remote or local group to join, if any'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'group_join_queue_gsactor_id_fkey', 'not null' => true, 'description' => 'remote or local gsactor making the request'], + 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'many to one', 'name' => 'group_join_queue_group_id_fkey', 'not null' => true, 'description' => 'remote or local group to join, if any'], ], 'primary key' => ['gsactor_id', 'group_id'], 'indexes' => [ diff --git a/src/Entity/GroupMember.php b/src/Entity/GroupMember.php index f5fad2c18e..1a6de03a51 100644 --- a/src/Entity/GroupMember.php +++ b/src/Entity/GroupMember.php @@ -119,8 +119,8 @@ class GroupMember extends Entity return [ 'name' => 'group_member', 'fields' => [ - 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'one to one', 'name' => 'group_member_group_id_fkey', 'not null' => true, 'description' => 'foreign key to group table'], - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'name' => 'group_member_gsactor_id_fkey', 'not null' => true, 'description' => 'foreign key to gsactor table'], + 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'one to one', 'name' => 'group_member_group_id_fkey', 'not null' => true, 'description' => 'foreign key to group table'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'name' => 'group_member_gsactor_id_fkey', 'not null' => true, 'description' => 'foreign key to gsactor table'], 'is_admin' => ['type' => 'bool', 'default' => false, 'description' => 'is this actor an admin?'], 'uri' => ['type' => 'varchar', 'length' => 191, 'description' => 'universal identifier'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], diff --git a/src/Entity/Invitation.php b/src/Entity/Invitation.php index 0163871b9d..d2095e183c 100644 --- a/src/Entity/Invitation.php +++ b/src/Entity/Invitation.php @@ -120,10 +120,10 @@ class Invitation extends Entity 'name' => 'invitation', 'fields' => [ 'code' => ['type' => 'varchar', 'length' => 32, 'not null' => true, 'description' => 'random code for an invitation'], - 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'mutiplicity' => 'many to one', 'name' => 'invitation_user_id_fkey', 'not null' => true, 'description' => 'who sent the invitation'], + 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'multiplicity' => 'many to one', 'name' => 'invitation_user_id_fkey', 'not null' => true, 'description' => 'who sent the invitation'], 'address' => ['type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'invitation sent to'], 'address_type' => ['type' => 'varchar', 'length' => 8, 'not null' => true, 'description' => 'address type ("email", "xmpp", "sms")'], - 'registered_user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'mutiplicity' => 'one to one', 'name' => 'invitation_registered_user_id_fkey', 'type' => 'int', 'not null' => false, 'description' => 'if the invitation is converted, who the new user is'], + 'registered_user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'multiplicity' => 'one to one', 'name' => 'invitation_registered_user_id_fkey', 'type' => 'int', 'not null' => false, 'description' => 'if the invitation is converted, who the new user is'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], ], 'primary key' => ['code'], diff --git a/src/Entity/LocalGroup.php b/src/Entity/LocalGroup.php index 08edfb1f31..81cf0af19e 100644 --- a/src/Entity/LocalGroup.php +++ b/src/Entity/LocalGroup.php @@ -96,7 +96,7 @@ class LocalGroup extends Entity 'name' => 'local_group', 'description' => 'Record for a user group on the local site, with some additional info not in user_group', 'fields' => [ - 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'one to one', 'name' => 'local_group_group_id_fkey', 'not null' => true, 'description' => 'group represented'], + 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'one to one', 'name' => 'local_group_group_id_fkey', 'not null' => true, 'description' => 'group represented'], 'nickname' => ['type' => 'varchar', 'length' => 64, 'description' => 'group represented'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], diff --git a/src/Entity/LocalUser.php b/src/Entity/LocalUser.php index 9385dce8f9..8f07f81cd6 100644 --- a/src/Entity/LocalUser.php +++ b/src/Entity/LocalUser.php @@ -357,8 +357,8 @@ class LocalUser extends Entity implements UserInterface 'name' => 'local_user', 'description' => 'local users, bots, etc', 'fields' => [ - 'id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to gsactor table'], - 'nickname' => ['type' => 'varchar', 'foreign key' => true, 'not null' => true, 'length' => 64, 'description' => 'nickname or username, foreign key to gsactor'], + 'id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to gsactor table'], + 'nickname' => ['type' => 'varchar', 'foreign key' => true, 'target' => 'GSActor.nickname', 'multiplicity' => 'one to one', 'not null' => true, 'length' => 64, 'description' => 'nickname or username, foreign key to gsactor'], 'password' => ['type' => 'varchar', 'length' => 191, 'description' => 'salted password, can be null for users with federated authentication'], 'outgoing_email' => ['type' => 'varchar', 'length' => 191, 'description' => 'email address for password recovery, notifications, etc.'], 'incoming_email' => ['type' => 'varchar', 'length' => 191, 'description' => 'email address for post-by-email'], @@ -366,7 +366,7 @@ class LocalUser extends Entity implements UserInterface 'language' => ['type' => 'varchar', 'length' => 50, 'description' => 'preferred language'], 'timezone' => ['type' => 'varchar', 'length' => 50, 'description' => 'timezone'], 'phone_number' => ['type' => 'phone_number', 'description' => 'phone number'], - 'sms_carrier' => ['type' => 'int', 'foreign key' => true, 'target' => 'SmsCarrier.id', 'mutiplicity' => 'one to one', 'description' => 'foreign key to sms_carrier'], + 'sms_carrier' => ['type' => 'int', 'foreign key' => true, 'target' => 'SmsCarrier.id', 'multiplicity' => 'one to one', 'description' => 'foreign key to sms_carrier'], 'sms_email' => ['type' => 'varchar', 'length' => 191, 'description' => 'built from sms and carrier (see sms_carrier)'], 'uri' => ['type' => 'varchar', 'length' => 191, 'description' => 'universally unique identifier, usually a tag URI'], 'auto_follow_back' => ['type' => 'bool', 'default' => false, 'description' => 'automatically follow users who follow us'], diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 88b703ffab..5f660d8ef5 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -257,14 +257,14 @@ class Note extends Entity 'name' => 'note', 'fields' => [ 'id' => ['type' => 'serial', 'not null' => true], - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'who made the note'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'who made the note'], 'content' => ['type' => 'text', 'description' => 'note content'], 'rendered' => ['type' => 'text', 'description' => 'rendered note content, so we can keep the microtags (if not local)'], - 'reply_to' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'mutiplicity' => 'one to one', 'description' => 'note replied to, null if root of a conversation'], + 'reply_to' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'multiplicity' => 'one to one', 'description' => 'note replied to, null if root of a conversation'], 'is_local' => ['type' => 'bool', 'description' => 'was this note generated by a local actor'], - 'source' => ['type' => 'varchar', 'foreign key' => true, 'length' => 32, 'target' => 'NoteSource.source', 'mutiplicity' => 'one to one', 'description' => 'fkey to source of note, like "web", "im", or "clientname"'], - 'conversation' => ['type' => 'int', 'foreign key' => true, 'target' => 'Conversation.id', 'mutiplicity' => 'one to one', 'description' => 'the local conversation id'], - 'repeat_of' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'mutiplicity' => 'one to one', 'description' => 'note this is a repeat of'], + 'source' => ['type' => 'varchar', 'foreign key' => true, 'length' => 32, 'target' => 'NoteSource.name', 'multiplicity' => 'many to one', 'description' => 'fkey to source of note, like "web", "im", or "clientname"'], + 'conversation' => ['type' => 'int', 'foreign key' => true, 'target' => 'Conversation.id', 'multiplicity' => 'one to one', 'description' => 'the local conversation id'], + 'repeat_of' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'multiplicity' => 'one to one', 'description' => 'note this is a repeat of'], 'scope' => ['type' => 'int', 'not null' => true, 'default' => NoteScope::PUBLIC, 'description' => 'bit map for distribution scope; 0 = everywhere; 1 = this server only; 2 = addressees; 4 = groups; 8 = followers; 16 = messages; null = default'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], diff --git a/src/Entity/NoteTag.php b/src/Entity/NoteTag.php index 76c86188a8..cfbc462c72 100644 --- a/src/Entity/NoteTag.php +++ b/src/Entity/NoteTag.php @@ -85,7 +85,7 @@ class NoteTag extends Entity 'description' => 'Hash tags on notes', 'fields' => [ 'tag' => ['type' => 'varchar', 'length' => 64, 'not null' => true, 'description' => 'hash tag associated with this note'], - 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to tagged note'], + 'note_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to tagged note'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], 'primary key' => ['tag', 'note_id'], diff --git a/src/Entity/Notification.php b/src/Entity/Notification.php index 3bbb533d0d..b90123e4d8 100644 --- a/src/Entity/Notification.php +++ b/src/Entity/Notification.php @@ -108,8 +108,8 @@ class Notification extends Entity 'name' => 'notification', 'description' => 'Activity notification for gsactors (that are not a mention and not result of a subscription)', 'fields' => [ - 'activity_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Activity.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'activity_id to give attention'], - 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'gsactor_id for feed receiver'], + 'activity_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Activity.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'activity_id to give attention'], + 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'gsactor_id for feed receiver'], 'reason' => ['type' => 'varchar', 'length' => 191, 'description' => 'Optional reason why this was brought to the attention of gsactor_id'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], diff --git a/src/Entity/RelatedGroup.php b/src/Entity/RelatedGroup.php index 61a4015375..2740670fd0 100644 --- a/src/Entity/RelatedGroup.php +++ b/src/Entity/RelatedGroup.php @@ -84,8 +84,8 @@ class RelatedGroup extends Entity 'name' => 'related_group', // @fixme description for related_group? 'fields' => [ - 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to group'], - 'related_group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'mutiplicity' => 'one to one', 'type' => 'int', 'not null' => true, 'description' => 'foreign key to group'], + 'group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'foreign key to group'], + 'related_group_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Group.id', 'multiplicity' => 'one to one', 'type' => 'int', 'not null' => true, 'description' => 'foreign key to group'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], ], 'primary key' => ['group_id', 'related_group_id'], diff --git a/src/Entity/UserLocationPrefs.php b/src/Entity/UserLocationPrefs.php index 164f1dd625..59a4bad60a 100644 --- a/src/Entity/UserLocationPrefs.php +++ b/src/Entity/UserLocationPrefs.php @@ -93,7 +93,7 @@ class UserLocationPrefs extends Entity return [ 'name' => 'user_location_prefs', 'fields' => [ - 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'user who has the preference'], + 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'user who has the preference'], 'share_location' => ['type' => 'bool', 'default' => true, 'description' => 'Whether to share location data'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], diff --git a/src/Entity/UserNotificationPrefs.php b/src/Entity/UserNotificationPrefs.php index 55d862e317..4b9dd7a420 100644 --- a/src/Entity/UserNotificationPrefs.php +++ b/src/Entity/UserNotificationPrefs.php @@ -211,9 +211,9 @@ class UserNotificationPrefs extends Entity return [ 'name' => 'user_notification_prefs', 'fields' => [ - 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'mutiplicity' => 'one to one', 'not null' => true], + 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'multiplicity' => 'one to one', 'not null' => true], 'transport' => ['type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'transport (ex email. xmpp, aim)'], - 'target_gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'mutiplicity' => 'one to one', 'default' => null, 'description' => 'If not null, settings are specific only to a given gsactors'], + 'target_gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'default' => null, 'description' => 'If not null, settings are specific only to a given gsactors'], 'activity_by_followed' => ['type' => 'bool', 'not null' => true, 'default' => true, 'description' => 'Notify when a new activity by someone we follow is made'], 'mention' => ['type' => 'bool', 'not null' => true, 'default' => true, 'description' => 'Notify when mentioned by someone we do not follow'], 'reply' => ['type' => 'bool', 'not null' => true, 'default' => true, 'description' => 'Notify when someone replies to a notice made by us'], diff --git a/src/Entity/UserUrlShortenerPrefs.php b/src/Entity/UserUrlShortenerPrefs.php index c90b91d39c..2bd34975ed 100644 --- a/src/Entity/UserUrlShortenerPrefs.php +++ b/src/Entity/UserUrlShortenerPrefs.php @@ -119,7 +119,7 @@ class UserUrlShortenerPrefs extends Entity return [ 'name' => 'user_url_shortener_prefs', 'fields' => [ - 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'name' => 'user_urlshortener_prefs_user_id_fkey', 'mutiplicity' => 'one to one', 'not null' => true, 'description' => 'user'], + 'user_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'LocalUser.id', 'name' => 'user_urlshortener_prefs_user_id_fkey', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'user'], 'url_shortening_service' => ['type' => 'varchar', 'length' => 50, 'default' => 'internal', 'description' => 'service to use for auto-shortening URLs'], 'max_url_length' => ['type' => 'int', 'not null' => true, 'description' => 'urls greater than this length will be shortened, 0 = always, -1 = never'], 'max_notice_length' => ['type' => 'int', 'not null' => true, 'description' => 'notices with content greater than this value will have all urls shortened, 0 = always, -1 = only if notice text is longer than max allowed'],