<?php

class m120911_174500_tbl_social_connect extends CDbMigration
{
	public function safeUp() {
            $this->createTable('tbl_social_connect', array(
                'id' => 'pk',
                'userId' => 'integer NOT NULL',
                'provider' => 'string NOT NULL',
                'providerUser' => 'string NOT NULL',
            ));  
            $this->createIndex('idx_provider_provideruser', 'tbl_social_connect', 'provider, providerUser', true);
            $this->createIndex('idx_provider', 'tbl_social_connect', 'provider');
            $this->createIndex('idx_provideruser', 'tbl_social_connect', 'providerUser');
            $this->createIndex('idx_userId', 'tbl_social_connect', 'userId');
	}
        
	public function safeDown() {
            $this->dropIndex('idx_provider_provideruser', 'tbl_social_connect');
            $this->dropIndex('idx_provider', 'tbl_social_connect');
            $this->dropIndex('idx_provideruser', 'tbl_social_connect');
            $this->dropIndex('idx_userId', 'tbl_social_connect');

            $this->dropTable('tbl_social_connect');
	}
}

?>