Improved 'is new' postgres function to deal with skipped batch IDs.
This commit is contained in:
parent
ff384fb734
commit
3fba2d8a77
|
@ -248,7 +248,7 @@ export default {
|
|||
}
|
||||
|
||||
.date {
|
||||
&.upcoming:before {
|
||||
&.new:before {
|
||||
content: '';
|
||||
background: var(--primary);
|
||||
width: .5rem;
|
||||
|
@ -258,10 +258,6 @@ export default {
|
|||
bottom: 0;
|
||||
left: -.5rem;
|
||||
}
|
||||
|
||||
&.new {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.site {
|
||||
|
|
|
@ -803,7 +803,7 @@ exports.up = knex => Promise.resolve()
|
|||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION releases_is_new(release releases) RETURNS boolean AS $$
|
||||
SELECT NOT EXISTS(SELECT true FROM batches WHERE batches.id = release.created_batch_id + 1 LIMIT 1);
|
||||
SELECT EXISTS(SELECT true WHERE (SELECT id FROM batches ORDER BY created_at DESC LIMIT 1) = release.created_batch_id);
|
||||
$$ LANGUAGE sql STABLE;
|
||||
|
||||
CREATE VIEW movie_actors AS
|
||||
|
|
Loading…
Reference in New Issue