| 1 | -- Initialize separate database for each microservice |
| 2 | -- This script runs when PostgreSQL container starts for the first time |
| 3 | |
| 4 | -- Create database for each service |
| 5 | CREATE DATABASE notesverb_auth; |
| 6 | CREATE DATABASE notesverb_users; |
| 7 | CREATE DATABASE notesverb_notes; |
| 8 | CREATE DATABASE notesverb_tags; |
| 9 | |
| 10 | |
| 11 | -- Grant permissions to the notesverb user |
| 12 | GRANT ALL PRIVILEGES ON DATABASE notesverb_auth TO notesverb; |
| 13 | GRANT ALL PRIVILEGES ON DATABASE notesverb_users TO notesverb; |
| 14 | GRANT ALL PRIVILEGES ON DATABASE notesverb_notes TO notesverb; |
| 15 | GRANT ALL PRIVILEGES ON DATABASE notesverb_tags TO notesverb; |