removed tracker tables which are no longer wanted.

This commit is contained in:
2020-02-04 21:32:14 -06:00
parent 86a519eeaa
commit cd53f8515a
35 changed files with 36 additions and 1753 deletions

View File

@@ -0,0 +1,36 @@
<?php
/**
* W4RP Services
* GNU Public License
*/
namespace App\Library\Moons;
//Internal Library
use Session;
use DB;
use Log;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
//Models
use App\Models\Moon\Config;
use App\Models\Moon\ItemComposition;
use App\Models\Moon\Moon;
use App\Models\Moon\OrePrice;
use App\Models\Moon\Price;
class MoonCalcAvg {
public function GetOreComposition($ore) {
$composition = ItemComposition::where([
'Name' => $ore,
])->first();
return $composition;
}
}
?>

View File

@@ -1,44 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerPathsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_paths';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('path')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,44 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerQueriesTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_queries';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('query')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,46 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerQueriesArgumentsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_query_arguments';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('query_id')->unsigned()->index();
$table->string('argument')->index();
$table->string('value')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,45 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerRoutesTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_routes';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('name')->index();
$table->string('action')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,45 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerRoutesPathsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_route_paths';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('route_id')->unsigned()->index();
$table->string('path')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,46 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerRoutePathParametersTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_route_path_parameters';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('route_path_id')->unsigned()->index();
$table->string('parameter')->index();
$table->string('value')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,46 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerAgentsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_agents';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('name')->unique();
$table->string('browser')->index();
$table->string('browser_version');
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,44 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerCookiesTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_cookies';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('uuid')->unique();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,50 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerDevicesTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_devices';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('kind', 16)->index();
$table->string('model', 64)->index();
$table->string('platform', 64)->index();
$table->string('platform_version', 16)->index();
$table->boolean('is_mobile');
$table->unique(['kind', 'model', 'platform', 'platform_version']);
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,44 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerDomainsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_domains';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('name')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,46 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerReferersTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_referers';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('domain_id')->unsigned()->index();
$table->string('url')->index();
$table->string('host');
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,56 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerGeoipTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_geoip';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->double('latitude')->nullable()->index();
$table->double('longitude')->nullable()->index();
$table->string('country_code', 2)->nullable()->index();
$table->string('country_code3', 3)->nullable()->index();
$table->string('country_name')->nullable()->index();
$table->string('region', 2)->nullable();
$table->string('city', 50)->nullable()->index();
$table->string('postal_code', 20)->nullable();
$table->bigInteger('area_code')->nullable();
$table->double('dma_code')->nullable();
$table->double('metro_code')->nullable();
$table->string('continent_code', 2)->nullable();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,52 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerSessionsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_sessions';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('uuid')->unique()->index();
$table->bigInteger('user_id')->unsigned()->nullable()->index();
$table->bigInteger('device_id')->unsigned()->nullable()->index();
$table->bigInteger('agent_id')->unsigned()->nullable()->index();
$table->string('client_ip')->index();
$table->bigInteger('referer_id')->unsigned()->nullable()->index();
$table->bigInteger('cookie_id')->unsigned()->nullable()->index();
$table->bigInteger('geoip_id')->unsigned()->nullable()->index();
$table->boolean('is_robot');
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,45 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerErrorsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_errors';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('code')->index();
$table->string('message')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,44 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerSystemClassesTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_system_classes';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('name')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,53 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerLogTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_log';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('session_id')->unsigned()->index();
$table->bigInteger('path_id')->unsigned()->nullable()->index();
$table->bigInteger('query_id')->unsigned()->nullable()->index();
$table->string('method', 10)->index();
$table->bigInteger('route_path_id')->unsigned()->nullable()->index();
$table->boolean('is_ajax');
$table->boolean('is_secure');
$table->boolean('is_json');
$table->boolean('wants_json');
$table->bigInteger('error_id')->unsigned()->nullable()->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,44 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerEventsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_events';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('name')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,46 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerEventsLogTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_events_log';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('event_id')->unsigned()->index();
$table->bigInteger('class_id')->unsigned()->nullable()->index();
$table->bigInteger('log_id')->unsigned()->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,47 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerSqlQueriesTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_sql_queries';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('sha1', 40)->index();
$table->text('statement');
$table->double('time')->index();
$table->integer('connection_id')->unsigned();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,45 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerSqlQueryBindingsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_sql_query_bindings';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('sha1', 40)->index();
$table->text('serialized');
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,46 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerSqlQueryBindingsParametersTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_sql_query_bindings_parameters';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('sql_query_bindings_id')->unsigned()->nullable();
$table->string('name')->nullable()->index();
$table->text('value')->nullable();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,45 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerSqlQueriesLogTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_sql_queries_log';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('log_id')->unsigned()->index();
$table->bigInteger('sql_query_id')->unsigned()->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,44 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerConnectionsTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_connections';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('name')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,184 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerTablesRelations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->table('tracker_query_arguments', function ($table) {
$table->foreign('query_id')
->references('id')
->on('tracker_queries')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_route_paths', function ($table) {
$table->foreign('route_id')
->references('id')
->on('tracker_routes')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_route_path_parameters', function ($table) {
$table->foreign('route_path_id')
->references('id')
->on('tracker_route_paths')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_referers', function ($table) {
$table->foreign('domain_id')
->references('id')
->on('tracker_domains')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sessions', function ($table) {
$table->foreign('device_id')
->references('id')
->on('tracker_devices')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sessions', function ($table) {
$table->foreign('agent_id')
->references('id')
->on('tracker_agents')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sessions', function ($table) {
$table->foreign('referer_id')
->references('id')
->on('tracker_referers')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sessions', function ($table) {
$table->foreign('cookie_id')
->references('id')
->on('tracker_cookies')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sessions', function ($table) {
$table->foreign('geoip_id')
->references('id')
->on('tracker_geoip')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_log', function ($table) {
$table->foreign('session_id')
->references('id')
->on('tracker_sessions')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_log', function ($table) {
$table->foreign('path_id')
->references('id')
->on('tracker_paths')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_log', function ($table) {
$table->foreign('query_id')
->references('id')
->on('tracker_queries')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_log', function ($table) {
$table->foreign('route_path_id')
->references('id')
->on('tracker_route_paths')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_log', function ($table) {
$table->foreign('error_id')
->references('id')
->on('tracker_errors')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_events_log', function ($table) {
$table->foreign('event_id')
->references('id')
->on('tracker_events')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_events_log', function ($table) {
$table->foreign('class_id')
->references('id')
->on('tracker_system_classes')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_events_log', function ($table) {
$table->foreign('log_id')
->references('id')
->on('tracker_log')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sql_query_bindings_parameters', function ($table) {
$table->foreign('sql_query_bindings_id', 'tracker_sqlqb_parameters')
->references('id')
->on('tracker_sql_query_bindings')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sql_queries_log', function ($table) {
$table->foreign('log_id')
->references('id')
->on('tracker_log')
->onUpdate('cascade')
->onDelete('cascade');
});
$this->builder->table('tracker_sql_queries_log', function ($table) {
$table->foreign('sql_query_id')
->references('id')
->on('tracker_sql_queries')
->onUpdate('cascade')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
// Tables will be dropped in the correct order... :)
}
}

View File

@@ -1,45 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerRefererSearchTermTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_referers_search_terms';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->bigInteger('referer_id')->unsigned()->index();
$table->string('search_term')->index();
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,64 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class AddTrackerRefererColumns extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_referers';
private $foreign = 'tracker_referers_search_terms';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->table(
$this->table,
function ($table) {
$table->string('medium')->nullable()->index();
$table->string('source')->nullable()->index();
$table->string('search_terms_hash')->nullable()->index();
}
);
$this->builder->table($this->foreign, function ($table) {
$table->foreign('referer_id', 'tracker_referers_referer_id_fk')
->references('id')
->on('tracker_referers')
->onUpdate('cascade')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->builder->table(
$this->table,
function ($table) {
$table->dropColumn('medium');
$table->dropColumn('source');
$table->dropColumn('search_terms_hash');
}
);
$this->builder->table(
$this->foreign,
function ($table) {
$table->dropForeign('tracker_referers_referer_id_fk');
}
);
}
}

View File

@@ -1,43 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class AddTrackerRefererColumnToLog extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_log';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->table(
$this->table,
function ($table) {
$table->integer('referer_id')->unsigned()->nullable()->index();
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->builder->table(
$this->table,
function ($table) {
$table->dropColumn('referer_id');
}
);
}
}

