[DB] Change foreign key specification to new format

This commit is contained in:
2021-02-22 21:34:59 +00:00
parent ea0aca4b00
commit 1712782cc5
33 changed files with 195 additions and 293 deletions

View File

@@ -84,19 +84,14 @@ class GroupJoinQueue extends Entity
'name' => 'group_join_queue',
'description' => 'Holder for group join requests awaiting moderation.',
'fields' => [
'gsactor_id' => ['type' => 'int', 'not null' => true, 'description' => 'remote or local gsactor making the request'],
'group_id' => ['type' => 'int', 'not null' => true, 'description' => 'remote or local group to join, if any'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],
'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'],
],
'primary key' => ['gsactor_id', 'group_id'],
'indexes' => [
'group_join_queue_gsactor_id_created_idx' => ['gsactor_id', 'created'],
'group_join_queue_group_id_created_idx' => ['group_id', 'created'],
],
'foreign keys' => [
'group_join_queue_gsactor_id_fkey' => ['gsactor', ['gsactor_id' => 'id']],
'group_join_queue_group_id_fkey' => ['group', ['group_id' => 'id']],
],
];
}
}