rectorphp / getrector-com

Rector Website
https://getrector.com
MIT License
25 stars 37 forks source link

Register database/database.sqlite to .gitignore, #1926

Closed samsonasik closed 8 months ago

samsonasik commented 8 months ago

since cache is saved to db, and the database.sqlite is commited, it make db always changed on deploy, also, I am not sure if it currently works as expected, as it seems testing it shows 0 result:

# sqlite3 database.sqlite 
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> select * from cache;

I am thinking of:

@TomasVotruba wdyt?

samsonasik commented 8 months ago

Actualy, database.sqlite seems not really needed, php artisan cache:clear is clearing bootstrap/cache dir, I will create PR to remove it.

TomasVotruba commented 8 months ago

Looks good :+1: Go for it

samsonasik commented 8 months ago

I see, there is no longer "file" driver for cache, clear:cache require a database connection, while it never filled

sqlite> select * from cache;
sqlite> select * from cache_locks;

even after clear bootstrap/cache file and open the web pages, so it actually useless.

I will try other library, eg: https://github.com/biigle/laravel-file-cache for cache to file.

If that doesn't work, the solution is to avoid re-commit again and again and make conflict, it seems we need to have database/database.sqlite excluded by register to .gitignore, by that, for first run, we can run:

➜  getrector.org git:(main) ✗ php82 artisan migrate --force  

   INFO  Preparing database.  

  Creating migration table .......................... 1.83ms DONE

   INFO  Running migrations.  

  2024_01_11_014957_create_cache_table .............. 1.20ms DONE