|
|
|
|
@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
|
|
return new class extends Migration
|
|
|
|
|
{
|
|
|
|
|
return new class extends Migration {
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*/
|
|
|
|
|
@ -16,7 +15,6 @@ return new class extends Migration
|
|
|
|
|
$table->string('code', 50)->unique();
|
|
|
|
|
$table->string('ik_address_id', 255);
|
|
|
|
|
$table->string('notes', 255)->nullable();
|
|
|
|
|
$table->timestampTz('last_connected_at')->nullable();
|
|
|
|
|
$table->string('col1', 255)->nullable();
|
|
|
|
|
$table->string('col2', 255)->nullable();
|
|
|
|
|
$table->string('col3', 255)->nullable();
|
|
|
|
|
@ -27,53 +25,65 @@ return new class extends Migration
|
|
|
|
|
$table->string('col8', 255)->nullable();
|
|
|
|
|
$table->string('col9', 255)->nullable();
|
|
|
|
|
$table->string('col10', 255)->nullable();
|
|
|
|
|
$table->bool('is_acctive')->default(true);
|
|
|
|
|
$table->boolean('is_active')->default(true);
|
|
|
|
|
$table->timestampTz('installed_at')->nullable();
|
|
|
|
|
$table->timestampTz('last_connected_at')->nullable();
|
|
|
|
|
$table->timestampsTz();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Schema::create('tv_sessions', function (Blueprint $table) {
|
|
|
|
|
Schema::create('new_tv_requests', function (Blueprint $table) {
|
|
|
|
|
$table->id();
|
|
|
|
|
$table->foreignId('tv_fk')->index();
|
|
|
|
|
$table->timestampTz('started_at')->index();
|
|
|
|
|
$table->timestampTz('finished_at')->nullable()->index();
|
|
|
|
|
$table->boolean('is_playing_video');
|
|
|
|
|
$table->jsonb('current_videos')->nullable();
|
|
|
|
|
$table->string('code', 50);
|
|
|
|
|
$table->jsonb('device_info')->nullable();
|
|
|
|
|
$table->timestampTz('activated_at')->nullable();
|
|
|
|
|
$table->timestampTz('responded_at')->nullable();
|
|
|
|
|
$table->timestampsTz();
|
|
|
|
|
|
|
|
|
|
$table->foreign('tv_fk')->references('id')->on('tvs');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Schema::create('tv_app_infos', function (Blueprint $table) {
|
|
|
|
|
$table->foreignId('tv_fk')->unique()->index();
|
|
|
|
|
$table->timestampTz('installed_at')->nullable()->index();
|
|
|
|
|
$table->jsonb('current_videos')->nullable();
|
|
|
|
|
$table->timestampTz('last_updated_video')->nullable()->index();
|
|
|
|
|
$table->timestampsTz();
|
|
|
|
|
// Schema::create('tv_sessions', function (Blueprint $table) {
|
|
|
|
|
// $table->id();
|
|
|
|
|
// $table->foreignId('tv_fk')->index();
|
|
|
|
|
// $table->timestampTz('started_at')->index();
|
|
|
|
|
// $table->timestampTz('finished_at')->nullable()->index();
|
|
|
|
|
// $table->boolean('is_playing_video');
|
|
|
|
|
// $table->jsonb('current_videos')->nullable();
|
|
|
|
|
// $table->timestampsTz();
|
|
|
|
|
|
|
|
|
|
$table->foreign('tv_fk')->references('id')->on('tvs');
|
|
|
|
|
});
|
|
|
|
|
// $table->foreign('tv_fk')->references('id')->on('tvs');
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
Schema::create('tv_app_logs', function (Blueprint $table) {
|
|
|
|
|
$table->id();
|
|
|
|
|
$table->foreignId('tv_fk')->index();
|
|
|
|
|
$table->string('requested_to');
|
|
|
|
|
$table->string('ip', 50);
|
|
|
|
|
$table->jsonb('request_data')->nullable();
|
|
|
|
|
$table->enum('result', ['success', 'failed']);
|
|
|
|
|
$table->jsonb('response_data')->nullable();
|
|
|
|
|
$table->timestampsTz();
|
|
|
|
|
// Schema::create('tv_app_infos', function (Blueprint $table) {
|
|
|
|
|
// $table->foreignId('tv_fk')->unique()->index();
|
|
|
|
|
// $table->timestampTz('installed_at')->nullable()->index();
|
|
|
|
|
// $table->jsonb('current_videos')->nullable();
|
|
|
|
|
// $table->timestampTz('last_updated_video')->nullable()->index();
|
|
|
|
|
// $table->timestampsTz();
|
|
|
|
|
|
|
|
|
|
$table->foreign('tv_fk')->references('id')->on('tvs');
|
|
|
|
|
});
|
|
|
|
|
// $table->foreign('tv_fk')->references('id')->on('tvs');
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// Schema::create('tv_app_logs', function (Blueprint $table) {
|
|
|
|
|
// $table->id();
|
|
|
|
|
// $table->foreignId('tv_fk')->index();
|
|
|
|
|
// $table->string('requested_to');
|
|
|
|
|
// $table->string('ip', 50);
|
|
|
|
|
// $table->jsonb('request_data')->nullable();
|
|
|
|
|
// $table->enum('result', ['success', 'failed']);
|
|
|
|
|
// $table->jsonb('response_data')->nullable();
|
|
|
|
|
// $table->timestampsTz();
|
|
|
|
|
|
|
|
|
|
// $table->foreign('tv_fk')->references('id')->on('tvs');
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*/
|
|
|
|
|
public function down(): void {
|
|
|
|
|
Schema::drop('tv_app_logs');
|
|
|
|
|
Schema::drop('tv_app_infos');
|
|
|
|
|
Schema::drop('tv_sessions');
|
|
|
|
|
// Schema::drop('tv_app_logs');
|
|
|
|
|
// Schema::drop('tv_app_infos');
|
|
|
|
|
// Schema::drop('tv_sessions');
|
|
|
|
|
Schema::drop('new_tv_requests');
|
|
|
|
|
Schema::drop('tvs');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|