change table name to plays
This commit is contained in:
parent
6bf4f507f8
commit
fc71f4cd9d
|
@ -9,7 +9,7 @@ json ->> 'awayTeam',
|
||||||
json ->> 'awayScore',
|
json ->> 'awayScore',
|
||||||
json ->> 'homeTeam',
|
json ->> 'homeTeam',
|
||||||
json ->> 'homeScore'
|
json ->> 'homeScore'
|
||||||
from playinfo
|
from plays
|
||||||
where
|
where
|
||||||
json ->> 'description' is not null and
|
json ->> 'description' is not null and
|
||||||
json ->> 'isScoringPlay' = 1 and
|
json ->> 'isScoringPlay' = 1 and
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
create table if not exists playinfo (
|
create table if not exists plays (
|
||||||
"json" text unique on conflict ignore,
|
"json" text unique on conflict ignore,
|
||||||
"posted" integer check ("posted" in (0, 1))
|
"posted" integer check ("posted" in (0, 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
create index if not exists nonposted_playinfo
|
create index if not exists nonposted_plays
|
||||||
on playinfo(posted)
|
on plays(posted)
|
||||||
where posted = 0;
|
where posted = 0;
|
||||||
|
|
||||||
create table if not exists highlights (
|
create table if not exists highlights (
|
||||||
|
|
|
@ -36,4 +36,4 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jqFilter='{gamePk} + (.gameData.teams | {awayTeam: .away.teamName, homeTeam: .home.teamName}) + (.liveData.plays.allPlays[] | (.result + (.about | {atBatIndex, halfInning, inning, isComplete, isScoringPlay, hasReview})))'
|
jqFilter='{gamePk} + (.gameData.teams | {awayTeam: .away.teamName, homeTeam: .home.teamName}) + (.liveData.plays.allPlays[] | (.result + (.about | {atBatIndex, halfInning, inning, isComplete, isScoringPlay, hasReview})))'
|
||||||
mlblive subscribe -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | writedb.sh -d $db -t playinfo -c ''
|
mlblive subscribe -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | writedb.sh -d $db -t plays -c ''
|
||||||
|
|
Loading…
Reference in New Issue