mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Clean up database code related to mod_vcard_xupdate
This commit is contained in:
parent
1391d5a304
commit
6691c59a7a
@ -116,12 +116,6 @@ CREATE TABLE vcard (
|
|||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE vcard_xupdate (
|
|
||||||
username text PRIMARY KEY,
|
|
||||||
hash text NOT NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE vcard_search (
|
CREATE TABLE vcard_search (
|
||||||
username text NOT NULL,
|
username text NOT NULL,
|
||||||
lusername text PRIMARY KEY,
|
lusername text PRIMARY KEY,
|
||||||
|
@ -470,16 +470,6 @@ WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW
|
|||||||
CREATE INDEX [vcard_search_lorgunit] ON [vcard_search] (lorgunit)
|
CREATE INDEX [vcard_search_lorgunit] ON [vcard_search] (lorgunit)
|
||||||
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
|
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON);
|
||||||
|
|
||||||
CREATE TABLE [dbo].[vcard_xupdate] (
|
|
||||||
[username] [varchar] (250) NOT NULL,
|
|
||||||
[hash] [text] NOT NULL,
|
|
||||||
[created_at] [datetime] NOT NULL DEFAULT GETDATE(),
|
|
||||||
CONSTRAINT [vcard_xupdate_PRIMARY] PRIMARY KEY CLUSTERED
|
|
||||||
(
|
|
||||||
[username] ASC
|
|
||||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
|
||||||
) TEXTIMAGE_ON [PRIMARY];
|
|
||||||
|
|
||||||
ALTER TABLE [dbo].[pubsub_item] WITH CHECK ADD CONSTRAINT [pubsub_item_ibfk_1] FOREIGN KEY([nodeid])
|
ALTER TABLE [dbo].[pubsub_item] WITH CHECK ADD CONSTRAINT [pubsub_item_ibfk_1] FOREIGN KEY([nodeid])
|
||||||
REFERENCES [dbo].[pubsub_node] ([nodeid])
|
REFERENCES [dbo].[pubsub_node] ([nodeid])
|
||||||
ON DELETE CASCADE;
|
ON DELETE CASCADE;
|
||||||
|
@ -121,12 +121,6 @@ CREATE TABLE vcard (
|
|||||||
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||||
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE vcard_xupdate (
|
|
||||||
username varchar(191) PRIMARY KEY,
|
|
||||||
hash text NOT NULL,
|
|
||||||
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
CREATE TABLE vcard_search (
|
CREATE TABLE vcard_search (
|
||||||
username varchar(191) NOT NULL,
|
username varchar(191) NOT NULL,
|
||||||
lusername varchar(191) PRIMARY KEY,
|
lusername varchar(191) PRIMARY KEY,
|
||||||
|
@ -120,12 +120,6 @@ CREATE TABLE vcard (
|
|||||||
created_at TIMESTAMP NOT NULL DEFAULT now()
|
created_at TIMESTAMP NOT NULL DEFAULT now()
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE vcard_xupdate (
|
|
||||||
username text PRIMARY KEY,
|
|
||||||
hash text NOT NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT now()
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE vcard_search (
|
CREATE TABLE vcard_search (
|
||||||
username text NOT NULL,
|
username text NOT NULL,
|
||||||
lusername text PRIMARY KEY,
|
lusername text PRIMARY KEY,
|
||||||
|
@ -1092,7 +1092,7 @@ replace_module(mod_roster_odbc) -> {mod_roster, sql};
|
|||||||
replace_module(mod_shared_roster_odbc) -> {mod_shared_roster, sql};
|
replace_module(mod_shared_roster_odbc) -> {mod_shared_roster, sql};
|
||||||
replace_module(mod_vcard_odbc) -> {mod_vcard, sql};
|
replace_module(mod_vcard_odbc) -> {mod_vcard, sql};
|
||||||
replace_module(mod_vcard_ldap) -> {mod_vcard, ldap};
|
replace_module(mod_vcard_ldap) -> {mod_vcard, ldap};
|
||||||
replace_module(mod_vcard_xupdate_odbc) -> {mod_vcard_xupdate, sql};
|
replace_module(mod_vcard_xupdate_odbc) -> mod_vcard_xupdate;
|
||||||
replace_module(mod_pubsub_odbc) -> {mod_pubsub, sql};
|
replace_module(mod_pubsub_odbc) -> {mod_pubsub, sql};
|
||||||
replace_module(mod_http_bind) -> mod_bosh;
|
replace_module(mod_http_bind) -> mod_bosh;
|
||||||
replace_module(Module) ->
|
replace_module(Module) ->
|
||||||
|
@ -60,8 +60,7 @@ modules() ->
|
|||||||
mod_private,
|
mod_private,
|
||||||
mod_roster,
|
mod_roster,
|
||||||
mod_shared_roster,
|
mod_shared_roster,
|
||||||
mod_vcard,
|
mod_vcard].
|
||||||
mod_vcard_xupdate].
|
|
||||||
|
|
||||||
export(Server, Output) ->
|
export(Server, Output) ->
|
||||||
LServer = jid:nameprep(iolist_to_binary(Server)),
|
LServer = jid:nameprep(iolist_to_binary(Server)),
|
||||||
|
@ -162,6 +162,14 @@ compute_hash(VCard) ->
|
|||||||
%%====================================================================
|
%%====================================================================
|
||||||
%% Options
|
%% Options
|
||||||
%%====================================================================
|
%%====================================================================
|
||||||
|
mod_opt_type(db_type) ->
|
||||||
|
fun(_) ->
|
||||||
|
?WARNING_MSG("option 'db_type' for module '~s' has no effect: "
|
||||||
|
"the module doesn't require database anymore; "
|
||||||
|
"feel free to delete any tables related to the module",
|
||||||
|
[?MODULE]),
|
||||||
|
erlang:error(badarg)
|
||||||
|
end;
|
||||||
mod_opt_type(O) when O == cache_life_time; O == cache_size ->
|
mod_opt_type(O) when O == cache_life_time; O == cache_size ->
|
||||||
fun (I) when is_integer(I), I > 0 -> I;
|
fun (I) when is_integer(I), I > 0 -> I;
|
||||||
(infinity) -> infinity
|
(infinity) -> infinity
|
||||||
@ -169,4 +177,4 @@ mod_opt_type(O) when O == cache_life_time; O == cache_size ->
|
|||||||
mod_opt_type(O) when O == use_cache; O == cache_missed ->
|
mod_opt_type(O) when O == use_cache; O == cache_missed ->
|
||||||
fun (B) when is_boolean(B) -> B end;
|
fun (B) when is_boolean(B) -> B end;
|
||||||
mod_opt_type(_) ->
|
mod_opt_type(_) ->
|
||||||
[cache_life_time, cache_size, use_cache, cache_missed].
|
[db_type, cache_life_time, cache_size, use_cache, cache_missed].
|
||||||
|
Loading…
Reference in New Issue
Block a user