PLAYER: Added generated playlists feature
Build and Publish / Build and Publish Docker Image (push) Successful in 3m5s
Build and Publish / Build and Publish Docker Image (push) Successful in 3m5s
This commit is contained in:
@@ -1815,6 +1815,56 @@ pub mod db_migrations {
|
||||
&[Operation::custom(create_artwork_lookup_state).build()];
|
||||
}
|
||||
|
||||
// -- M0035: Weighted metadata tags for tracks, releases, and artists ----
|
||||
|
||||
#[cot::db::migrations::migration_op]
|
||||
async fn create_entity_genre_tags(
|
||||
ctx: migrations::MigrationContext<'_>,
|
||||
) -> cot::db::Result<()> {
|
||||
ctx.db
|
||||
.raw(
|
||||
"CREATE TABLE IF NOT EXISTS furumusic__entity_genre_tag (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
entity_kind VARCHAR(32) NOT NULL,
|
||||
entity_id BIGINT NOT NULL,
|
||||
genre_id BIGINT NOT NULL,
|
||||
source VARCHAR(32) NOT NULL,
|
||||
weight DOUBLE PRECISION NOT NULL DEFAULT 1,
|
||||
updated_at VARCHAR(32) NOT NULL,
|
||||
UNIQUE(entity_kind, entity_id, genre_id, source)
|
||||
)",
|
||||
)
|
||||
.await?;
|
||||
ctx.db
|
||||
.raw(
|
||||
"CREATE INDEX IF NOT EXISTS idx_entity_genre_tag_entity
|
||||
ON furumusic__entity_genre_tag (entity_kind, entity_id, source)",
|
||||
)
|
||||
.await?;
|
||||
ctx.db
|
||||
.raw(
|
||||
"CREATE INDEX IF NOT EXISTS idx_entity_genre_tag_genre
|
||||
ON furumusic__entity_genre_tag (genre_id, entity_kind)",
|
||||
)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct M0035CreateEntityGenreTags;
|
||||
|
||||
impl migrations::Migration for M0035CreateEntityGenreTags {
|
||||
const APP_NAME: &'static str = "furumusic";
|
||||
const MIGRATION_NAME: &'static str = "m_0035_create_entity_genre_tags";
|
||||
const DEPENDENCIES: &'static [migrations::MigrationDependency] =
|
||||
&[migrations::MigrationDependency::migration(
|
||||
"furumusic",
|
||||
"m_0034_create_artwork_lookup_state",
|
||||
)];
|
||||
const OPERATIONS: &'static [Operation] =
|
||||
&[Operation::custom(create_entity_genre_tags).build()];
|
||||
}
|
||||
|
||||
pub const MIGRATIONS: &[&SyncDynMigration] = &[
|
||||
&M0006CreateMediaFile,
|
||||
&M0007CreateArtist,
|
||||
@@ -1840,5 +1890,6 @@ pub mod db_migrations {
|
||||
&M0032CreateLastfmTrackPopularity,
|
||||
&M0033CreateLastfmScrobbling,
|
||||
&M0034CreateArtworkLookupState,
|
||||
&M0035CreateEntityGenreTags,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user