aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2005-10-19 18:00:10 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2005-10-19 18:00:10 +0000
commitb873b37607762868580bdd21b9c90f05db168921 (patch)
treeb759644207a9579a9969a36812d6e8417df45485 /phpBB/install
parent719763dec21c431b41adb8855f6fc4cd007b418b (diff)
downloadforums-b873b37607762868580bdd21b9c90f05db168921.tar
forums-b873b37607762868580bdd21b9c90f05db168921.tar.gz
forums-b873b37607762868580bdd21b9c90f05db168921.tar.bz2
forums-b873b37607762868580bdd21b9c90f05db168921.tar.xz
forums-b873b37607762868580bdd21b9c90f05db168921.zip
- updated topic tracking code
- additional changes (mostly bugfixes) - bart, if you update your user table with the user_lastmark field, set it to the user_lastvisit value ;) - and last but not least, introducing some bugs in ucp main front (regarding topic tracking) git-svn-id: file:///svn/phpbb/trunk@5272 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/schemas/firebird_schema.sql20
-rw-r--r--phpBB/install/schemas/mssql_schema.sql28
-rw-r--r--phpBB/install/schemas/mysql_schema.sql11
-rw-r--r--phpBB/install/schemas/oracle_schema.sql16
-rw-r--r--phpBB/install/schemas/postgres_schema.sql16
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql12
6 files changed, 95 insertions, 8 deletions
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 8873ade3d6..74e5dbef8f 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -708,10 +708,16 @@ CREATE TABLE phpbb_topics_marking (
user_id INTEGER DEFAULT 0 NOT NULL,
topic_id INTEGER DEFAULT 0 NOT NULL,
forum_id INTEGER DEFAULT 0 NOT NULL,
- mark_type INTEGER DEFAULT 0 NOT NULL,
mark_time INTEGER DEFAULT 0 NOT NULL
);;
+# phpbb_topics_posted
+CREATE TABLE phpbb_topics_posted (
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ topic_posted INTEGER DEFAULT 0 NOT NULL
+);;
+
# phpbb_topics_watch
CREATE TABLE phpbb_topics_watch (
topic_id INTEGER DEFAULT 0 NOT NULL,
@@ -742,6 +748,7 @@ CREATE TABLE phpbb_users (
user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL,
user_birthday VARCHAR(10) NOT NULL,
user_lastvisit INTEGER DEFAULT 0 NOT NULL,
+ user_lastmark INTEGER DEFAULT 0 NOT NULL,
user_lastpost_time INTEGER DEFAULT 0 NOT NULL,
user_lastpage VARCHAR(100) NOT NULL,
user_last_confirm_key VARCHAR(10) NOT NULL,
@@ -1376,6 +1383,17 @@ ADD PRIMARY KEY (
topic_id
);;
+CREATE INDEX forum_idtp
+ON phpbb_topics_marking(
+ forum_id
+);;
+
+ALTER TABLE phpbb_topics_posted
+ADD PRIMARY KEY (
+ user_id,
+ topic_id
+);;
+
CREATE INDEX notify_status71
ON phpbb_topics_watch(
notify_status
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index ac13607e3b..74a8b3be0c 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -713,11 +713,17 @@ CREATE TABLE [phpbb_topics_marking] (
[user_id] [int] NOT NULL ,
[topic_id] [int] NOT NULL ,
[forum_id] [int] NOT NULL ,
- [mark_type] [int] NOT NULL ,
[mark_time] [int] NOT NULL
) ON [PRIMARY]
GO
+CREATE TABLE [phpbb_topics_posted] (
+ [user_id] [int] NOT NULL ,
+ [topic_id] [int] NOT NULL ,
+ [topic_posted] [int] NOT NULL
+) ON [PRIMARY]
+GO
+
CREATE TABLE [phpbb_topics_watch] (
[topic_id] [int] NOT NULL ,
[user_id] [int] NOT NULL ,
@@ -747,6 +753,7 @@ CREATE TABLE [phpbb_users] (
[user_email_hash] [float] NOT NULL ,
[user_birthday] [varchar] (10) NOT NULL ,
[user_lastvisit] [int] NOT NULL ,
+ [user_lastmark] [int] NOT NULL ,
[user_lastpost_time] [int] NOT NULL ,
[user_lastpage] [varchar] (100) NOT NULL ,
[user_last_confirm_key] [varchar] (10) NOT NULL ,
@@ -1140,6 +1147,14 @@ ALTER TABLE [phpbb_topics_marking] WITH NOCHECK ADD
) ON [PRIMARY]
GO
+ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_topics_posted] PRIMARY KEY CLUSTERED
+ (
+ [user_id],
+ [topic_id]
+ ) ON [PRIMARY]
+GO
+
ALTER TABLE [phpbb_users] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_users] PRIMARY KEY CLUSTERED
(
@@ -1552,10 +1567,15 @@ ALTER TABLE [phpbb_topics_marking] WITH NOCHECK ADD
CONSTRAINT [DF_tmarki_user_id] DEFAULT (0) FOR [user_id],
CONSTRAINT [DF_tmarki_topic_id] DEFAULT (0) FOR [topic_id],
CONSTRAINT [DF_tmarki_forum_id] DEFAULT (0) FOR [forum_id],
- CONSTRAINT [DF_tmarki_mark_type] DEFAULT (0) FOR [mark_type],
CONSTRAINT [DF_tmarki_mark_time] DEFAULT (0) FOR [mark_time]
GO
+ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD
+ CONSTRAINT [DF_tposte_user_id] DEFAULT (0) FOR [user_id],
+ CONSTRAINT [DF_tposte_topic_id] DEFAULT (0) FOR [topic_id],
+ CONSTRAINT [DF_tposte_topic_posted] DEFAULT (0) FOR [topic_posted]
+GO
+
ALTER TABLE [phpbb_topics_watch] WITH NOCHECK ADD
CONSTRAINT [DF_twatch_topic_id] DEFAULT (0) FOR [topic_id],
CONSTRAINT [DF_twatch_user_id] DEFAULT (0) FOR [user_id],
@@ -1575,6 +1595,7 @@ ALTER TABLE [phpbb_users] WITH NOCHECK ADD
CONSTRAINT [DF_users__user_passchg] DEFAULT (0) FOR [user_passchg],
CONSTRAINT [DF_users__user_email_hash] DEFAULT (0) FOR [user_email_hash],
CONSTRAINT [DF_users__user_lastvisit] DEFAULT (0) FOR [user_lastvisit],
+ CONSTRAINT [DF_users__user_lastmark] DEFAULT (0) FOR [user_lastmark],
CONSTRAINT [DF_users__user_lastpost_time] DEFAULT (0) FOR [user_lastpost_time],
CONSTRAINT [DF_users__user_warnings] DEFAULT (0) FOR [user_warnings],
CONSTRAINT [DF_users__user_posts] DEFAULT (0) FOR [user_posts],
@@ -1833,6 +1854,9 @@ GO
CREATE INDEX [topic_last_post_time] ON [phpbb_topics]([topic_last_post_time]) ON [PRIMARY]
GO
+CREATE INDEX [forum_id] ON [phpbb_topics_marking]([forum_id]) ON [PRIMARY]
+GO
+
CREATE INDEX [topic_id] ON [phpbb_topics_watch]([topic_id]) ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql
index cec502c424..f7e5fea293 100644
--- a/phpBB/install/schemas/mysql_schema.sql
+++ b/phpBB/install/schemas/mysql_schema.sql
@@ -821,8 +821,16 @@ CREATE TABLE phpbb_topics_marking (
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_type tinyint(4) DEFAULT '0' NOT NULL,
mark_time int(11) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, topic_id),
+ KEY forum_id (forum_id)
+);
+
+# Table: 'phpbb_topic_posted'
+CREATE TABLE phpbb_topics_posted (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_posted tinyint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id, topic_id)
);
@@ -862,6 +870,7 @@ CREATE TABLE phpbb_users (
user_email_hash bigint(20) DEFAULT '0' NOT NULL,
user_birthday varchar(10) DEFAULT '' NOT NULL,
user_lastvisit int(11) DEFAULT '0' NOT NULL,
+ user_lastmark int(11) DEFAULT '0' NOT NULL,
user_lastpost_time int(11) DEFAULT '0' NOT NULL,
user_lastpage varchar(100) DEFAULT '' NOT NULL,
user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 8add2daeb1..5b9f14baea 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1578,12 +1578,25 @@ CREATE TABLE phpbb_topics_marking (
user_id number(8) DEFAULT '0' NOT NULL,
topic_id number(8) DEFAULT '0' NOT NULL,
forum_id number(8) DEFAULT '0' NOT NULL,
- mark_type number(4) DEFAULT '0' NOT NULL,
mark_time number(11) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_topics_marking PRIMARY KEY (user_id, topic_id)
)
/
+CREATE INDEX forum_id06 on phpbb_topics_marking (forum_id)
+/
+
+/*
+ Table: phpbb_topics_posted
+*/
+CREATE TABLE phpbb_topics_posted (
+ user_id number(8) DEFAULT '0' NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ topic_posted number(4) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_topics_posted PRIMARY KEY (user_id, topic_id)
+)
+/
+
/*
Table: phpbb_topics_watch
*/
@@ -1636,6 +1649,7 @@ CREATE TABLE phpbb_users (
user_email_hash number(20) DEFAULT '0' NOT NULL,
user_birthday varchar2(10) DEFAULT '',
user_lastvisit number(11) DEFAULT '0' NOT NULL,
+ user_lastmark number(11) DEFAULT '0' NOT NULL,
user_lastpost_time number(11) DEFAULT '0' NOT NULL,
user_lastpage varchar2(100) DEFAULT '',
user_last_confirm_key varchar2(10) DEFAULT '',
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 9f7e4c4493..805001e2fc 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -1094,12 +1094,11 @@ CREATE INDEX topic_last_post_time_phpbb_topics_index ON phpbb_topics (topic_last
SELECT SETVAL('phpbb_topics_topic_id_seq',(select case when max(topic_id)>0 then max(topic_id)+1 else 1 end from phpbb_topics));
-/* Table: phpbb_topic_marking */
+/* Table: phpbb_topics_marking */
CREATE TABLE phpbb_topics_marking (
user_id INT4 DEFAULT '0' NOT NULL,
topic_id INT4 DEFAULT '0' NOT NULL,
forum_id INT4 DEFAULT '0' NOT NULL,
- mark_type INT2 DEFAULT '0' NOT NULL,
mark_time INT4 DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id,topic_id),
CHECK (user_id>=0),
@@ -1107,6 +1106,18 @@ CREATE TABLE phpbb_topics_marking (
CHECK (forum_id>=0)
);
+CREATE INDEX forum_id_phpbb_topics_marking_index ON phpbb_topics_marking (forum_id);
+
+/* Table: phpbb_topics_posted */
+CREATE TABLE phpbb_topics_posted (
+ user_id INT4 DEFAULT '0' NOT NULL,
+ topic_id INT4 DEFAULT '0' NOT NULL,
+ topic_posted INT2 DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id,topic_id),
+ CHECK (user_id>=0),
+ CHECK (topic_id>=0)
+);
+
/* Table: phpbb_topics_watch */
CREATE TABLE phpbb_topics_watch (
topic_id INT4 DEFAULT '0' NOT NULL,
@@ -1147,6 +1158,7 @@ CREATE TABLE phpbb_users (
user_email_hash INT8 DEFAULT '0' NOT NULL,
user_birthday varchar(10) DEFAULT '' NOT NULL,
user_lastvisit INT4 DEFAULT '0' NOT NULL,
+ user_lastmark INT4 DEFAULT '0' NOT NULL,
user_lastpost_time INT4 DEFAULT '0' NOT NULL,
user_lastpage varchar(100) DEFAULT '' NOT NULL,
user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 906e934646..320d86d8f3 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -823,11 +823,20 @@ CREATE TABLE phpbb_topics_marking (
user_id mediumint(8) NOT NULL DEFAULT '0',
topic_id mediumint(8) NOT NULL DEFAULT '0',
forum_id mediumint(8) NOT NULL DEFAULT '0',
- mark_type tinyint(4) NOT NULL DEFAULT '0',
mark_time int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (user_id, topic_id)
);
+CREATE INDEX forum_id_phpbb_topics_posted on phpbb_topics_posted (forum_id);
+
+# Table: phpbb_topics_posted
+CREATE TABLE phpbb_topics_posted (
+ user_id mediumint(8) NOT NULL DEFAULT '0',
+ topic_id mediumint(8) NOT NULL DEFAULT '0',
+ topic_posted tinyint(4) NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_id, topic_id)
+);
+
# Table: phpbb_topics_watch
CREATE TABLE phpbb_topics_watch (
topic_id mediumint(8) NOT NULL DEFAULT '0',
@@ -866,6 +875,7 @@ CREATE TABLE phpbb_users (
user_email_hash bigint(20) NOT NULL DEFAULT '0',
user_birthday varchar(10) NOT NULL DEFAULT '',
user_lastvisit int(11) NOT NULL DEFAULT '0',
+ user_lastmark int(11) NOT NULL DEFAULT '0',
user_lastpost_time int(11) NOT NULL DEFAULT '0',
user_lastpage varchar(100) NOT NULL DEFAULT '',
user_last_confirm_key varchar(10) NOT NULL DEFAULT '',