本文整理匯總了PHP中Illuminate\Database\Schema\Blueprint::timestamp方法的典型用法代碼示例。如果您正苦於以下問題:PHP Blueprint::timestamp方法的具體用法?PHP Blueprint::timestamp怎麽用?PHP Blueprint::timestamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Database\Schema\Blueprint
的用法示例。
在下文中一共展示了Blueprint::timestamp方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: create
/**
* Create the table schema.
*
* @param Blueprint $table
*
* @return mixed
*/
protected function create(Blueprint $table)
{
$table->increments('id');
$table->string('task');
$table->text('data')->nullable();
$table->string('state')->default(JobState::IDLE);
$table->text('message')->nullable();
$table->boolean('schedulable')->default(false);
$table->integer('attempts')->default(0);
$table->integer('retries')->default(0);
$table->timestamp('started_at')->nullable();
$table->timestamp('completed_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamp('run_at')->nullable();
$table->timestamps();
}
示例2: addConfirmationColumns
/**
* Add confirmation columns.
*
* @param \Illuminate\Database\Schema\Blueprint $table
*/
private function addConfirmationColumns(Blueprint $table)
{
if (UserConfirmator::isEnabled()) {
$table->boolean('is_confirmed')->default(0);
$table->string('confirmation_code', UserConfirmator::getLength())->nullable();
$table->timestamp('confirmed_at')->nullable();
}
}
示例3: documentSchema
/**
* @param Blueprint $table table
* @return Blueprint
*/
private function documentSchema(Blueprint $table)
{
$table->string('parentId', 255)->default('');
$table->string('instanceId', 255)->default('');
// users
$table->string('userType', '16')->default('normal');
$table->string('userId', 255);
$table->string('writer', 255);
$table->string('email')->nullable();
// 비회원 작성일때 email 받기?
$table->string('certifyKey', 255);
// nonmember document's password
// count
$table->integer('readCount')->default(0);
$table->integer('commentCount')->default(0);
$table->integer('assentCount')->default(0);
$table->integer('dissentCount')->default(0);
// display contents config values
$table->enum('approved', array('approved', 'waiting', 'rejected'))->default('approved');
$table->enum('published', array('published', 'waiting', 'reserved', 'rejected'))->default('published');
// temp 대신 draft가 어떨까?
$table->enum('status', array('public', 'temp', 'trash', 'private', 'notice'))->default('public');
$table->enum('display', array('visible', 'secret', 'hidden'))->default('visible');
// search
$table->string('locale', 255)->default('');
// multi-language support. ko, en, jp, ...
$table->string('title', 255);
$table->text('content');
$table->text('pureContent');
$table->timestamp('createdAt');
$table->timestamp('publishedAt');
$table->timestamp('updatedAt');
$table->timestamp('deletedAt')->nullable();
// 대댓글 처리를 위한 트리용 컬럼 추가 ex.) head, parent, depth
$table->string('head', 50);
// timestamp + uuid (ex. 1430369257-bd1fc797-474f-47a6-bedb-867a376490f2)
$table->string('reply', 200)->nullable();
$table->string('listOrder', 250);
$table->string('ipaddress', 16);
$table->index('createdAt');
$table->unique(['head', 'reply']);
return $table;
}
示例4: _schema_usermodel
public static function _schema_usermodel(\Illuminate\Database\Schema\Blueprint $table)
{
$table->string('username', 100);
$table->string('nickname', 30)->unique();
$table->string('email', 100);
$table->string('mobile', 20);
$table->integer('exp')->default(0);
$table->integer('points')->default(0);
$table->date('birthdate')->nullable();
$table->enum('gender', ['男', '女', '保密'])->default('保密');
$table->string('password', 100);
$table->string('remember_token', 100);
$table->timestamp('last_login');
return $table;
}
示例5: testAddingTimeStamp
public function testAddingTimeStamp()
{
$blueprint = new Blueprint('users');
$blueprint->timestamp('foo');
$statements = $blueprint->toSql($this->getGrammar());
$this->assertEquals(1, count($statements));
$this->assertEquals('alter table "users" add "foo" datetime not null', $statements[0]);
}
示例6: setDatabaseFieldType
/**
* @param Blueprint $table
*
* @return \Illuminate\Support\Fluent
*/
public function setDatabaseFieldType(Blueprint $table)
{
return $table->timestamp($this->getDBKey());
}
示例7: testAddingTimeStamp
public function testAddingTimeStamp()
{
$blueprint = new Blueprint('users');
$blueprint->timestamp('foo');
$statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
$this->assertEquals(1, count($statements));
$this->assertEquals('alter table users add ( foo timestamp default 0 not null )', $statements[0]);
}
示例8: setColumns
/**
* @param Blueprint $table table
* @return Blueprint
*/
private function setColumns(Blueprint $table)
{
$table->string('parentId', 255)->default('');
$table->string('instanceId', 255)->default('');
$table->string('type', 255)->default('');
// users
$table->string('userType', '16')->default('normal');
$table->string('userId', 255);
$table->string('writer', 255);
$table->string('email')->nullable();
// 비회원 작성일때 email 받기?
$table->string('certifyKey', 255);
// nonmember document's password
// count
$table->integer('readCount')->default(0);
$table->integer('commentCount')->default(0);
$table->integer('assentCount')->default(0);
$table->integer('dissentCount')->default(0);
// display contents config values
$table->integer('approved')->default(Document::APPROVED_APPROVED);
$table->integer('published')->default(Document::PUBLISHED_PUBLISHED);
$table->integer('status')->default(Document::STATUS_PUBLIC);
$table->integer('display')->default(Document::DISPLAY_VISIBLE);
$table->integer('format')->default(Document::FORMAT_HTML);
// search
$table->string('locale', 255)->default('');
$table->string('title', 255);
$table->text('content');
$table->text('pureContent');
$table->timestamp('createdAt');
$table->timestamp('updatedAt');
$table->timestamp('publishedAt')->nullable();
$table->timestamp('deletedAt')->nullable();
$table->string('head', 50);
$table->string('reply', 200);
$table->string('ipaddress', 16);
$table->index('createdAt');
$table->unique(['head', 'reply']);
return $table;
}