Skip to content

Commit

Permalink
replace mysql with sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmajor committed May 2, 2024
1 parent d4e9c39 commit a8106e1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 30 deletions.
7 changes: 1 addition & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=bajki_muza
DB_USERNAME=root
DB_PASSWORD=
DB_CONNECTION=default

FILESYSTEM_CLOUD=s3

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run: |
cp .env.example .env
php artisan key:generate
touch database/testing.sqlite
- name: Execute tests
run: vendor/bin/phpunit
Expand Down
29 changes: 10 additions & 19 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,24 @@

return [

'default' => env('DB_CONNECTION', 'mysql'),
'default' => env('DB_CONNECTION', 'default'),

'connections' => [

'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'default' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
'foreign_key_constraints' => true,
],

'testing' => [
'driver' => 'sqlite',
'database' => storage_path('testing.sqlite'),
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('testing.sqlite')),
'prefix' => '',
'foreign_key_constraints' => true,
],

],
Expand Down
4 changes: 2 additions & 2 deletions config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
],

'batching' => [
'database' => env('DB_CONNECTION', 'mysql'),
'database' => env('DB_CONNECTION', 'default'),
'table' => 'job_batches',
],

'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'),
'database' => env('DB_CONNECTION', 'default'),
'table' => 'failed_jobs',
],

Expand Down
2 changes: 1 addition & 1 deletion config/telescope.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

'storage' => [
'database' => [
'connection' => env('DB_CONNECTION', 'mysql'),
'connection' => env('DB_CONNECTION', 'default'),
'chunk' => 1000,
],
],
Expand Down
2 changes: 0 additions & 2 deletions storage/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
testing.sqlite
testing.sqlite-journal
/export-*/

0 comments on commit a8106e1

Please sign in to comment.