Compare commits
7 Commits
v0.6.5
...
f5429e5a0b
| Author | SHA1 | Date | |
|---|---|---|---|
|
f5429e5a0b
|
|||
|
33fcf7ac9f
|
|||
|
07932f71da
|
|||
|
146055eca2
|
|||
|
99bd43fb8c
|
|||
|
b4fbf252c7
|
|||
|
ae02ccc5e5
|
@@ -2,13 +2,6 @@ A auth web API services for the Icarus project.
|
|||||||
|
|
||||||
|
|
||||||
# Getting Started
|
# Getting Started
|
||||||
Install the `sqlx` tool to use migrations.
|
|
||||||
```
|
|
||||||
cargo install sqlx-cli
|
|
||||||
```
|
|
||||||
This will be used to scaffold development for local environments.
|
|
||||||
|
|
||||||
|
|
||||||
The easiest way to get started is through docker. This assumes that docker is already installed
|
The easiest way to get started is through docker. This assumes that docker is already installed
|
||||||
on your system. Copy the `.env.docker.sample` as `.env`. Most of the data in the env file doesn't
|
on your system. Copy the `.env.docker.sample` as `.env`. Most of the data in the env file doesn't
|
||||||
need to be modified. The `SECRET_KEY` variable should be changed since it will be used for token
|
need to be modified. The `SECRET_KEY` variable should be changed since it will be used for token
|
||||||
@@ -40,4 +33,4 @@ docker system prune -a
|
|||||||
```
|
```
|
||||||
|
|
||||||
To view the OpenAPI spec, run the project and access `/swagger-ui`. If running through docker,
|
To view the OpenAPI spec, run the project and access `/swagger-ui`. If running through docker,
|
||||||
the url would be something like `http://localhost:8001/swagger-ui`.
|
the url would be something like `http://localhost:8000/swagger-ui`.
|
||||||
|
|||||||
27
run_migrations.txt
Normal file
27
run_migrations.txt
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
TODO: At some point, move this somewhere that is appropriate
|
||||||
|
|
||||||
|
# Make sure role has CREATEDB
|
||||||
|
ALTER ROLE username_that_needs_permission CREATEDB;
|
||||||
|
|
||||||
|
# Install migrations
|
||||||
|
cargo install sqlx-cli
|
||||||
|
|
||||||
|
# Make sure to populate DATABASE_URL with correct value.
|
||||||
|
# By default, the DATABASE_URL found in .env file will be used
|
||||||
|
export DATABASE_URL="postgres://icarus_op_test:password@localhost/icarus_auth_test"
|
||||||
|
|
||||||
|
# init
|
||||||
|
sqlx migrate add init_migration
|
||||||
|
sqlx migrate run
|
||||||
|
|
||||||
|
# Create
|
||||||
|
sqlx database create
|
||||||
|
|
||||||
|
# Drop
|
||||||
|
sqlx database drop
|
||||||
|
|
||||||
|
# setup
|
||||||
|
sqlx database setup
|
||||||
|
|
||||||
|
# Reset
|
||||||
|
sqlx database reset
|
||||||
Reference in New Issue
Block a user