コード例 #1
0
ファイル: Grammar.php プロジェクト: nova-framework/system
 /**
  * Create an empty Doctrine DBAL TableDiff from the Blueprint.
  *
  * @param  \Nova\Database\Schema\Blueprint  $blueprint
  * @param  \Doctrine\DBAL\Schema\AbstractSchemaManager  $schema
  * @return \Doctrine\DBAL\Schema\TableDiff
  */
 protected function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema)
 {
     $table = $this->getTablePrefix() . $blueprint->getTable();
     $tableDiff = new TableDiff($table);
     $tableDiff->fromTable = $schema->listTableDetails($table);
     return $tableDiff;
 }
コード例 #2
0
 /**
  * Compile a drop primary key command.
  *
  * @param  \Nova\Database\Schema\Blueprint  $blueprint
  * @param  \Nova\Support\Fluent  $command
  * @return string
  */
 public function compileDropPrimary(Blueprint $blueprint, Fluent $command)
 {
     $table = $blueprint->getTable();
     return 'alter table ' . $this->wrapTable($blueprint) . " drop constraint {$table}_pkey";
 }
コード例 #3
0
ファイル: Builder.php プロジェクト: nova-framework/system
 /**
  * Execute the blueprint to build / modify the table.
  *
  * @param  \Nova\Database\Schema\Blueprint  $blueprint
  * @return void
  */
 protected function build(Blueprint $blueprint)
 {
     $blueprint->build($this->connection, $this->grammar);
 }