Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion distribution/src/database/openfire_db2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,35 @@ CREATE TABLE ofPubsubDefaultConf (
CONSTRAINT ofPubsubDefConf_pk PRIMARY KEY (serviceID, leaf)
);

CREATE TABLE ofSpamReport (
reportID BIGINT NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin INTEGER NOT NULL,
thirdParty INTEGER NOT NULL,
created BIGINT NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the db2 has the TIMESTAMP type. In other places of the file used char for date, which it very strange

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(as above: we currently never use a TIMESTAMP field, which is certainly something I'd like to improve on. If we do improve on that, we should do it consistently, everywhere).

context LONG VARCHAR NULL,
CONSTRAINT ofSpamReport PRIMARY KEY (reportID)
);
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter);
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported);

CREATE TABLE ofSpamStanza (
reportID INTEGER NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza LONG VARCHAR NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

-- Finally, insert default table values
INSERT INTO ofID (idType, id) VALUES (18, 1);
INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);
INSERT INTO ofID (idType, id) VALUES (42, 1);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand All @@ -403,4 +426,4 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);

-- Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38);
25 changes: 24 additions & 1 deletion distribution/src/database/openfire_hsqldb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,36 @@ CREATE TABLE ofPubsubDefaultConf (
CONSTRAINT ofPubsubDefaultConf_pk PRIMARY KEY (serviceID, leaf)
);

CREATE TABLE ofSpamReport (
reportID BIGINT NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin INTEGER NOT NULL,
thirdParty INTEGER NOT NULL,
created BIGINT NOT NULL,
context LONGVARCHAR NULL,
CONSTRAINT ofSpamReport PRIMARY KEY (reportID)
);
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter);
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported);

CREATE TABLE ofSpamStanza (
reportID BIGINT NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza LONGVARCHAR NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

// Finally, insert default table values.

INSERT INTO ofID (idType, id) VALUES (18, 1);
INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);
INSERT INTO ofID (idType, id) VALUES (42, 1);

// Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand All @@ -391,7 +414,7 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);

// Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38);

// The value is the size in megabytes that the .log file can reach before an automatic
// checkpoint occurs. A checkpoint rewrites the .script file and clears the .log file
Expand Down
25 changes: 24 additions & 1 deletion distribution/src/database/openfire_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,36 @@ CREATE TABLE ofPubsubDefaultConf (
PRIMARY KEY (serviceID, leaf)
);

CREATE TABLE ofSpamReport (
reportID BIGINT NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin TINYINT NOT NULL,
thirdParty TINYINT NOT NULL,
created BIGINT NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may use timestamp

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, but not for now: We've had trouble before finding a consistent way to represent a timestamp in all of the databases that we support, which is why we use a number instead. I'm not sure if this is still as impossible as it was in 2004, by the way, but I'd like Openfire to be consistent.

If we do change number for timestamp (which would be a good thing), we should do it for all columns that currently use a number.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good. If the migration is anyway planed and you know how it will be implemented, then for the new code it may better to start using it. Just my 2c.

context TEXT NULL,
PRIMARY KEY (reportID),
INDEX ofSpamReport_created_reporter_id (created, reporter),
INDEX ofSpamReport_created_reported_id (created, reported)
);

CREATE TABLE ofSpamStanza (
reportID BIGINT NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza TEXT NULL,
INDEX ofSpamStanza_reportID (reportID)
);

# Finally, insert default table values.

INSERT INTO ofID (idType, id) VALUES (18, 1);
INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);
INSERT INTO ofID (idType, id) VALUES (42, 1);

# Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand All @@ -381,4 +404,4 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);

# Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38);
25 changes: 24 additions & 1 deletion distribution/src/database/openfire_oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,36 @@ CREATE TABLE ofPubsubDefaultConf (
CONSTRAINT ofPubsubDefaultConf_pk PRIMARY KEY (serviceID, leaf)
);

CREATE TABLE ofSpamReport (
reportID INTEGER NOT NULL,
reporter VARCHAR2(1024) NOT NULL,
reported VARCHAR2(1024) NOT NULL,
reason VARCHAR2(255) NOT NULL,
reportOrigin INTEGER NOT NULL,
thirdParty INTEGER NOT NULL,
created INTEGER NOT NULL,
context CLOB NULL,
CONSTRAINT ofSpamReport_pk PRIMARY KEY (reportID)
);
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter);
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported);

CREATE TABLE ofSpamStanza (
reportID INTEGER NOT NULL,
stanzaIDValue VARCHAR2(1024) NOT NULL,
stanzaIDBy VARCHAR2(1024) NOT NULL,
stanza CLOB NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

-- Finally, insert default table values.

INSERT INTO ofID (idType, id) VALUES (18, 1);
INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);
INSERT INTO ofID (idType, id) VALUES (42, 1);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand All @@ -389,6 +412,6 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);

-- Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38);

commit;
25 changes: 24 additions & 1 deletion distribution/src/database/openfire_postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,36 @@ CREATE TABLE ofPubsubDefaultConf (
CONSTRAINT ofPubsubDefaultConf_pk PRIMARY KEY (serviceID, leaf)
);

CREATE TABLE ofSpamReport (
reportID BIGINT NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin INTEGER NOT NULL,
thirdParty INTEGER NOT NULL,
created BIGINT NOT NULL,
context TEXT NULL,
CONSTRAINT ofSpamReport_pk PRIMARY KEY (reportID)
);
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter);
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported);

CREATE TABLE ofSpamStanza (
reportID BIGINT NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza TEXT NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

-- Finally, insert default table values.

INSERT INTO ofID (idType, id) VALUES (18, 1);
INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);
INSERT INTO ofID (idType, id) VALUES (42, 1);

