Pheasant\Migrate\Migrator::create PHP Метод

create() публичный Метод

Creates the underlying tables for a schema, dropping any tables of the same names
Устаревший: use initialize
public create ( $table, $schema )
    public function create($table, $schema)
    {
        return $this->destroy($schema, $table)->initialize($schema, $table);
    }

Usage Example

Пример #1
0
 public function setUp()
 {
     parent::setUp();
     $migrator = new \Pheasant\Migrate\Migrator();
     $migrator->create('user', User::schema())->create('userpref', UserPref::schema());
     // create some users
     $this->users = User::import(array(array('firstname' => 'Frank', 'lastname' => 'Castle'), array('firstname' => 'Cletus', 'lastname' => 'Kasady')));
     // create some user prefs
     $this->userprefs = UserPref::import(array(array('User' => $this->users[0], 'pref' => 'autologin', 'value' => 'yes'), array('User' => $this->users[1], 'pref' => 'autologin', 'value' => 'no')));
     $this->assertTrue($this->userprefs[0]->User->equals($this->users[0]));
     $this->assertTrue($this->userprefs[1]->User->equals($this->users[1]));
 }