Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on migration on sqlite #107

Closed
nezaboravi opened this issue Dec 2, 2023 · 7 comments
Closed

Error on migration on sqlite #107

nezaboravi opened this issue Dec 2, 2023 · 7 comments
Assignees
Labels

Comments

@nezaboravi
Copy link

Pulse Version

1.0.0

Laravel Version

10.4.2

PHP Version

8.2

Description

On first migration error:

SQLSTATE[HY000]: General error: 1 no such function: md5 (Connection: sqlite, SQL: create table "pulse_values" ("timestamp" integer not null, "type" varchar not null, "key" text not null, "key_hash" varchar as (unhex(md5(key))), "value" text not null))

Steps To Reproduce

I have tried to install it on existing app, and when step to migrate db came, i got that error.

@jessarcher
Copy link
Member

Hi @nezaboravi,

Pulse currently only works with a MySQL database, as mentioned at https://laravel.com/docs/10.x/pulse#installation.

I can see how this would be annoying in a project that uses SQLite for local development. I think we'll look at making it possible to disable the Pulse migrations in a local environment.

I've done some work in #64 to add Postgres support. It might be trivial to add SQLite support as well, although I don't think I'd recommend using Pulse with SQLite in production.

@jessarcher jessarcher self-assigned this Dec 2, 2023
@jessarcher jessarcher added the bug label Dec 2, 2023
@ryanpitts1
Copy link

@jessarcher we use SQLite for our tests in github actions. Now our actions pipeline fails every time when trying to run migrations. Is there a way we can disable the pulse migration if the environment is testing?

@joelhinz
Copy link

joelhinz commented Dec 2, 2023

@jessarcher we use SQLite for our tests in github actions. Now our actions pipeline fails every time when trying to run migrations. Is there a way we can disable the pulse migration if the environment is testing?

You could tell the environment that pulse isn't enabled. That way, it won't run the migration. E.g.:

// config/pulse.php
'enabled' => env('PULSE_ENABLED', true),

// phpunit.xml
<server name="PULSE_ENABLED" value="false"/>

@jessarcher I thought it was a bug at first as well, but I'm leaning towards maybe it should be a warning in the Pulse docs rather than a code fix? Great work on Pulse, btw. :)

@eleftrik
Copy link

eleftrik commented Dec 3, 2023

Thanks for the hint, @joelhinz 👍

@timacdonald
Copy link
Member

// phpunit.xml
<server name="PULSE_ENABLED" value="false"/>

This is the way 👍

@ryanpitts1
Copy link

Thanks for the hint @joelhinz and @timacdonald!

@nezaboravi
Copy link
Author

// phpunit.xml
<server name="PULSE_ENABLED" value="false"/>

This is the way 👍

This is the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants