hasTable('chat_video')) { $chatVideoTable = $schema->createTable('chat_video'); $chatVideoTable->addColumn( 'id', Type::INTEGER, ['autoincrement' => true, 'notnull' => true] ); $chatVideoTable->addColumn( 'from_user', Type::INTEGER, ['notnull' => true] ); $chatVideoTable->addColumn( 'to_user', Type::INTEGER, ['notnull' => true] ); $chatVideoTable->addColumn( 'room_name', Type::STRING, ['length' => 255, 'notnull' => true] ); $chatVideoTable->addColumn( 'datetime', Type::DATETIME, ['notnull' => true] ); $chatVideoTable->setPrimaryKey(['id']); $chatVideoTable->addIndex( ['from_user'], 'idx_chat_video_from_user' ); $chatVideoTable->addIndex(['to_user'], 'idx_chat_video_to_user'); $chatVideoTable->addIndex( ['from_user', 'to_user'], 'idx_chat_video_users' ); $chatVideoTable->addIndex( ['room_name'], 'idx_chat_video_room_name' ); } } /** * We don't allow downgrades yet * @param Schema $schema */ public function down(Schema $schema) { $schema->dropTable('chat_video'); } }