From 0ab2e5ba2b0631b28b5b1405559237b3913c878f Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Sun, 23 Mar 2025 17:11:39 +0100 Subject: feat: initialize Phoenix application for weather alerts This commit sets up the initial Silmataivas project structure, including: Phoenix web framework configuration, database models for users and locations, weather polling service, notification system, Docker and deployment configurations, CI/CD pipeline setup --- installation/setup_db.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 installation/setup_db.sql (limited to 'installation/setup_db.sql') diff --git a/installation/setup_db.sql b/installation/setup_db.sql new file mode 100644 index 0000000..3014dc0 --- /dev/null +++ b/installation/setup_db.sql @@ -0,0 +1,19 @@ +-- setup_db.sql + +-- Create user (if it doesn't exist) +DO +$$ +BEGIN + IF NOT EXISTS ( + SELECT FROM pg_catalog.pg_roles WHERE rolname = 'silmataivas' + ) THEN + CREATE ROLE silmataivas LOGIN PASSWORD 'silmataivas'; + END IF; +END +$$; + +-- Create database owned by the user +CREATE DATABASE silmataivas OWNER silmataivas; + +-- Optional: grant all privileges explicitly +GRANT ALL PRIVILEGES ON DATABASE silmataivas TO silmataivas; \ No newline at end of file -- cgit v1.2.3