]> git.wh0rd.org Git - tt-rss.git/commitdiff
updated mysql schema
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 7 Sep 2005 12:42:49 +0000 (13:42 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 7 Sep 2005 12:42:49 +0000 (13:42 +0100)
backend.php
functions.php
ttrss_schema.sql
ttrss_schema_mysql.sql

index affdd47137b187351eb7f9441f16d501184b72e4..82e07e6d75fc694a71ce5ed14efa97e5475b2f39 100644 (file)
                        $filter_id = db_escape_string($_GET["id"]);
                        
                        $result = db_query($link, "UPDATE ttrss_filters SET 
-                               regexp = '$regexp', 
+                               reg_exp = '$regexp', 
                                description = '$descr',
                                filter_type = (SELECT id FROM ttrss_filter_types WHERE
                                        description = '$match')
                
                        if (!WEB_DEMO_MODE) {
 
-                               $regexp = db_escape_string($_GET["regexp"]);
+                               $regexp = db_escape_string($_GET["reg_exp"]);
                                $match = db_escape_string($_GET["match"]);
                                        
                                $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
                                                        description = '$match'))");
                        } 
                </table>";
 
                $result = db_query($link, "SELECT 
-                               id,regexp,description,
+                               id,reg_exp,description,
                                (SELECT name FROM ttrss_filter_types WHERE 
                                        id = filter_type) as filter_type_name,
                                (SELECT description FROM ttrss_filter_types 
                                        WHERE id = filter_type) as filter_type_descr
                        FROM 
-                               ttrss_filters ORDER by regexp");
+                               ttrss_filters ORDER by reg_exp");
 
                print "<p><table width=\"100%\" class=\"prefFilterList\" id=\"prefFilterList\">";
 
 
                        print "<tr class=\"$class\" id=\"FILRR-$filter_id\">";
 
-                       $line["regexp"] = htmlspecialchars($line["regexp"]);
+                       $line["regexp"] = htmlspecialchars($line["reg_exp"]);
                        $line["description"] = htmlspecialchars($line["description"]);
 
                        if (!$edit_filter_id || $subop != "edit") {
                                type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
 
                                print "<td><a href=\"javascript:editFilter($filter_id);\">" . 
-                                       $line["regexp"] . "</td>";              
+                                       $line["reg_exp"] . "</td>";             
                                        
                                print "<td><a href=\"javascript:editFilter($filter_id);\">" . 
                                        $line["description"] . "</td>";                 
                                print "<td><input disabled=\"true\" type=\"checkbox\" 
                                        id=\"FICHK-".$line["id"]."\"></td>";
 
-                               print "<td>".$line["regexp"]."</td>";           
+                               print "<td>".$line["reg_exp"]."</td>";          
                                print "<td>".$line["description"]."</td>";              
                                print "<td>".$line["filter_type_descr"]."</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>";
 
                                print "<td><input id=\"iedit_descr\" value=\"".$line["description"].
                print "</div>";
        }
 
-       pg_close($link);
+       db_close($link);
 ?>
index 29773603632efd0faae875c84693a064d31f3f21..bea443c2765d283ca445c7f253a549dfc84da8a1 100644 (file)
 
                        $filters = array();
 
-                       $result = db_query($link, "SELECT regexp,
+                       $result = db_query($link, "SELECT reg_exp,
                                (SELECT name FROM ttrss_filter_types
                                        WHERE id = filter_type) as name
                                FROM ttrss_filters");
 
                        while ($line = db_fetch_assoc($result)) {
                                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) {
index 2c00b3687ddc81b4a9815a36cb57ceda32b0c438..95887acb316c372adcf369c4eb2ba2de689a05ed 100644 (file)
@@ -56,6 +56,6 @@ insert into ttrss_filter_types (id,name,description) values (3, 'both',
 
 create table ttrss_filters (id serial primary key, 
        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 '');
 
index 25e0fd63e11ba64c195b60fe3b751b2650504967..91fde947f1808cdef45259fd8a2414f37306c936 100644 (file)
@@ -5,9 +5,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
        title varchar(200) not null unique, 
        feed_url varchar(250) unique not null, 
        icon_url varchar(250) not null default '',
-       last_updated timestamp default null);
-
-alter table ttrss_feeds ENGINE=InnoDB;
+       last_updated timestamp default null) TYPE=InnoDB;
 
 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');
@@ -30,7 +28,7 @@ insert into ttrss_feeds (title,feed_url) values ('Technocrat.net',
        'http://syndication.technocrat.net/rss');
 
 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, 
        title varchar(250) not null, 
        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_hash varchar(250) not null,
        last_read timestamp,
-       marked boolean not null default 'false',
+       marked bool not null default 'false',
        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 '',
-       unread boolean not null default true);
-
-alter table ttrss_entries ENGINE=InnoDB;
+       unread bool not null default 'true') TYPE=InnoDB;
 
 drop table if exists ttrss_filters;
 drop table if exists ttrss_filter_types;
 
 create table ttrss_filter_types (id integer primary key, 
        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 (2, 'content', 'Content');
 insert into ttrss_filter_types (id,name,description) values (3, 'both', 
        '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, 
-       regexp varchar(250) not null,
-       description varchar(250) not null default '');
+       reg_exp varchar(250) not null,
+       description varchar(250) not null default '') TYPE=InnoDB;
 
-alter table ttrss_filters ENGINE=InnoDB;