更新 Service:ezBookkeeping
@@ -32,4 +32,31 @@ WantedBy=multi-user.target
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
systemctl daemon-reload && systemctl enable ezbookkeeping.service && systemctl start ezbookkeeping.service && systemctl status ezbookkeeping.service
|
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;
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user