Skip to content

Commit 4f47c8d

Browse files
authored
Merge pull request #193 from AdExNetwork/issue-151-migrations
Issue #151 migrations
2 parents 2be53b6 + caf60c0 commit 4f47c8d

File tree

18 files changed

+387
-64
lines changed

18 files changed

+387
-64
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ target
33
.env
44
*.iml
55
.idea
6-
.old
6+
.old
7+
Migrant.toml

Cargo.lock

Lines changed: 218 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

primitives/src/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub mod postgres {
222222
impl From<&Row> for Channel {
223223
fn from(row: &Row) -> Self {
224224
Self {
225-
id: row.get("channel_id"),
225+
id: row.get("id"),
226226
creator: row.get("creator"),
227227
deposit_asset: row.get("deposit_asset"),
228228
deposit_amount: row.get("deposit_amount"),

sentry/Cargo.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@ edition = "2018"
88
# Futures
99
futures-preview = { version = "=0.3.0-alpha.19", features = ["compat"]}
1010
# Primitives
11-
primitives = {path = "../primitives", features = ["postgres"]}
11+
primitives = { path = "../primitives", features = ["postgres"] }
1212
adapter = { version = "0.1", path = "../adapter" }
1313
chrono = { version = "0.4", features = ["serde"] }
1414
hex = "0.3.2"
1515
# CLI
1616
clap = "2.33.0"
1717
# Server
1818
tokio = "0.2.0-alpha.6"
19-
hyper = {version = "=0.13.0-alpha.4", features = ["unstable-stream"]}
19+
hyper = { version = "=0.13.0-alpha.4", features = ["unstable-stream"] }
2020
regex = "1"
2121
# Database
22-
redis = {version = "0.13.1-alpha.0", features = ["tokio-executor"]}
23-
bb8 = {git = "https://github.com/djc/bb8", branch = "async-await"}
24-
bb8-postgres = {git = "https://github.com/djc/bb8", branch = "async-await", features = ["with-chrono-0_4", "with-serde_json-1"]}
22+
redis = { version = "0.13.1-alpha.0", features = ["tokio-executor"] }
23+
bb8 = { git = "https://github.com/djc/bb8", branch = "async-await" }
24+
bb8-postgres = { git = "https://github.com/djc/bb8", branch = "async-await", features = ["with-chrono-0_4", "with-serde_json-1"] }
25+
# Migrations
26+
migrant_lib = { version = "0.27", features = ["d-postgres"] }
2527
# Logger
2628
slog = { version = "^2.2.3" , features = ["max_level_trace"] }
2729
# Serde
28-
serde = {version = "^1.0", features = ['derive']}
30+
serde = { version = "^1.0", features = ['derive'] }
2931
serde_json = "^1.0"
3032
serde_urlencoded = "0.6.1"
3133
# Other

sentry/Migrant.dist.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Required, do not edit
2+
database_type = "postgres"
3+
4+
# Required database info
5+
database_name = "postgres"
6+
database_user = "postgres"
7+
database_password = "docker"
8+
9+
# Configurable database info
10+
# default "localhost"
11+
database_host = "localhost"
12+
# default "5432"
13+
database_port = "5432"
14+
# default "migrations"
15+
migration_location = "migrations"

sentry/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Sentry
2+
3+
## Development
4+
5+
### Migrations
6+
While you can create the migration files yourself, you can also use `migrant`
7+
to create them for you.
8+
9+
#### Migrant
10+
1) In order to use `migrant` you need to first install it:
11+
12+
* via cargo: `cargo install migrant --features postgres`
13+
14+
(for more options see the [migrant homepage](https://github.com/jaemk/migrant))
15+
16+
2) And setup the `Migrant.toml` file, a reference to which you can find
17+
in [Migrant.dist.toml](Migrant.dist.toml).
18+
19+
For more information see [migrant homepage](https://github.com/jaemk/migrant).

sentry/diesel.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.

sentry/migrations/2019-08-06-011140_channels/down.sql

Lines changed: 0 additions & 2 deletions
This file was deleted.

sentry/migrations/2019-08-06-011140_channels/up.sql

Lines changed: 0 additions & 14 deletions
This file was deleted.

sentry/migrations/2019-08-06-011202_validatorMessages/down.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)