feat: implement episode actions add endpoint
This commit is contained in:
parent
064365fb4f
commit
bcfb8805eb
13 changed files with 152 additions and 63 deletions
|
|
@ -1,6 +1,6 @@
|
|||
drop table episode_actions;
|
||||
|
||||
drop table subscriptions;
|
||||
drop table device_subscriptions;
|
||||
|
||||
drop table devices;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ create table device_subscriptions (
|
|||
|
||||
podcast_url text not null,
|
||||
|
||||
time_changed bigint not null default 0,
|
||||
time_changed bigint not null,
|
||||
deleted boolean not null default false,
|
||||
|
||||
unique (device_id, podcast_url)
|
||||
|
|
@ -55,6 +55,8 @@ create table episode_actions (
|
|||
podcast_url text not null,
|
||||
episode_url text not null,
|
||||
|
||||
time_changed bigint not null,
|
||||
|
||||
timestamp bigint,
|
||||
action text not null,
|
||||
started integer,
|
||||
|
|
@ -62,10 +64,10 @@ create table episode_actions (
|
|||
total integer,
|
||||
|
||||
-- Position should be set if the action type is "Play" and null otherwise
|
||||
check ((action = "Play") = (position is not null)),
|
||||
check ((action = "play") = (position is not null)),
|
||||
|
||||
-- Started and position can only be set if the action type is "Play"
|
||||
check (action = "Play" or (started is null and position is null)),
|
||||
check (action = "play" or (started is null and position is null)),
|
||||
|
||||
-- Started and position should be provided together
|
||||
check ((started is null) = (total is null))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue