These are the steps to connect to the CockroachDB insecure cluster running locally
- Install postgresql driver
sudo apt-get install php7.3-pgsql
- Run database cluster with docker-compose
docker-compose up
- STart a new terminal session in one node of the cluser
docker exec -it <COCKROACH_DB_NODE_CONTAINER_ID> bash
- Start a new SQL session
cockroach sql --insecure
- Create the database
CREATE DATABASE laravel_on_fhir;
- Exit from sql and container and then run the migrations
php artisan migrate
Manually set user as admin:
use laravel_on_fhir;
update users set role_id = (select id from roles where name = 'admin') where email = '[email protected]';
exit