use wcf\system\database\table\column\VarbinaryDatabaseTableColumn;
use wcf\system\database\table\DatabaseTable;
use wcf\system\database\table\DatabaseTableChangeProcessor;
+use wcf\system\database\table\index\DatabaseTableForeignKey;
use wcf\system\database\table\index\DatabaseTableIndex;
use wcf\system\database\table\index\DatabaseTablePrimaryIndex;
use wcf\system\database\table\PartialDatabaseTable;
DatabaseTableIndex::create()
->type(DatabaseTableIndex::UNIQUE_TYPE)
->columns(['userID', 'objectTypeID']),
+ ])
+ ->foreignKeys([
+ DatabaseTableForeignKey::create()
+ ->columns(['userID'])
+ ->referencedTable('wcf1_user')
+ ->referencedColumns(['userID'])
+ ->onDelete('CASCADE'),
+ DatabaseTableForeignKey::create()
+ ->columns(['objectTypeID'])
+ ->referencedTable('wcf1_object_type')
+ ->referencedColumns(['objectTypeID'])
+ ->onDelete('CASCADE'),
]),
DatabaseTable::create('wcf1_user_multifactor_backup')
DatabaseTableIndex::create()
->type(DatabaseTableIndex::UNIQUE_TYPE)
->columns(['setupID', 'identifier']),
+ ])
+ ->foreignKeys([
+ DatabaseTableForeignKey::create()
+ ->columns(['setupID'])
+ ->referencedTable('wcf1_user_multifactor')
+ ->referencedColumns(['setupID'])
+ ->onDelete('CASCADE'),
]),
DatabaseTable::create('wcf1_user_multifactor_email')
DatabaseTableIndex::create()
->type(DatabaseTableIndex::UNIQUE_TYPE)
->columns(['setupID', 'code']),
+ ])
+ ->foreignKeys([
+ DatabaseTableForeignKey::create()
+ ->columns(['setupID'])
+ ->referencedTable('wcf1_user_multifactor')
+ ->referencedColumns(['setupID'])
+ ->onDelete('CASCADE'),
]),
DatabaseTable::create('wcf1_user_multifactor_totp')
DatabaseTableIndex::create()
->type(DatabaseTableIndex::UNIQUE_TYPE)
->columns(['setupID', 'deviceID']),
+ ])
+ ->foreignKeys([
+ DatabaseTableForeignKey::create()
+ ->columns(['setupID'])
+ ->referencedTable('wcf1_user_multifactor')
+ ->referencedColumns(['setupID'])
+ ->onDelete('CASCADE'),
]),
];