change database name

This commit is contained in:
Bilal Catic
2019-05-23 18:58:17 +02:00
parent c7c7957c8a
commit 2ff4e4ae8a
3 changed files with 11 additions and 7 deletions

View File

@@ -7,15 +7,19 @@ Integrate and customize CRM and ERP used by SimaSpace
1. Run setup script : `npm run setup` 1. Run setup script : `npm run setup`
This installs packages for server and client applications. This installs packages for server and client applications.
Then builds docker image for database and starts container. Then builds docker image for database and starts container.
Database name is `psychology`. Default username is `docker` and default password is `docker`. Database name is `CrmIntegration`. Default username is `docker` and default password is `docker`.
NOTE : If migration fails, try executing migrations manually with `npm run migrate`
If everything works correctly, it is possible to connect to database with : If everything works correctly, it is possible to connect to database with :
`psql -d psychology -p 5432 -U docker -h localhost` `psql -d CrmIntegration -p 5432 -U docker -h localhost`
3. Start server : `npm run start-server` 3. Start server : `npm run start-server`
4. Start client : `npm run start-client` 4. Start client : `npm run start-client`
Open app on http://localhost:3000
#### Useful NPM scripts #### Useful NPM scripts
There are few scripts to handle some operations faster, without copy-pasting commands to terminal There are few scripts to handle some operations faster, without copy-pasting commands to terminal

View File

@@ -2,7 +2,7 @@
"development": { "development": {
"username": "docker", "username": "docker",
"password": "docker", "password": "docker",
"database": "psychology", "database": "CrmIntegration",
"port": "5432", "port": "5432",
"dialect": "postgres" "dialect": "postgres"
}, },

View File

@@ -7,10 +7,10 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"install-server": "npm install", "install-server": "npm install",
"install-client": "cd client && yarn install", "install-client": "cd client && yarn install",
"docker-build": "docker build -t psychology .", "docker-build": "docker build -t simaspace .",
"docker-start": "docker run -e POSTGRES_USER=docker -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=psychology --name pg_psychology -d -p 5432:5432 psychology", "docker-start": "docker run -e POSTGRES_USER=docker -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=CrmIntegration --name pg_simaspace -d -p 5432:5432 simaspace",
"docker-stop": "docker stop pg_psychology", "docker-stop": "docker stop pg_simaspace",
"setup": "npm run install-server && npm run install-client && npm run docker-build && npm run docker-start && npm run migrate", "setup": "npm run install-server && npm run install-client && npm run docker-build && npm run docker-start && sleep 2 && npm run migrate",
"migrate": "npx sequelize db:migrate", "migrate": "npx sequelize db:migrate",
"start-server": "nodemon server.js", "start-server": "nodemon server.js",
"start-client": "cd client && yarn start", "start-client": "cd client && yarn start",