You've already forked flix
Update dependencies and lints
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
//! Custom views for shows.
|
||||
|
||||
use sea_orm::prelude::*;
|
||||
use sea_orm::sea_query::Table;
|
||||
use sea_orm::{ConnectionTrait, DbBackend, Statement};
|
||||
use sea_orm::{DbBackend, Statement};
|
||||
use sea_orm_migration::prelude::*;
|
||||
|
||||
pub async fn up(manager: &SchemaManager<'_>) -> Result<(), DbErr> {
|
||||
/// # Errors
|
||||
/// Database operations can fail.
|
||||
pub(crate) async fn up(manager: &SchemaManager<'_>) -> Result<(), DbErr> {
|
||||
manager
|
||||
.drop_table(Table::drop().table("flix_watched_shows").to_owned())
|
||||
.await?;
|
||||
|
||||
manager
|
||||
_ = manager
|
||||
.get_connection()
|
||||
.execute_raw(Statement::from_string(
|
||||
DbBackend::Sqlite,
|
||||
r#"
|
||||
"
|
||||
CREATE VIEW flix_watched_shows AS
|
||||
SELECT
|
||||
w.show_id as id,
|
||||
@@ -33,22 +37,24 @@ pub async fn up(manager: &SchemaManager<'_>) -> Result<(), DbErr> {
|
||||
)
|
||||
GROUP BY w.show_id, w.user_id
|
||||
;
|
||||
"#,
|
||||
",
|
||||
))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn down(manager: &SchemaManager<'_>) -> Result<(), DbErr> {
|
||||
manager
|
||||
/// # Errors
|
||||
/// Database operations can fail.
|
||||
pub(crate) async fn down(manager: &SchemaManager<'_>) -> Result<(), DbErr> {
|
||||
_ = manager
|
||||
.get_connection()
|
||||
.execute_raw(Statement::from_string(
|
||||
DbBackend::Sqlite,
|
||||
r#"
|
||||
"
|
||||
DROP VIEW flix_watched_shows
|
||||
;
|
||||
"#,
|
||||
",
|
||||
))
|
||||
.await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user