laravel-async-queue icon indicating copy to clipboard operation
laravel-async-queue copied to clipboard

Laravel 5.3 migration problems and fix

Open etwasch opened this issue 8 years ago • 7 comments

Hi Barry

I'm completely new to laravel and your laravel-async-queue and therefore I don't know if the table created with the queue:table command has changed in 5.3 or if it's because of the new notifications.

  • There is a column missing 'reserved' (tinyint [unsigned?])
  • One has to rename the table 'jobs' to 'queue_jobs' (or change the config/queue.php entry)

The queue was working with mailables but not with notifications. After I added the column 'reserved' it's working perfectly.

Thank you very much for this and the laravel-ide-helper, it's great!

etwasch avatar Dec 01 '16 12:12 etwasch

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'reserved' in 'field list' (SQL: insert into `jobs` (`queue`, `payload`, `attempts`, `reserved`, `reserved_at`, `available_at`, `created_at`) values (default, {"job":"Illuminate\\Queue\\CallQueuedHandler@call","data":{"commandName":"Illuminate\\Mail\\SendQueuedMailable","command":"O:34:\"Illuminate\\Mail\\SendQueuedMailable\":1:{s:11:\"\u0000*\u0000mailable\";O:33:\"App\\Mail\\EmailVerificationRequest\":17:{s:4:\"user\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":2:{s:5:\"class\";s:8:\"App\\User\";s:2:\"id\";i:38;}s:5:\"token\";i:0;s:7:\"\u0000*\u0000from\";a:0:{}s:5:\"\u0000*\u0000to\";a:1:{i:0;a:2:{s:7:\"address\";s:25:\"[email protected]\";s:4:\"name\";N;}}s:5:\"\u0000*\u0000cc\";a:0:{}s:6:\"\u0000*\u0000bcc\";a:0:{}s:10:\"\u0000*\u0000replyTo\";a:0:{}s:10:\"\u0000*\u0000subject\";N;s:7:\"\u0000*\u0000view\";N;s:11:\"\u0000*\u0000textView\";N;s:11:\"\u0000*\u0000viewData\";a:0:{}s:14:\"\u0000*\u0000attachments\";a:0:{}s:17:\"\u0000*\u0000rawAttachments\";a:0:{}s:12:\"\u0000*\u0000callbacks\";a:0:{}s:10:\"connection\";N;s:5:\"queue\";N;s:5:\"delay\";N;}}"}}, 0, 1, 1481639050, 1481639050, 1481639050))

I've the same problem with default Laravel 5.3 migration

TUNER88 avatar Dec 13 '16 14:12 TUNER88

I've the same problem with default Laravel 5.3 migration

Just add the column to the table and it's fixed: $table->tinyInteger('reserved')->unsigned();

etwasch avatar Dec 13 '16 14:12 etwasch

@etwasch thx for your snippet, but it's only a workaround. The problem should be fixed in the package, since the framework and package does not use this field any more, it should be removed from the query.

TUNER88 avatar Dec 13 '16 14:12 TUNER88

@TUNER88 wouldn't this break backwards compatibility?

etwasch avatar Dec 13 '16 14:12 etwasch

@etwasch ~~looks like it already incompatible with older framework versions, since the is no field named reserved_at .~~ ~~The reserved field was transformed form boolean to timestampfield in Laravel 5.3.~~

You are totally right, applications based on older framework versions could use an older version of this package.

TUNER88 avatar Dec 13 '16 14:12 TUNER88

We should just use the Laravel migrations instead of our own.

barryvdh avatar Dec 13 '16 16:12 barryvdh

Hi, readme says for Laravel 5.3 use the 0.5 branch, but still the problem exists. Should I stick with Laravel migrations solution, as proposed by @barryvdh ?

nelsonfncosta avatar Jun 13 '17 13:06 nelsonfncosta