diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 44cfbf57..9c5f9718 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -1,16 +1,17 @@ -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_entries; - -drop table if exists ttrss_feeds; +drop table if exists ttrss_version; 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_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_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_feed_categories; drop table if exists ttrss_users; create table ttrss_users (id integer primary key not null auto_increment, @@ -88,9 +89,6 @@ create table ttrss_entry_comments (id integer not null primary key, 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; @@ -115,8 +113,6 @@ create table ttrss_filters (id integer not null primary key auto_increment, 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, @@ -139,16 +135,10 @@ create table ttrss_tags (id integer primary key auto_increment, 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; diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index cd1ea550..d761576c 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -1,16 +1,17 @@ -drop table ttrss_tags; - -drop table ttrss_user_entries; -drop table ttrss_entry_comments; -drop table ttrss_entries; - -drop table ttrss_feeds; +drop table ttrss_version; drop table ttrss_labels; drop table ttrss_filters; -drop table ttrss_feed_categories; -drop table ttrss_feeds; - +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_entry_comments; +drop table ttrss_user_entries; +drop table ttrss_entries; +drop table ttrss_feeds; +drop table ttrss_feed_categories; drop table ttrss_users; create table ttrss_users (id serial not null primary key, @@ -84,9 +85,6 @@ create table ttrss_entry_comments (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); @@ -105,8 +103,6 @@ create table ttrss_filters (id serial not null primary key, 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, @@ -127,16 +123,10 @@ create table ttrss_tags (id serial not null primary key, 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);