embed migrations

This commit is contained in:
2022-03-24 14:31:13 +08:00
parent cd940d59ba
commit aabe18f5a4
4 changed files with 39 additions and 16 deletions

View File

@@ -5,20 +5,22 @@
### prepare database
```sql
CREATE USER hole CREATEDB;
ALTER USER hole WITH PASSWORD "hole_pass";
```
sudo -u postgres psql
```
```postgresql
postgres=# CREATE USER hole WITH PASSWORD 'hole_pass';
CREATE ROLE
postgres=# CREATE DATABASE hole_v2 OWNER hole;
CREATE DATABASE
postgres=# \c hole_v2
You are now connected to database "hole_v2" as user "postgres".
hole_v2=# CREATE EXTENSION pg_trgm;
CREATE EXTENSION
hole_v2=# \q
```
```
$ diesel setup
```
```sql
\c hole_v2
CREATE EXTENSION pg_trgm;
```
```
$ diesel run
./hole-thu --init-database
```