updated mysql schema
This commit is contained in:
parent
b6eefba52b
commit
4b3dff6ed5
20
backend.php
20
backend.php
|
@ -686,7 +686,7 @@
|
||||||
$filter_id = db_escape_string($_GET["id"]);
|
$filter_id = db_escape_string($_GET["id"]);
|
||||||
|
|
||||||
$result = db_query($link, "UPDATE ttrss_filters SET
|
$result = db_query($link, "UPDATE ttrss_filters SET
|
||||||
regexp = '$regexp',
|
reg_exp = '$regexp',
|
||||||
description = '$descr',
|
description = '$descr',
|
||||||
filter_type = (SELECT id FROM ttrss_filter_types WHERE
|
filter_type = (SELECT id FROM ttrss_filter_types WHERE
|
||||||
description = '$match')
|
description = '$match')
|
||||||
|
@ -710,11 +710,11 @@
|
||||||
|
|
||||||
if (!WEB_DEMO_MODE) {
|
if (!WEB_DEMO_MODE) {
|
||||||
|
|
||||||
$regexp = db_escape_string($_GET["regexp"]);
|
$regexp = db_escape_string($_GET["reg_exp"]);
|
||||||
$match = db_escape_string($_GET["match"]);
|
$match = db_escape_string($_GET["match"]);
|
||||||
|
|
||||||
$result = db_query($link,
|
$result = db_query($link,
|
||||||
"INSERT INTO ttrss_filters (regexp,filter_type) VALUES
|
"INSERT INTO ttrss_filters (reg_exp,filter_type) VALUES
|
||||||
('$regexp', (SELECT id FROM ttrss_filter_types WHERE
|
('$regexp', (SELECT id FROM ttrss_filter_types WHERE
|
||||||
description = '$match'))");
|
description = '$match'))");
|
||||||
}
|
}
|
||||||
|
@ -739,13 +739,13 @@
|
||||||
</table>";
|
</table>";
|
||||||
|
|
||||||
$result = db_query($link, "SELECT
|
$result = db_query($link, "SELECT
|
||||||
id,regexp,description,
|
id,reg_exp,description,
|
||||||
(SELECT name FROM ttrss_filter_types WHERE
|
(SELECT name FROM ttrss_filter_types WHERE
|
||||||
id = filter_type) as filter_type_name,
|
id = filter_type) as filter_type_name,
|
||||||
(SELECT description FROM ttrss_filter_types
|
(SELECT description FROM ttrss_filter_types
|
||||||
WHERE id = filter_type) as filter_type_descr
|
WHERE id = filter_type) as filter_type_descr
|
||||||
FROM
|
FROM
|
||||||
ttrss_filters ORDER by regexp");
|
ttrss_filters ORDER by reg_exp");
|
||||||
|
|
||||||
print "<p><table width=\"100%\" class=\"prefFilterList\" id=\"prefFilterList\">";
|
print "<p><table width=\"100%\" class=\"prefFilterList\" id=\"prefFilterList\">";
|
||||||
|
|
||||||
|
@ -768,7 +768,7 @@
|
||||||
|
|
||||||
print "<tr class=\"$class\" id=\"FILRR-$filter_id\">";
|
print "<tr class=\"$class\" id=\"FILRR-$filter_id\">";
|
||||||
|
|
||||||
$line["regexp"] = htmlspecialchars($line["regexp"]);
|
$line["regexp"] = htmlspecialchars($line["reg_exp"]);
|
||||||
$line["description"] = htmlspecialchars($line["description"]);
|
$line["description"] = htmlspecialchars($line["description"]);
|
||||||
|
|
||||||
if (!$edit_filter_id || $subop != "edit") {
|
if (!$edit_filter_id || $subop != "edit") {
|
||||||
|
@ -779,7 +779,7 @@
|
||||||
type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
|
type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
$line["regexp"] . "</td>";
|
$line["reg_exp"] . "</td>";
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
|
||||||
$line["description"] . "</td>";
|
$line["description"] . "</td>";
|
||||||
|
@ -793,7 +793,7 @@
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\"
|
print "<td><input disabled=\"true\" type=\"checkbox\"
|
||||||
id=\"FICHK-".$line["id"]."\"></td>";
|
id=\"FICHK-".$line["id"]."\"></td>";
|
||||||
|
|
||||||
print "<td>".$line["regexp"]."</td>";
|
print "<td>".$line["reg_exp"]."</td>";
|
||||||
print "<td>".$line["description"]."</td>";
|
print "<td>".$line["description"]."</td>";
|
||||||
print "<td>".$line["filter_type_descr"]."</td>";
|
print "<td>".$line["filter_type_descr"]."</td>";
|
||||||
|
|
||||||
|
@ -801,7 +801,7 @@
|
||||||
|
|
||||||
print "<td><input disabled=\"true\" type=\"checkbox\"></td>";
|
print "<td><input disabled=\"true\" type=\"checkbox\"></td>";
|
||||||
|
|
||||||
print "<td><input id=\"iedit_regexp\" value=\"".$line["regexp"].
|
print "<td><input id=\"iedit_regexp\" value=\"".$line["reg_exp"].
|
||||||
"\"></td>";
|
"\"></td>";
|
||||||
|
|
||||||
print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
|
print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
|
||||||
|
@ -852,5 +852,5 @@
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
pg_close($link);
|
db_close($link);
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -115,14 +115,14 @@
|
||||||
|
|
||||||
$filters = array();
|
$filters = array();
|
||||||
|
|
||||||
$result = db_query($link, "SELECT regexp,
|
$result = db_query($link, "SELECT reg_exp,
|
||||||
(SELECT name FROM ttrss_filter_types
|
(SELECT name FROM ttrss_filter_types
|
||||||
WHERE id = filter_type) as name
|
WHERE id = filter_type) as name
|
||||||
FROM ttrss_filters");
|
FROM ttrss_filters");
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
while ($line = db_fetch_assoc($result)) {
|
||||||
if (!$filters[$line["name"]]) $filters[$line["name"]] = array();
|
if (!$filters[$line["name"]]) $filters[$line["name"]] = array();
|
||||||
array_push($filters[$line["name"]], $line["regexp"]);
|
array_push($filters[$line["name"]], $line["reg_exp"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($rss->items as $item) {
|
foreach ($rss->items as $item) {
|
||||||
|
|
|
@ -56,6 +56,6 @@ insert into ttrss_filter_types (id,name,description) values (3, 'both',
|
||||||
|
|
||||||
create table ttrss_filters (id serial primary key,
|
create table ttrss_filters (id serial primary key,
|
||||||
filter_type integer not null references ttrss_filter_types(id),
|
filter_type integer not null references ttrss_filter_types(id),
|
||||||
regexp varchar(250) not null,
|
reg_exp varchar(250) not null,
|
||||||
description varchar(250) not null default '');
|
description varchar(250) not null default '');
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
|
||||||
title varchar(200) not null unique,
|
title varchar(200) not null unique,
|
||||||
feed_url varchar(250) unique not null,
|
feed_url varchar(250) unique not null,
|
||||||
icon_url varchar(250) not null default '',
|
icon_url varchar(250) not null default '',
|
||||||
last_updated timestamp default null);
|
last_updated timestamp default null) TYPE=InnoDB;
|
||||||
|
|
||||||
alter table ttrss_feeds ENGINE=InnoDB;
|
|
||||||
|
|
||||||
insert into ttrss_feeds (title,feed_url) values ('Footnotes', 'http://gnomedesktop.org/node/feed');
|
insert into ttrss_feeds (title,feed_url) values ('Footnotes', 'http://gnomedesktop.org/node/feed');
|
||||||
insert into ttrss_feeds (title,feed_url) values ('Freedesktop.org', 'http://planet.freedesktop.org/rss20.xml');
|
insert into ttrss_feeds (title,feed_url) values ('Freedesktop.org', 'http://planet.freedesktop.org/rss20.xml');
|
||||||
|
@ -30,7 +28,7 @@ insert into ttrss_feeds (title,feed_url) values ('Technocrat.net',
|
||||||
'http://syndication.technocrat.net/rss');
|
'http://syndication.technocrat.net/rss');
|
||||||
|
|
||||||
create table ttrss_entries (id integer not null primary key auto_increment,
|
create table ttrss_entries (id integer not null primary key auto_increment,
|
||||||
feed_id int id not null,
|
feed_id integer not null,
|
||||||
updated timestamp not null,
|
updated timestamp not null,
|
||||||
title varchar(250) not null,
|
title varchar(250) not null,
|
||||||
guid varchar(250) not null unique,
|
guid varchar(250) not null unique,
|
||||||
|
@ -38,32 +36,28 @@ create table ttrss_entries (id integer not null primary key auto_increment,
|
||||||
content text not null,
|
content text not null,
|
||||||
content_hash varchar(250) not null,
|
content_hash varchar(250) not null,
|
||||||
last_read timestamp,
|
last_read timestamp,
|
||||||
marked boolean not null default 'false',
|
marked bool not null default 'false',
|
||||||
date_entered timestamp not null,
|
date_entered timestamp not null,
|
||||||
no_orig_date boolean not null default 'false',
|
no_orig_date bool not null default 'false',
|
||||||
comments varchar(250) not null default '',
|
comments varchar(250) not null default '',
|
||||||
unread boolean not null default true);
|
unread bool not null default 'true') TYPE=InnoDB;
|
||||||
|
|
||||||
alter table ttrss_entries ENGINE=InnoDB;
|
|
||||||
|
|
||||||
drop table if exists ttrss_filters;
|
drop table if exists ttrss_filters;
|
||||||
drop table if exists ttrss_filter_types;
|
drop table if exists ttrss_filter_types;
|
||||||
|
|
||||||
create table ttrss_filter_types (id integer primary key,
|
create table ttrss_filter_types (id integer primary key,
|
||||||
name varchar(120) unique not null,
|
name varchar(120) unique not null,
|
||||||
description varchar(250) not null unique);
|
description varchar(250) not null unique) TYPE=InnoDB;
|
||||||
|
|
||||||
alter table ttrss_filter_types ENGINE=InnoDB;
|
|
||||||
|
|
||||||
insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title');
|
insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title');
|
||||||
insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content');
|
insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content');
|
||||||
insert into ttrss_filter_types (id,name,description) values (3, 'both',
|
insert into ttrss_filter_types (id,name,description) values (3, 'both',
|
||||||
'Title or Content');
|
'Title or Content');
|
||||||
|
|
||||||
create table ttrss_filters (id serial primary key,
|
create table ttrss_filters (id integer primary key auto_increment,
|
||||||
filter_type integer not null,
|
filter_type integer not null,
|
||||||
regexp varchar(250) not null,
|
reg_exp varchar(250) not null,
|
||||||
description varchar(250) not null default '');
|
description varchar(250) not null default '') TYPE=InnoDB;
|
||||||
|
|
||||||
alter table ttrss_filters ENGINE=InnoDB;
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue