Файл: database/migrations/2020_11_11_020127_create_stats_table.php
Строк: 39
<?php
use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
class CreateStatsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('stats', function (Blueprint $table) {
$table->integer('website_id');
$table->enum('name', ['browser', 'os', 'device', 'visitors', 'pageviews', 'country', 'city', 'page', 'referrer', 'resolution', 'language', 'landing_page', 'event', 'campaign', 'continent', 'visitors_hours', 'pageviews_hours']);
$table->string('value', 255);
$table->bigInteger('count')->default(1);
$table->date('date');
$table->primary(['website_id', 'name', 'value', 'date']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('stats');
}
}