更新 Service:ezBookkeeping

2026-05-06 13:45:02 +00:00
parent 81eec73044
commit eee56c3247
+27
@@ -32,4 +32,31 @@ WantedBy=multi-user.target
```bash
systemctl daemon-reload && systemctl enable ezbookkeeping.service && systemctl start ezbookkeeping.service && systemctl status ezbookkeeping.service
```
# 使用
```bash
sudo -u postgres psql
```
新建使用者與資料庫
```sql
CREATE USER ezbookkeeping WITH PASSWORD 'ezbookkeeping';
CREATE DATABASE ezbookkeeping;
```
設定資料庫權限
```sql
-- 1. Give ownership of the database to the app user
ALTER DATABASE ezbookkeeping OWNER TO ezbookkeeping;
-- 2. Give ownership of the public schema to the app user
ALTER SCHEMA public OWNER TO ezbookkeeping;
-- 3. Ensure the user has create permissions (Crucial for Postgres 15+)
GRANT USAGE, CREATE ON SCHEMA public TO ezbookkeeping;
```