Exemplo n.º 1
0
 /**
  * Execute the blueprint to build / modify the table.
  *
  * @param  Schema_Blueprint $blueprint
  * @return void
  */
 protected function build(Schema_Blueprint $blueprint)
 {
     $blueprint->build($this->_connection, $this->_grammar);
 }
Exemplo n.º 2
0
 /**
  * Compile a drop primary key command.
  *
  * @param  Schema_Blueprint $blueprint
  * @param  Fluent           $command
  * @return string
  */
 public function compile_drop_primary(Schema_Blueprint $blueprint, Fluent $command)
 {
     $table = $blueprint->get_table();
     $table = $this->wrap_table($blueprint);
     return "ALTER TABLE {$table} DROP constraint {$command->index}";
 }
Exemplo n.º 3
0
 /**
  * Compile a drop primary key command.
  *
  * @param  Schema_Blueprint $blueprint
  * @param  Fluent           $command
  * @return string
  */
 public function compile_drop_primary(Schema_Blueprint $blueprint, Fluent $command)
 {
     $table = $blueprint->get_table();
     return 'alter table ' . $this->wrap_table($blueprint) . " drop constraint {$table}_pkey";
 }
Exemplo n.º 4
0
 /**
  * Create an empty Doctrine DBAL TableDiff from the Blueprint.
  *
  * @param  Schema_Blueprint                            $blueprint
  * @param  \Doctrine\DBAL\Schema\AbstractSchemaManager $schema
  * @return \Doctrine\DBAL\Schema\TableDiff
  */
 protected function _get_doctrine_table_diff(Schema_Blueprint $blueprint, SchemaManager $schema)
 {
     $table = $this->get_table_prefix() . $blueprint->get_table();
     $table_diff = new TableDiff($table);
     $table_diff->fromTable = $schema->listTableDetails($table);
     return $table_diff;
 }