♻️ refactor: Run clippy and add comment to readme

This commit is contained in:
Dominic Harris 2022-04-05 12:50:15 -04:00
parent 835641b63d
commit 58fa06a8f8
No known key found for this signature in database
GPG Key ID: 93CCF85F3E2A4F65
2 changed files with 11 additions and 15 deletions

View File

@ -70,6 +70,16 @@ Submit your public instance [here](https://github.com/Domterion/zer0bin/issues/n
### Looking for API reference, self-hosting instructions, and/or benchmarks?
<!--
This needs to go to the wiki
To move database over to SQLx managed migrations do the following:
1. Run `ALTER TABLE pastes RENAME TO old_pastes` in PSQL
2. Start the backend to create the new managed tables
3. Run `INSERT INTO pastes SELECT * from old_pastes;` and `DROP TABLE old_pastes;` in PSQL
-->
<a href="https://github.com/zer0bin-dev/zer0bin/wiki">
<img alt="Stargazers" src="https://custom-icon-badges.herokuapp.com/badge/read_the-wiki-ebbcba?style=for-the-badge&logo=repo&logoColor=eb6f92&labelColor=191724" height=50></a>

View File

@ -12,12 +12,7 @@ use actix_web::{
};
use config::Config;
use sqlx::{
migrate::Migrator,
postgres::{PgPoolOptions, PgRow},
PgPool, Row, error::DatabaseError,
};
use sqlx::migrate::MigrateError::Execute;
use sqlx::{migrate::Migrator, postgres::PgPoolOptions, PgPool};
use crate::routes::{
get_paste, get_raw_paste, get_stats, get_total_pastes_badge, get_version_badge, new_paste,
@ -32,15 +27,6 @@ pub struct AppState {
pub async fn migrations(pool: &PgPool) -> Result<(), sqlx::Error> {
let migrator = Migrator::new(Path::new("./migrations")).await?;
/*
To move database over to SQLx managed migrations do the following:
1. Run `ALTER TABLE pastes RENAME TO old_pastes` in PSQL
2. Start the backend to create the new managed tables
3. Run `INSERT INTO pastes SELECT * from old_pastes;` and `DROP TABLE old_pastes;` in PSQL
*/
migrator.run(pool).await?;
Ok(())