Skip to content

Commit

Permalink
Modify script to not regenerate file every time
Browse files Browse the repository at this point in the history
  • Loading branch information
popzxc committed Sep 21, 2020
1 parent de7d0f3 commit 467191b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
18 changes: 16 additions & 2 deletions bin/db-setup
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@ echo DATABASE_URL=$DATABASE_URL
diesel database setup
diesel migration run

cargo sqlx prepare

# We don't need this file for sqlx
rm src/schema.rs.generated

# Check generated sqlx data
if ! cargo sqlx prepare --check
then
if [ -z $CI ]; then
# It's not CI, just generate new bindings.
# Prepare sqlx bindings
echo "Going to rerun 'sqlx prepare'"
cargo sqlx prepare
else
# It's CI and bindings are outdated.
echo "'sqlx-data.json' in storagee folder is incorrect."
echo "Generate and commit correct one with 'cargo sqlx prepare' in storage folder"
exit 1
fi
fi
18 changes: 1 addition & 17 deletions core/lib/storage/sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3104,22 +3104,6 @@
]
}
},
"ec815cee37d8ac3557b523521a6bee44c7e8d949309e7dd9b0d0364edd2e85e9": {
"query": "INSERT INTO eth_parameters (nonce, gas_price_limit, commit_ops, verify_ops, withdraw_ops)\n VALUES ($1, $2, $3, $4, $5)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8",
"Int8",
"Int8",
"Int8",
"Int8"
]
},
"nullable": []
}
},
"f057b85811c3991b73c58991fc8dae8bf4cdf9d2238171ca13a3fdf1172f2c91": {
"query": "SELECT * FROM data_restore_events_state\n WHERE block_type = $1\n ORDER BY block_num ASC",
"describe": {
Expand Down Expand Up @@ -3463,4 +3447,4 @@
]
}
}
}
}

0 comments on commit 467191b

Please sign in to comment.