mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
增加访问记录功能
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use app\common\ColumnFormat;
|
||||
use think\migration\Migrator;
|
||||
|
||||
class CreateTablePostVisit extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('post_visit');
|
||||
$table->addColumn(ColumnFormat::timestamp('create_time'));
|
||||
$table->addColumn(ColumnFormat::timestamp('update_time'));
|
||||
$table->addColumn(ColumnFormat::timestamp('delete_time'));
|
||||
$table->addColumn(ColumnFormat::integer('post_id'));
|
||||
$table->addColumn(ColumnFormat::stringUrl('ip'));
|
||||
$table->addColumn(ColumnFormat::stringNormal('nickname'));
|
||||
$table->addColumn(ColumnFormat::stringNormal('uid'));
|
||||
$table->addColumn(ColumnFormat::stringUrl('avatar'));
|
||||
$table->create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user