View File

@@ -1,47 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class CreateTrackerLanguagesTable extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_languages';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->create(
$this->table,
function ($table) {
$table->bigIncrements('id');
$table->string('preference')->index();
$table->string('language-range')->index();
$table->unique(['preference', 'language-range']);
$table->timestamps();
$table->index('created_at');
$table->index('updated_at');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->drop($this->table);
}
}

View File

@@ -1,43 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class AddLanguageIdColumnToSessions extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_sessions';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->table(
$this->table,
function ($table) {
$table->bigInteger('language_id')->unsigned()->nullable()->index();
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->builder->table(
$this->table,
function ($table) {
$table->dropColumn('language_id');
}
);
}
}

View File

@@ -1,34 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class AddTrackerLanguageForeignKeyToSessions extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
$this->builder->table('tracker_sessions', function ($table) {
$table->foreign('language_id')
->references('id')
->on('tracker_languages')
->onUpdate('cascade')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
$this->builder->table('tracker_sessions', function ($table) {
$table->dropForeign(['language_id']);
});
}
}

View File

@@ -1,40 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class AddNullableToTrackerError extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_errors';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
try {
$this->builder->table(
$this->table,
function ($table) {
$table->string('code')->nullable()->change();
}
);
} catch (\Exception $e) {
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
}
}

View File

@@ -1,65 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class FixAgentName extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_agents';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
try {
$this->builder->table(
$this->table,
function ($table) {
$table->dropUnique('tracker_agents_name_unique');
}
);
$this->builder->table(
$this->table,
function ($table) {
$table->mediumText('name')->change();
}
);
$this->builder->table(
$this->table,
function ($table) {
$table->unique('id', 'tracker_agents_name_unique'); // this is a dummy index
}
);
} catch (\Exception $e) {
dd($e->getMessage());
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
try {
$this->builder->table(
$this->table,
function ($table) {
$table->string('name', 255)->change();
$table->unique('name');
}
);
} catch (\Exception $e) {
}
}
}

View File

@@ -1,70 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
use PragmaRX\Tracker\Vendor\Laravel\Models\Agent;
class AddAgentNameHash extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_agents';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
try {
$this->builder->table(
$this->table,
function ($table) {
$table->dropUnique('tracker_agents_name_unique');
$table->string('name_hash', 65)->nullable();
}
);
Agent::all()->each(function ($agent) {
$agent->name_hash = hash('sha256', $agent->name);
$agent->save();
});
$this->builder->table(
$this->table,
function ($table) {
$table->unique('name_hash');
}
);
} catch (\Exception $e) {
dd($e->getMessage());
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
try {
$this->builder->table(
$this->table,
function ($table) {
$table->dropUnique('tracker_agents_name_hash_unique');
$table->dropColumn('name_hash');
$table->mediumText('name')->unique()->change();
}
);
} catch (\Exception $e) {
}
}
}

View File

@@ -1,51 +0,0 @@
<?php
use PragmaRX\Tracker\Support\Migration;
class FixQueryArguments extends Migration
{
/**
* Table related to this migration.
*
* @var string
*/
private $table = 'tracker_query_arguments';
/**
* Run the migrations.
*
* @return void
*/
public function migrateUp()
{
try {
$this->builder->table(
$this->table,
function ($table) {
$table->string('value')->nullable()->change();
}
);
} catch (\Exception $e) {
dd($e->getMessage());
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function migrateDown()
{
try {
$this->builder->table(
$this->table,
function ($table) {
$table->string('value')->change();
}
);
} catch (\Exception $e) {
dd($e->getMessage());
}
}
}