Skip to content

Commit

Permalink
Fix undocumented upgrade fuckery for L11
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzipp committed Mar 13, 2024
1 parent 0641a91 commit f7204e9
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 222 deletions.
10 changes: 6 additions & 4 deletions migrations/2018_02_05_000000_create_queue_monitor_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use romanzipp\QueueMonitor\Enums\MonitorStatus;

class CreateQueueMonitorTable extends Migration
{
public function up()
{
Schema::create(config('queue-monitor.table'), function (Blueprint $table) {
$table->increments('id');
$table->uuid('job_uuid')->nullable();

$table->string('job_id')->index();
$table->string('name')->nullable();
$table->string('queue')->nullable();

$table->unsignedInteger('status')->default(MonitorStatus::RUNNING);

$table->dateTime('queued_at')->nullable();
$table->timestamp('started_at')->nullable()->index();
$table->string('started_at_exact')->nullable();

$table->timestamp('finished_at')->nullable();
$table->string('finished_at_exact')->nullable();

$table->float('time_elapsed', 12, 6)->nullable()->index();

$table->boolean('failed')->default(false)->index();

$table->integer('attempt')->default(0);
$table->boolean('retried')->default(false);
$table->integer('progress')->nullable();

$table->longText('exception')->nullable();
Expand Down
63 changes: 0 additions & 63 deletions migrations/2023_03_01_000000_update_queue_monitor_table.php

This file was deleted.

This file was deleted.

This file was deleted.

33 changes: 14 additions & 19 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnFailure="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
Expand All @@ -35,4 +25,9 @@
<server name="CACHE_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="database"/>
</php>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
17 changes: 2 additions & 15 deletions tests/TestCases/DatabaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,11 @@

abstract class DatabaseTestCase extends TestCase
{
use RefreshDatabase {
refreshTestDatabase as baseRefreshTestDatabase;
refreshInMemoryDatabase as baseRefreshInMemoryDatabase;
}

protected function refreshInMemoryDatabase(): void
{
$this->createJobsTable();
$this->createFailedJobsTable();
use RefreshDatabase;

$this->baseRefreshInMemoryDatabase();
}

protected function refreshTestDatabase(): void
protected function afterRefreshingDatabase(): void
{
$this->tryCreateJobsTables();

$this->baseRefreshTestDatabase();
}

protected function tryCreateJobsTables(): void
Expand Down
53 changes: 0 additions & 53 deletions tests/UpgradeTest.php

This file was deleted.

0 comments on commit f7204e9

Please sign in to comment.