setTablePrefix() public method

Set table prefix settings.
public setTablePrefix ( string $prefix = '' )
$prefix string
コード例 #1
0
 /**
  * Create a new command set with a Closure.
  *
  * @param  string $table
  * @param  Closure $callback
  * @return \Illuminate\Database\Schema\Blueprint
  */
 protected function createBlueprint($table, Closure $callback = null)
 {
     $blueprint = new OracleBlueprint($table, $callback);
     $blueprint->setTablePrefix($this->connection->getTablePrefix());
     return $blueprint;
 }
コード例 #2
0
 public function testAddingGeneratedUniqueKeyWithPrefix()
 {
     $blueprint = new Blueprint('users');
     $blueprint->setTablePrefix('prefix_');
     $blueprint->unique('foo');
     $grammar = $this->getGrammar();
     $grammar->setTablePrefix('prefix_');
     $statements = $blueprint->toSql($this->getConnection(), $grammar);
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table prefix_users add constraint prefix_users_foo_unique unique ( foo )', $statements[0]);
 }