forked from GNUsocial/gnu-social
[DB] Change foreign key specification to new format
This commit is contained in:
@@ -83,16 +83,12 @@ class FileToNote extends Entity
|
||||
return [
|
||||
'name' => 'file_to_note',
|
||||
'fields' => [
|
||||
'file_id' => ['type' => 'int', 'not null' => true, 'description' => 'id of file'],
|
||||
'note_id' => ['type' => 'int', 'not null' => true, 'description' => 'id of the note it belongs to'],
|
||||
'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'],
|
||||
'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
|
||||
],
|
||||
'primary key' => ['file_id', 'note_id'],
|
||||
'foreign keys' => [
|
||||
'file_to_note_file_id_fkey' => ['file', ['file_id' => 'id']],
|
||||
'file_to_note_note_id_fkey' => ['note', ['note_id' => 'id']],
|
||||
],
|
||||
'indexes' => [
|
||||
'primary key' => ['file_id', 'note_id'],
|
||||
'indexes' => [
|
||||
'file_id_idx' => ['file_id'],
|
||||
'note_id_idx' => ['note_id'],
|
||||
],
|
||||
|
Reference in New Issue
Block a user