25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Update SQL schema files

This commit is contained in:
Alexey Shchepin 2023-12-27 17:01:57 +03:00
parent 8d2d3a6540
commit 97568195d6
8 changed files with 48 additions and 0 deletions

View File

@ -106,6 +106,7 @@ CREATE TABLE archive (
id INTEGER PRIMARY KEY AUTOINCREMENT,
kind text,
nick text,
origin_id text,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
@ -113,6 +114,11 @@ CREATE INDEX i_archive_sh_username_timestamp ON archive (server_host, username,
CREATE INDEX i_archive_sh_username_peer ON archive (server_host, username, peer);
CREATE INDEX i_archive_sh_username_bare_peer ON archive (server_host, username, bare_peer);
CREATE INDEX i_archive_sh_timestamp ON archive (server_host, timestamp);
CREATE INDEX i_archive_sh_username_origin_id ON archive (server_host, username, origin_id);
-- To update 'archive' from ejabberd <= 23.10:
-- ALTER TABLE archive ADD COLUMN origin_id text NOT NULL DEFAULT '';
-- CREATE INDEX i_archive_sh_username_origin_id ON archive (server_host, username, origin_id);
CREATE TABLE archive_prefs (
username text NOT NULL,

View File

@ -94,6 +94,7 @@ CREATE TABLE archive (
id INTEGER PRIMARY KEY AUTOINCREMENT,
kind text,
nick text,
origin_id text,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
@ -101,6 +102,11 @@ CREATE INDEX i_username_timestamp ON archive(username, timestamp);
CREATE INDEX i_archive_username_peer ON archive (username, peer);
CREATE INDEX i_archive_username_bare_peer ON archive (username, bare_peer);
CREATE INDEX i_timestamp ON archive(timestamp);
CREATE INDEX i_archive_username_origin_id ON archive (username, origin_id);
-- To update 'archive' from ejabberd <= 23.10:
-- ALTER TABLE archive ADD COLUMN origin_id text NOT NULL DEFAULT '';
-- CREATE INDEX i_archive_username_origin_id ON archive (username, origin_id);
CREATE TABLE archive_prefs (
username text NOT NULL PRIMARY KEY,

View File

@ -32,6 +32,7 @@ CREATE TABLE [dbo].[archive] (
[id] [bigint] IDENTITY(1,1) NOT NULL,
[kind] [varchar] (10) NULL,
[nick] [varchar] (250) NULL,
[origin_id] [varchar] (250) NOT NULL,
[created_at] [datetime] NOT NULL DEFAULT GETDATE(),
CONSTRAINT [archive_PK] PRIMARY KEY CLUSTERED
(
@ -51,6 +52,9 @@ WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW
CREATE INDEX [archive_sh_timestamp] ON [archive] (server_host, timestamp)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
CREATE INDEX [archive_sh_username_origin_id] ON [archive] (server_host, username, origin_id)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
CREATE TABLE [dbo].[archive_prefs] (
[username] [varchar] (250) NOT NULL,
[server_host] [varchar] (250) NOT NULL,

View File

@ -31,6 +31,7 @@ CREATE TABLE [dbo].[archive] (
[id] [bigint] IDENTITY(1,1) NOT NULL,
[kind] [varchar] (10) NULL,
[nick] [varchar] (250) NULL,
[origin_id] [varchar] (250) NOT NULL,
[created_at] [datetime] NOT NULL DEFAULT GETDATE(),
CONSTRAINT [archive_PK] PRIMARY KEY CLUSTERED
(
@ -50,6 +51,9 @@ WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW
CREATE INDEX [archive_timestamp] ON [archive] (timestamp)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
CREATE INDEX [archive_username_origin_id] ON [archive] (username, origin_id)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
CREATE TABLE [dbo].[archive_prefs] (
[username] [varchar] (250) NOT NULL,
[def] [text] NOT NULL,

View File

@ -110,6 +110,7 @@ CREATE TABLE archive (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,
kind varchar(10),
nick varchar(191),
origin_id varchar(191),
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@ -118,6 +119,12 @@ CREATE INDEX i_archive_sh_username_timestamp USING BTREE ON archive(server_host(
CREATE INDEX i_archive_sh_username_peer USING BTREE ON archive(server_host(191), username(191), peer(191));
CREATE INDEX i_archive_sh_username_bare_peer USING BTREE ON archive(server_host(191), username(191), bare_peer(191));
CREATE INDEX i_archive_sh_timestamp USING BTREE ON archive(server_host(191), timestamp);
CREATE INDEX i_archive_sh_username_origin_id USING BTREE ON archive(server_host(191), username(191), origin_id(191));
-- To update 'archive' from ejabberd <= 23.10:
-- ALTER TABLE archive ADD COLUMN origin_id text NOT NULL DEFAULT '';
-- ALTER TABLE archive ALTER COLUMN origin_id DROP DEFAULT;
-- CREATE INDEX i_archive_sh_username_origin_id USING BTREE ON archive(server_host(191), username(191), origin_id(191));
CREATE TABLE archive_prefs (
username varchar(191) NOT NULL,

View File

@ -98,6 +98,7 @@ CREATE TABLE archive (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,
kind varchar(10),
nick varchar(191),
origin_id varchar(191),
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@ -106,6 +107,12 @@ CREATE INDEX i_username_timestamp USING BTREE ON archive(username(191), timestam
CREATE INDEX i_username_peer USING BTREE ON archive(username(191), peer(191));
CREATE INDEX i_username_bare_peer USING BTREE ON archive(username(191), bare_peer(191));
CREATE INDEX i_timestamp USING BTREE ON archive(timestamp);
CREATE INDEX i_archive_username_origin_id USING BTREE ON archive(username(191), origin_id(191));
-- To update 'archive' from ejabberd <= 23.10:
-- ALTER TABLE archive ADD COLUMN origin_id text NOT NULL DEFAULT '';
-- ALTER TABLE archive ALTER COLUMN origin_id DROP DEFAULT;
-- CREATE INDEX i_archive_username_origin_id USING BTREE ON archive(username(191), origin_id(191));
CREATE TABLE archive_prefs (
username varchar(191) NOT NULL PRIMARY KEY,

View File

@ -261,6 +261,7 @@ CREATE TABLE archive (
id BIGSERIAL,
kind text,
nick text,
origin_id text,
created_at TIMESTAMP NOT NULL DEFAULT now()
);
@ -268,6 +269,12 @@ CREATE INDEX i_archive_sh_username_timestamp ON archive USING btree (server_host
CREATE INDEX i_archive_sh_username_peer ON archive USING btree (server_host, username, peer);
CREATE INDEX i_archive_sh_username_bare_peer ON archive USING btree (server_host, username, bare_peer);
CREATE INDEX i_archive_sh_timestamp ON archive USING btree (server_host, timestamp);
CREATE INDEX i_archive_sh_username_origin_id ON archive USING btree (server_host, username, origin_id);
-- To update 'archive' from ejabberd <= 23.10:
-- ALTER TABLE archive ADD COLUMN origin_id text NOT NULL DEFAULT '';
-- ALTER TABLE archive ALTER COLUMN origin_id DROP DEFAULT;
-- CREATE INDEX i_archive_sh_username_origin_id ON archive USING btree (server_host, username, origin_id);
CREATE TABLE archive_prefs (
username text NOT NULL,

View File

@ -98,6 +98,7 @@ CREATE TABLE archive (
id BIGSERIAL,
kind text,
nick text,
origin_id text,
created_at TIMESTAMP NOT NULL DEFAULT now()
);
@ -105,6 +106,12 @@ CREATE INDEX i_username_timestamp ON archive USING btree (username, timestamp);
CREATE INDEX i_username_peer ON archive USING btree (username, peer);
CREATE INDEX i_username_bare_peer ON archive USING btree (username, bare_peer);
CREATE INDEX i_timestamp ON archive USING btree (timestamp);
CREATE INDEX i_archive_username_origin_id ON archive USING btree (username, origin_id);
-- To update 'archive' from ejabberd <= 23.10:
-- ALTER TABLE archive ADD COLUMN origin_id text NOT NULL DEFAULT '';
-- ALTER TABLE archive ALTER COLUMN origin_id DROP DEFAULT;
-- CREATE INDEX i_archive_username_origin_id ON archive USING btree (username, origin_id);
CREATE TABLE archive_prefs (
username text NOT NULL PRIMARY KEY,