1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace Application\Migrations\Schema\V110;
- use Application\Migrations\AbstractMigrationChamilo;
- use Doctrine\DBAL\Schema\Schema;
- use Doctrine\DBAL\Types\Type;
- class Version20150505142900 extends AbstractMigrationChamilo
- {
-
- public function up(Schema $schema)
- {
-
- if (!$schema->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'
- );
- }
- }
-
- public function down(Schema $schema)
- {
- $schema->dropTable('chat_video');
- }
- }
|