-- Entry for admin user
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand All @@ -397,4 +420,4 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);

-- Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38);
25 changes: 24 additions & 1 deletion distribution/src/database/openfire_sqlserver.sql
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,36 @@ CREATE TABLE ofPubsubDefaultConf (
CONSTRAINT ofPubsubDefaultConf_pk PRIMARY KEY (serviceID, leaf)
);

CREATE TABLE ofSpamReport (
reportID BIGINT NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin INT NOT NULL,
thirdParty INT NOT NULL,
created BIGINT NOT NULL,
context NVARCHAR(MAX) NULL,
CONSTRAINT ofSpamReport_pk PRIMARY KEY (reportID)
);
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter);
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported);

CREATE TABLE ofSpamStanza (
reportID BIGINT NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza NVARCHAR(MAX) NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

/* Finally, insert default table values. */

INSERT INTO ofID (idType, id) VALUES (18, 1);
INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT INTO ofID (idType, id) VALUES (23, 1);
INSERT INTO ofID (idType, id) VALUES (26, 2);
INSERT INTO ofID (idType, id) VALUES (27, 1);
INSERT INTO ofID (idType, id) VALUES (42, 1);

/* Entry for admin user */
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand All @@ -394,4 +417,4 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);

/* Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully. */
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38);
25 changes: 24 additions & 1 deletion distribution/src/database/openfire_sybase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,36 @@ CREATE TABLE ofPubsubDefaultConf (
CONSTRAINT ofPubsubDefaultConf_pk PRIMARY KEY (serviceID, leaf)
)

CREATE TABLE ofSpamReport (
reportID INT NOT NULL,
reporter NVARCHAR(1024) NOT NULL,
reported NVARCHAR(1024) NOT NULL,
reason NVARCHAR(255) NOT NULL,
reportOrigin INT NOT NULL,
thirdParty INT NOT NULL,
created INT NOT NULL,
context LONG VARCHAR NULL,
CONSTRAINT ofSpamReport_pk PRIMARY KEY (reportID)
)
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter)
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported)

CREATE TABLE ofSpamStanza (
reportID INTEGER NOT NULL,
stanzaIDValue NVARCHAR(1024) NOT NULL,
stanzaIDBy NVARCHAR(1024) NOT NULL,
stanza LONG VARCHAR NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

/* Finally, insert default table values. */

INSERT INTO ofID (idType, id) VALUES (18, 1)
INSERT INTO ofID (idType, id) VALUES (19, 1)
INSERT INTO ofID (idType, id) VALUES (23, 1)
INSERT INTO ofID (idType, id) VALUES (26, 2)
INSERT INTO ofID (idType, id) VALUES (27, 1)
INSERT INTO ofID (idType, id) VALUES (42, 1)

/* Entry for admin user */
INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
Expand All @@ -394,4 +417,4 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0)

/* Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully. */
INSERT INTO ofVersion (name, version) VALUES ('openfire', 37)
INSERT INTO ofVersion (name, version) VALUES ('openfire', 38)
26 changes: 26 additions & 0 deletions distribution/src/database/upgrade/38/openfire_db2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CREATE TABLE ofSpamReport (
reportID INTEGER NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin INTEGER NOT NULL,
thirdParty INTEGER NOT NULL,
created BIGINT NOT NULL,
context LONG VARCHAR NULL,
CONSTRAINT ofSpamReport PRIMARY KEY (reportID)
);

CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter);
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported);

CREATE TABLE ofSpamStanza (
reportID INTEGER NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza LONG VARCHAR NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

INSERT INTO ofID (idType, id) VALUES (42, 1);

UPDATE ofVersion SET version = 38 WHERE name = 'openfire';
25 changes: 25 additions & 0 deletions distribution/src/database/upgrade/38/openfire_hsqldb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CREATE TABLE ofSpamReport (
reportID BIGINT NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin INTEGER NOT NULL,
thirdParty INTEGER NOT NULL,
created BIGINT NOT NULL,
context LONGVARCHAR NULL,
CONSTRAINT ofSpamReport PRIMARY KEY (reportID)
);
CREATE INDEX ofSpamReport_created_reporter_id ON ofSpamReport (created, reporter);
CREATE INDEX ofSpamReport_created_reported_id ON ofSpamReport (created, reported);

CREATE TABLE ofSpamStanza (
reportID BIGINT NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza LONGVARCHAR NULL
);
CREATE INDEX ofSpamStanza_reportID ON ofSpamStanza (reportID);

INSERT INTO ofID (idType, id) VALUES (42, 1);

UPDATE ofVersion SET version = 38 WHERE name = 'openfire';
25 changes: 25 additions & 0 deletions distribution/src/database/upgrade/38/openfire_mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CREATE TABLE ofSpamReport (
reportID BIGINT NOT NULL,
reporter VARCHAR(1024) NOT NULL,
reported VARCHAR(1024) NOT NULL,
reason VARCHAR(255) NOT NULL,
reportOrigin TINYINT NOT NULL,
thirdParty TINYINT NOT NULL,
created BIGINT NOT NULL,
context TEXT NULL,
PRIMARY KEY (reportID),
INDEX ofSpamReport_created_reporter_id (created, reporter),
INDEX ofSpamReport_created_reported_id (created, reported)
);

CREATE TABLE ofSpamStanza (
reportID BIGINT NOT NULL,
stanzaIDValue VARCHAR(1024) NOT NULL,
stanzaIDBy VARCHAR(1024) NOT NULL,
stanza TEXT NULL,
INDEX ofSpamStanza_reportID (reportID)
);

INSERT INTO ofID (idType, id) VALUES (42, 1);

UPDATE ofVersion SET version = 38 WHERE name = 'openfire';
Loading
Loading