+drop table if exists ttrss_version;
+drop table if exists ttrss_labels;
+drop table if exists ttrss_filters;
+drop table if exists ttrss_filter_types;
+drop table if exists ttrss_user_prefs;
+drop table if exists ttrss_prefs;
+drop table if exists ttrss_prefs_types;
+drop table if exists ttrss_prefs_sections;
drop table if exists ttrss_tags;
-
-drop table if exists ttrss_user_entries;
drop table if exists ttrss_entry_comments;
+drop table if exists ttrss_user_entries;
drop table if exists ttrss_entries;
-
drop table if exists ttrss_feeds;
-drop table if exists ttrss_labels;
-drop table if exists ttrss_filters;
drop table if exists ttrss_feed_categories;
-drop table if exists ttrss_feeds;
-
-drop table if exists ttrss_user_prefs;
drop table if exists ttrss_users;
create table ttrss_users (id integer primary key not null auto_increment,
index (owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) 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) TYPE=InnoDB;
index (feed_id),
foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE) TYPE=InnoDB;
-drop table if exists ttrss_labels;
-
create table ttrss_labels (id integer not null primary key auto_increment,
owner_uid integer not null,
sql_exp varchar(250) not null,
index (owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB;
-drop table if exists ttrss_version;
-
create table ttrss_version (schema_version int not null) TYPE=InnoDB;
insert into ttrss_version values (2);
-drop table if exists ttrss_prefs;
-drop table if exists ttrss_prefs_types;
-drop table if exists ttrss_prefs_sections;
-
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null) TYPE=InnoDB;
+drop table ttrss_version;
+drop table ttrss_labels;
+drop table ttrss_filters;
+drop table ttrss_filter_types;
+drop table ttrss_user_prefs;
+drop table ttrss_prefs;
+drop table ttrss_prefs_types;
+drop table ttrss_prefs_sections;
drop table ttrss_tags;
-
-drop table ttrss_user_entries;
drop table ttrss_entry_comments;
+drop table ttrss_user_entries;
drop table ttrss_entries;
-
drop table ttrss_feeds;
-drop table ttrss_labels;
-drop table ttrss_filters;
drop table ttrss_feed_categories;
-drop table ttrss_feeds;
-
-drop table ttrss_user_prefs;
drop table ttrss_users;
create table ttrss_users (id serial not null primary key,
create index ttrss_entry_comments_ref_id_index on ttrss_entry_comments(ref_id);
create index ttrss_entry_comments_owner_uid_index on ttrss_entry_comments(owner_uid);
-drop table ttrss_filters;
-drop table ttrss_filter_types;
-
create table ttrss_filter_types (id integer not null primary key,
name varchar(120) unique not null,
description varchar(250) not null unique);
reg_exp varchar(250) not null,
description varchar(250) not null default '');
-drop table ttrss_labels;
-
create table ttrss_labels (id serial not null primary key,
owner_uid integer not null references ttrss_users(id) on delete cascade,
sql_exp varchar(250) not null,
create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid);
-drop table ttrss_version;
-
create table ttrss_version (schema_version int not null);
insert into ttrss_version values (2);
-drop table ttrss_prefs;
-drop table ttrss_prefs_types;
-drop table ttrss_prefs_sections;
-
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null);