mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 09:02:41 +00:00
Fix cleanup tests in PostgreSQL
This commit is contained in:
parent
258be1d54e
commit
15301cd7dc
2 changed files with 6 additions and 2 deletions
|
@ -1219,11 +1219,15 @@ class Database {
|
||||||
"SELECT
|
"SELECT
|
||||||
id, (select count(*) from arsse_subscriptions where feed = arsse_feeds.id) as subs
|
id, (select count(*) from arsse_subscriptions where feed = arsse_feeds.id) as subs
|
||||||
from arsse_feeds where id = ?".
|
from arsse_feeds where id = ?".
|
||||||
|
"), latest_editions(article,edition) as (".
|
||||||
|
"SELECT article,max(id) from arsse_editions group by article".
|
||||||
"), excepted_articles(id,edition) as (".
|
"), excepted_articles(id,edition) as (".
|
||||||
"SELECT
|
"SELECT
|
||||||
arsse_articles.id, (select max(id) from arsse_editions where article = arsse_articles.id) as edition
|
arsse_articles.id as id,
|
||||||
|
latest_editions.edition as edition
|
||||||
from arsse_articles
|
from arsse_articles
|
||||||
join target_feed on arsse_articles.feed = target_feed.id
|
join target_feed on arsse_articles.feed = target_feed.id
|
||||||
|
join latest_editions on arsse_articles.id = latest_editions.article
|
||||||
order by edition desc limit ?".
|
order by edition desc limit ?".
|
||||||
") ".
|
") ".
|
||||||
"DELETE from arsse_articles where
|
"DELETE from arsse_articles where
|
||||||
|
|
|
@ -12,7 +12,7 @@ class PDOStatement extends \JKingWeb\Arsse\Db\AbstractStatement {
|
||||||
const BINDINGS = [
|
const BINDINGS = [
|
||||||
"integer" => "bigint",
|
"integer" => "bigint",
|
||||||
"float" => "decimal",
|
"float" => "decimal",
|
||||||
"datetime" => "timestamp",
|
"datetime" => "timestamp(0) without time zone",
|
||||||
"binary" => "bytea",
|
"binary" => "bytea",
|
||||||
"string" => "text",
|
"string" => "text",
|
||||||
"boolean" => "smallint", // FIXME: using boolean leads to incompatibilities with versions of SQLite bundled prior to PHP 7.3
|
"boolean" => "smallint", // FIXME: using boolean leads to incompatibilities with versions of SQLite bundled prior to PHP 7.3
|
||||||
|
|
Loading…
Reference in a new issue