summaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-23 13:51:50 +0100
committerAndrew Dolgov <[email protected]>2005-11-23 13:51:50 +0100
commit81dde650b6eea3c8623e3b173d8e9bc93a69f616 (patch)
treefd9de7f885c9fcad76d04d2c3e1888dad0b54153 /schema
parent30a49c9227c0230093829646d6dc52c1fdf512dc (diff)
fix table drop order in schema
Diffstat (limited to 'schema')
-rw-r--r--schema/ttrss_schema_mysql.sql28
-rw-r--r--schema/ttrss_schema_pgsql.sql28
2 files changed, 18 insertions, 38 deletions
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql
index 44cfbf571..9c5f97186 100644
--- a/schema/ttrss_schema_mysql.sql
+++ b/schema/ttrss_schema_mysql.sql
@@ -1,16 +1,17 @@
+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,
@@ -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 cd1ea5506..d761576c1 100644
--- a/schema/ttrss_schema_pgsql.sql
+++ b/schema/ttrss_schema_pgsql.sql
@@ -1,16 +1,17 @@
+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,
@@ -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);