[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,15 @@ class FollowQueue extends Entity
'name' => 'follow_queue',
'description' => 'Holder for Follow requests awaiting moderation.',
'fields' => [
'follower' => ['type' => 'int', 'not null' => true, 'description' => 'gsactor making the request'],
'followed' => ['type' => 'int', 'not null' => true, 'description' => 'gsactor being followed'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],
'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'],
'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'],
],
'foreign keys' => [
'Follow_queue_follower_fkey' => ['gsactor', ['follower' => 'id']],
'Follow_queue_followed_fkey' => ['gsactor', ['followed' => 'id']],
],
];
}
}