mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
fixup! Add next refresh date migration
This commit is contained in:
parent
e39337f8f1
commit
c4cd4ead44
@ -54,11 +54,17 @@ public partial class AddNextRefresh : Migration
|
|||||||
// language=PostgreSQL
|
// language=PostgreSQL
|
||||||
migrationBuilder.Sql(
|
migrationBuilder.Sql(
|
||||||
"""
|
"""
|
||||||
update episodes as e set external_id = jsonb_build_object(
|
update episodes as e set external_id = (
|
||||||
'ShowId', e.show_id,
|
SELECT jsonb_build_object(
|
||||||
'SeasonNumber', e.season_number,
|
'themoviedatabase', jsonb_build_object(
|
||||||
'EpisodeNumber', e.episode_number,
|
'ShowId', s.external_id->'themoviedatabase'->'DataId',
|
||||||
'Link', null
|
'Season', e.season_number,
|
||||||
|
'Episode', e.episode_number,
|
||||||
|
'Link', null
|
||||||
|
)
|
||||||
|
)
|
||||||
|
FROM shows AS s
|
||||||
|
WHERE s.id = e.show_id
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
);
|
);
|
||||||
|
@ -82,6 +82,10 @@ public class PostgresContext(DbContextOptions options, IHttpContextAccessor acce
|
|||||||
typeof(Dictionary<string, MetadataId>),
|
typeof(Dictionary<string, MetadataId>),
|
||||||
new JsonTypeHandler<Dictionary<string, MetadataId>>()
|
new JsonTypeHandler<Dictionary<string, MetadataId>>()
|
||||||
);
|
);
|
||||||
|
SqlMapper.AddTypeHandler(
|
||||||
|
typeof(Dictionary<string, EpisodeId>),
|
||||||
|
new JsonTypeHandler<Dictionary<string, EpisodeId>>()
|
||||||
|
);
|
||||||
SqlMapper.AddTypeHandler(
|
SqlMapper.AddTypeHandler(
|
||||||
typeof(Dictionary<string, string>),
|
typeof(Dictionary<string, string>),
|
||||||
new JsonTypeHandler<Dictionary<string, string>>()
|
new JsonTypeHandler<Dictionary<string, string>>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user