diff --git a/ruty/mails/SQL/mssql.initial.sql b/ruty/mails/SQL/mssql.initial.sql new file mode 100644 index 0000000..b49a1ea --- /dev/null +++ b/ruty/mails/SQL/mssql.initial.sql @@ -0,0 +1,491 @@ +CREATE TABLE [dbo].[cache] ( + [user_id] [int] NOT NULL , + [cache_key] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL , + [expires] [datetime] NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[cache_shared] ( + [cache_key] [varchar] (255) COLLATE Latin1_General_CS_AS NOT NULL , + [expires] [datetime] NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[cache_index] ( + [user_id] [int] NOT NULL , + [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL , + [expires] [datetime] NULL , + [valid] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[cache_thread] ( + [user_id] [int] NOT NULL , + [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL , + [expires] [datetime] NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[cache_messages] ( + [user_id] [int] NOT NULL , + [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL , + [uid] [int] NOT NULL , + [expires] [datetime] NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL , + [flags] [int] NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[collected_addresses] ( + [address_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [name] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [email] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [type] [int] NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[contacts] ( + [contact_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [email] [varchar] (8000) COLLATE Latin1_General_CI_AI NOT NULL , + [firstname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [surname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [vcard] [text] COLLATE Latin1_General_CI_AI NULL , + [words] [text] COLLATE Latin1_General_CI_AI NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[contactgroups] ( + [contactgroup_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[contactgroupmembers] ( + [contactgroup_id] [int] NOT NULL , + [contact_id] [int] NOT NULL , + [created] [datetime] NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[identities] ( + [identity_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [standard] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [organization] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [email] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [reply-to] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [bcc] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [signature] [text] COLLATE Latin1_General_CI_AI NULL, + [html_signature] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[responses] ( + [response_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [name] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL, + [is_html] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[session] ( + [sess_id] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [changed] [datetime] NULL , + [ip] [varchar] (40) COLLATE Latin1_General_CI_AI NOT NULL , + [vars] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[users] ( + [user_id] [int] IDENTITY (1, 1) NOT NULL , + [username] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL , + [mail_host] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [created] [datetime] NOT NULL , + [last_login] [datetime] NULL , + [failed_login] [datetime] NULL , + [failed_login_counter] [int] NULL , + [language] [varchar] (16) COLLATE Latin1_General_CI_AI NULL , + [preferences] [text] COLLATE Latin1_General_CI_AI NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[dictionary] ( + [user_id] [int] , + [language] [varchar] (16) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[searches] ( + [search_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [type] [tinyint] NOT NULL , + [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[filestore] ( + [file_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [context] [varchar] (32) COLLATE Latin1_General_CI_AI NOT NULL , + [filename] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [mtime] [int] NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NULL , +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[system] ( + [name] [varchar] (64) COLLATE Latin1_General_CI_AI NOT NULL , + [value] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [user_id],[cache_key] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_shared] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [cache_key] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_index] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [user_id],[mailbox] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_thread] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [user_id],[mailbox] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_messages] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [user_id],[mailbox],[uid] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[collected_addresses] WITH NOCHECK ADD + CONSTRAINT [PK_collected_addresses_address_id] PRIMARY KEY CLUSTERED + ( + [address_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contacts] WITH NOCHECK ADD + CONSTRAINT [PK_contacts_contact_id] PRIMARY KEY CLUSTERED + ( + [contact_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroups] WITH NOCHECK ADD + CONSTRAINT [PK_contactgroups_contactgroup_id] PRIMARY KEY CLUSTERED + ( + [contactgroup_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroupmembers] WITH NOCHECK ADD + CONSTRAINT [PK_contactgroupmembers_id] PRIMARY KEY CLUSTERED + ( + [contactgroup_id], [contact_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[identities] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [identity_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[responses] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [response_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[session] WITH NOCHECK ADD + CONSTRAINT [PK_session_sess_id] PRIMARY KEY CLUSTERED + ( + [sess_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[users] WITH NOCHECK ADD + CONSTRAINT [PK_users_user_id] PRIMARY KEY CLUSTERED + ( + [user_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[searches] WITH NOCHECK ADD + CONSTRAINT [PK_searches_search_id] PRIMARY KEY CLUSTERED + ( + [search_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[filestore] WITH NOCHECK ADD + CONSTRAINT [PK_filestore_file_id] PRIMARY KEY CLUSTERED + ( + [file_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[system] WITH NOCHECK ADD + CONSTRAINT [PK_system_name] PRIMARY KEY CLUSTERED + ( + [name] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache] ADD + CONSTRAINT [DF_cache_user_id] DEFAULT ('0') FOR [user_id], + CONSTRAINT [DF_cache_cache_key] DEFAULT ('') FOR [cache_key] +GO + +ALTER TABLE [dbo].[cache_index] ADD + CONSTRAINT [DF_cache_index_valid] DEFAULT ('0') FOR [valid] +GO + +ALTER TABLE [dbo].[cache_messages] ADD + CONSTRAINT [DF_cache_messages_flags] DEFAULT (0) FOR [flags] +GO + +CREATE INDEX [IX_cache_shared_cache_key] ON [dbo].[cache_shared]([cache_key]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_index_user_id] ON [dbo].[cache_index]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_thread_user_id] ON [dbo].[cache_thread]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_messages_user_id] ON [dbo].[cache_messages]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_expires] ON [dbo].[cache]([expires]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_shared_expires] ON [dbo].[cache_shared]([expires]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_index_expires] ON [dbo].[cache_index]([expires]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_thread_expires] ON [dbo].[cache_thread]([expires]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_messages_expires] ON [dbo].[cache_messages]([expires]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[collected_addresses] ADD + CONSTRAINT [DF_collected_addresses_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_collected_addresses_changed] DEFAULT (getdate()) FOR [changed], + CONSTRAINT [DF_collected_addresses_name] DEFAULT ('') FOR [name] +GO + +CREATE UNIQUE INDEX [IX_collected_addresses_user_id] ON [dbo].[collected_addresses]([user_id],[type],[email]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contacts] ADD + CONSTRAINT [DF_contacts_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_contacts_changed] DEFAULT (getdate()) FOR [changed], + CONSTRAINT [DF_contacts_del] DEFAULT ('0') FOR [del], + CONSTRAINT [DF_contacts_name] DEFAULT ('') FOR [name], + CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email], + CONSTRAINT [DF_contacts_firstname] DEFAULT ('') FOR [firstname], + CONSTRAINT [DF_contacts_surname] DEFAULT ('') FOR [surname], + CONSTRAINT [CK_contacts_del] CHECK ([del] = '1' or [del] = '0') +GO + +CREATE INDEX [IX_contacts_user_id] ON [dbo].[contacts]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroups] ADD + CONSTRAINT [DF_contactgroups_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_contactgroups_changed] DEFAULT (getdate()) FOR [changed], + CONSTRAINT [DF_contactgroups_del] DEFAULT ('0') FOR [del], + CONSTRAINT [DF_contactgroups_name] DEFAULT ('') FOR [name], + CONSTRAINT [CK_contactgroups_del] CHECK ([del] = '1' or [del] = '0') +GO + +CREATE INDEX [IX_contactgroups_user_id] ON [dbo].[contactgroups]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroupmembers] ADD + CONSTRAINT [DF_contactgroupmembers_contactgroup_id] DEFAULT (0) FOR [contactgroup_id], + CONSTRAINT [DF_contactgroupmembers_contact_id] DEFAULT (0) FOR [contact_id], + CONSTRAINT [DF_contactgroupmembers_created] DEFAULT (getdate()) FOR [created] +GO + +CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[identities] ADD + CONSTRAINT [DF_identities_user] DEFAULT ('0') FOR [user_id], + CONSTRAINT [DF_identities_del] DEFAULT ('0') FOR [del], + CONSTRAINT [DF_identities_standard] DEFAULT ('0') FOR [standard], + CONSTRAINT [DF_identities_name] DEFAULT ('') FOR [name], + CONSTRAINT [DF_identities_organization] DEFAULT ('') FOR [organization], + CONSTRAINT [DF_identities_email] DEFAULT ('') FOR [email], + CONSTRAINT [DF_identities_reply] DEFAULT ('') FOR [reply-to], + CONSTRAINT [DF_identities_bcc] DEFAULT ('') FOR [bcc], + CONSTRAINT [DF_identities_html_signature] DEFAULT ('0') FOR [html_signature], + CHECK ([standard] = '1' or [standard] = '0'), + CHECK ([del] = '1' or [del] = '0') +GO + +CREATE INDEX [IX_identities_user_id] ON [dbo].[identities]([user_id]) ON [PRIMARY] +GO +CREATE INDEX [IX_identities_email] ON [dbo].[identities]([email],[del]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[responses] ADD + CONSTRAINT [DF_responses_user] DEFAULT ('0') FOR [user_id], + CONSTRAINT [DF_responses_del] DEFAULT ('0') FOR [del], + CONSTRAINT [DF_responses_is_html] DEFAULT ('0') FOR [is_html], + CHECK ([del] = '1' or [del] = '0'), + CHECK ([is_html] = '1' or [is_html] = '0') +GO + +CREATE INDEX [IX_responses_user_id] ON [dbo].[responses]([user_id]) ON [PRIMARY] +GO +ALTER TABLE [dbo].[session] ADD + CONSTRAINT [DF_session_sess_id] DEFAULT ('') FOR [sess_id], + CONSTRAINT [DF_session_ip] DEFAULT ('') FOR [ip] +GO + +CREATE INDEX [IX_session_changed] ON [dbo].[session]([changed]) ON [PRIMARY] +GO + +CREATE INDEX [IX_filestore_user_id] ON [dbo].[filestore]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[users] ADD + CONSTRAINT [DF_users_username] DEFAULT ('') FOR [username], + CONSTRAINT [DF_users_mail_host] DEFAULT ('') FOR [mail_host], + CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created] +GO + +CREATE UNIQUE INDEX [IX_users_username] ON [dbo].[users]([username],[mail_host]) ON [PRIMARY] +GO + +CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[searches] ADD + CONSTRAINT [DF_searches_user] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_searches_type] DEFAULT (0) FOR [type] +GO + +CREATE UNIQUE INDEX [IX_searches_user_type_name] ON [dbo].[searches]([user_id],[type],[name]) ON [PRIMARY] +GO + +CREATE UNIQUE INDEX [IX_filestore_user_id_context_filename] ON [dbo].[filestore]([user_id],[context],[filename]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[identities] ADD CONSTRAINT [FK_identities_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[responses] ADD CONSTRAINT [FK_responses_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[collected_addresses] ADD CONSTRAINT [FK_collected_addresses_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [FK_contacts_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[contactgroups] ADD CONSTRAINT [FK_contactgroups_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[cache] ADD CONSTRAINT [FK_cache_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[cache_index] ADD CONSTRAINT [FK_cache_index_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[cache_thread] ADD CONSTRAINT [FK_cache_thread_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[cache_messages] ADD CONSTRAINT [FK_cache_messages_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_contactgroup_id] + FOREIGN KEY ([contactgroup_id]) REFERENCES [dbo].[contactgroups] ([contactgroup_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[searches] ADD CONSTRAINT [FK_searches_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[filestore] ADD CONSTRAINT [FK_filestore_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +-- Use trigger instead of foreign key (#1487112) +-- "Introducing FOREIGN KEY constraint ... may cause cycles or multiple cascade paths." +CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts] + AFTER DELETE AS + DELETE FROM [dbo].[contactgroupmembers] + WHERE [contact_id] IN (SELECT [contact_id] FROM deleted) +GO + +INSERT INTO [dbo].[system] ([name], [value]) VALUES ('roundcube-version', '2022081200') +GO + \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2009103100.sql b/ruty/mails/SQL/mssql/2009103100.sql new file mode 100644 index 0000000..356f6c0 --- /dev/null +++ b/ruty/mails/SQL/mssql/2009103100.sql @@ -0,0 +1,87 @@ +-- Updates from version 0.3.1 + +ALTER TABLE [dbo].[messages] ADD CONSTRAINT [FK_messages_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[cache] ADD CONSTRAINT [FK_cache_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [FK_contacts_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[identities] ADD CONSTRAINT [FK_identities_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[identities] ADD [changed] [datetime] NULL +GO + +CREATE TABLE [dbo].[contactgroups] ( + [contactgroup_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[contactgroupmembers] ( + [contactgroup_id] [int] NOT NULL , + [contact_id] [int] NOT NULL , + [created] [datetime] NOT NULL +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroups] WITH NOCHECK ADD + CONSTRAINT [PK_contactgroups_contactgroup_id] PRIMARY KEY CLUSTERED + ( + [contactgroup_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroupmembers] WITH NOCHECK ADD + CONSTRAINT [PK_contactgroupmembers_id] PRIMARY KEY CLUSTERED + ( + [contactgroup_id], [contact_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroups] ADD + CONSTRAINT [DF_contactgroups_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_contactgroups_changed] DEFAULT (getdate()) FOR [changed], + CONSTRAINT [DF_contactgroups_del] DEFAULT ('0') FOR [del], + CONSTRAINT [DF_contactgroups_name] DEFAULT ('') FOR [name], + CONSTRAINT [CK_contactgroups_del] CHECK ([del] = '1' or [del] = '0') +GO + +CREATE INDEX [IX_contactgroups_user_id] ON [dbo].[contacts]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[contactgroupmembers] ADD + CONSTRAINT [DF_contactgroupmembers_contactgroup_id] DEFAULT (0) FOR [contactgroup_id], + CONSTRAINT [DF_contactgroupmembers_contact_id] DEFAULT (0) FOR [contact_id], + CONSTRAINT [DF_contactgroupmembers_created] DEFAULT (getdate()) FOR [created] +GO + +ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_contactgroup_id] + FOREIGN KEY ([contactgroup_id]) REFERENCES [dbo].[contactgroups] ([contactgroup_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts] + AFTER DELETE AS + DELETE FROM [dbo].[contactgroupmembers] + WHERE [contact_id] IN (SELECT [contact_id] FROM deleted) +GO + +ALTER TABLE [dbo].[contactgroups] ADD CONSTRAINT [FK_contactgroups_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO diff --git a/ruty/mails/SQL/mssql/2010100600.sql b/ruty/mails/SQL/mssql/2010100600.sql new file mode 100644 index 0000000..fb045e3 --- /dev/null +++ b/ruty/mails/SQL/mssql/2010100600.sql @@ -0,0 +1,9 @@ +-- Updates from version 0.4.2 + +DROP INDEX [IX_users_username] +GO +CREATE UNIQUE INDEX [IX_users_username] ON [dbo].[users]([username],[mail_host]) ON [PRIMARY] +GO +ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL +GO + \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2011011200.sql b/ruty/mails/SQL/mssql/2011011200.sql new file mode 100644 index 0000000..b0c6966 --- /dev/null +++ b/ruty/mails/SQL/mssql/2011011200.sql @@ -0,0 +1,10 @@ +-- Updates from version 0.5.x + +ALTER TABLE [dbo].[contacts] ADD [words] [text] COLLATE Latin1_General_CI_AI NULL +GO +CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY] +GO +DELETE FROM [dbo].[messages] +GO +DELETE FROM [dbo].[cache] +GO diff --git a/ruty/mails/SQL/mssql/2011092800.sql b/ruty/mails/SQL/mssql/2011092800.sql new file mode 100644 index 0000000..8cc9ecb --- /dev/null +++ b/ruty/mails/SQL/mssql/2011092800.sql @@ -0,0 +1,127 @@ +-- Updates from version 0.6 + +CREATE TABLE [dbo].[dictionary] ( + [user_id] [int] , + [language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO +CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[searches] ( + [search_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [type] [tinyint] NOT NULL , + [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[searches] WITH NOCHECK ADD + CONSTRAINT [PK_searches_search_id] PRIMARY KEY CLUSTERED + ( + [search_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[searches] ADD + CONSTRAINT [DF_searches_user] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_searches_type] DEFAULT (0) FOR [type], +GO + +CREATE UNIQUE INDEX [IX_searches_user_type_name] ON [dbo].[searches]([user_id],[type],[name]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[searches] ADD CONSTRAINT [FK_searches_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +DROP TABLE [dbo].[messages] +GO +CREATE TABLE [dbo].[cache_index] ( + [user_id] [int] NOT NULL , + [mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [changed] [datetime] NOT NULL , + [valid] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[cache_thread] ( + [user_id] [int] NOT NULL , + [mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [changed] [datetime] NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[cache_messages] ( + [user_id] [int] NOT NULL , + [mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [uid] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL , + [flags] [int] NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_index] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [user_id],[mailbox] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_thread] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [user_id],[mailbox] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_messages] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [user_id],[mailbox],[uid] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_index] ADD + CONSTRAINT [DF_cache_index_changed] DEFAULT (getdate()) FOR [changed], + CONSTRAINT [DF_cache_index_valid] DEFAULT ('0') FOR [valid] +GO + +CREATE INDEX [IX_cache_index_user_id] ON [dbo].[cache_index]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_thread] ADD + CONSTRAINT [DF_cache_thread_changed] DEFAULT (getdate()) FOR [changed] +GO + +CREATE INDEX [IX_cache_thread_user_id] ON [dbo].[cache_thread]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_messages] ADD + CONSTRAINT [DF_cache_messages_changed] DEFAULT (getdate()) FOR [changed], + CONSTRAINT [DF_cache_messages_flags] DEFAULT (0) FOR [flags] +GO + +CREATE INDEX [IX_cache_messages_user_id] ON [dbo].[cache_messages]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_index] ADD CONSTRAINT [FK_cache_index_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[cache_thread] ADD CONSTRAINT [FK_cache_thread_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + +ALTER TABLE [dbo].[cache_messages] ADD CONSTRAINT [FK_cache_messages_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO diff --git a/ruty/mails/SQL/mssql/2011111600.sql b/ruty/mails/SQL/mssql/2011111600.sql new file mode 100644 index 0000000..2b73184 --- /dev/null +++ b/ruty/mails/SQL/mssql/2011111600.sql @@ -0,0 +1,4 @@ +-- Updates from version 0.7-beta + +ALTER TABLE [dbo].[session] ALTER COLUMN [sess_id] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL +GO diff --git a/ruty/mails/SQL/mssql/2011121400.sql b/ruty/mails/SQL/mssql/2011121400.sql new file mode 100644 index 0000000..fde63ea --- /dev/null +++ b/ruty/mails/SQL/mssql/2011121400.sql @@ -0,0 +1,9 @@ +-- Updates from version 0.7 + +ALTER TABLE [dbo].[contacts] DROP CONSTRAINT [DF_contacts_email] +GO +ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [text] COLLATE Latin1_General_CI_AI NOT NULL +GO +ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email] +GO + \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2012051800.sql b/ruty/mails/SQL/mssql/2012051800.sql new file mode 100644 index 0000000..8dcf7bf --- /dev/null +++ b/ruty/mails/SQL/mssql/2012051800.sql @@ -0,0 +1,18 @@ +-- Updates from version 0.8-rc + +ALTER TABLE [dbo].[contacts] DROP CONSTRAINT [DF_contacts_email] +GO +ALTER TABLE [dbo].[contacts] ALTER COLUMN [email] [varchar] (8000) COLLATE Latin1_General_CI_AI NOT NULL +GO +ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email] +GO + +-- Updates from version 0.8 + +ALTER TABLE [dbo].[cache] DROP COLUMN [cache_id] +GO +ALTER TABLE [dbo].[users] DROP COLUMN [alias] +GO +CREATE INDEX [IX_identities_email] ON [dbo].[identities]([email],[del]) ON [PRIMARY] +GO + \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2012080700.sql b/ruty/mails/SQL/mssql/2012080700.sql new file mode 100644 index 0000000..4db512c --- /dev/null +++ b/ruty/mails/SQL/mssql/2012080700.sql @@ -0,0 +1,8 @@ +-- Updates from version 0.8 + +ALTER TABLE [dbo].[cache] DROP COLUMN [cache_id] +GO +ALTER TABLE [dbo].[users] DROP COLUMN [alias] +GO +CREATE INDEX [IX_identities_email] ON [dbo].[identities]([email],[del]) ON [PRIMARY] +GO diff --git a/ruty/mails/SQL/mssql/2013011000.sql b/ruty/mails/SQL/mssql/2013011000.sql new file mode 100644 index 0000000..c4bcb86 --- /dev/null +++ b/ruty/mails/SQL/mssql/2013011000.sql @@ -0,0 +1,14 @@ +-- Upgrades from 0.9-beta + +CREATE TABLE [dbo].[system] ( + [name] [varchar] (64) COLLATE Latin1_General_CI_AI NOT NULL , + [value] [text] COLLATE Latin1_General_CI_AI +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[system] WITH NOCHECK ADD + CONSTRAINT [PK_system_name] PRIMARY KEY CLUSTERED + ( + [name] + ) ON [PRIMARY] +GO diff --git a/ruty/mails/SQL/mssql/2013042700.sql b/ruty/mails/SQL/mssql/2013042700.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/mssql/2013042700.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2013052500.sql b/ruty/mails/SQL/mssql/2013052500.sql new file mode 100644 index 0000000..1fddfed --- /dev/null +++ b/ruty/mails/SQL/mssql/2013052500.sql @@ -0,0 +1,17 @@ +CREATE TABLE [dbo].[cache_shared] ( + [cache_key] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [created] [datetime] NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[cache_shared] ADD + CONSTRAINT [DF_cache_shared_created] DEFAULT (getdate()) FOR [created] +GO + +CREATE INDEX [IX_cache_shared_cache_key] ON [dbo].[cache_shared]([cache_key]) ON [PRIMARY] +GO + +CREATE INDEX [IX_cache_shared_created] ON [dbo].[cache_shared]([created]) ON [PRIMARY] +GO + diff --git a/ruty/mails/SQL/mssql/2013061000.sql b/ruty/mails/SQL/mssql/2013061000.sql new file mode 100644 index 0000000..5e8b791 --- /dev/null +++ b/ruty/mails/SQL/mssql/2013061000.sql @@ -0,0 +1,44 @@ +ALTER TABLE [dbo].[cache] ADD [expires] [datetime] NULL +GO +ALTER TABLE [dbo].[cache_shared] ADD [expires] [datetime] NULL +GO +ALTER TABLE [dbo].[cache_index] ADD [expires] [datetime] NULL +GO +ALTER TABLE [dbo].[cache_thread] ADD [expires] [datetime] NULL +GO +ALTER TABLE [dbo].[cache_messages] ADD [expires] [datetime] NULL +GO + +UPDATE [dbo].[cache] SET [expires] = DATEADD(second, 604800, [created]) +GO +UPDATE [dbo].[cache_shared] SET [expires] = DATEADD(second, 604800, [created]) +GO +UPDATE [dbo].[cache_index] SET [expires] = DATEADD(second, 604800, [changed]) +GO +UPDATE [dbo].[cache_thread] SET [expires] = DATEADD(second, 604800, [changed]) +GO +UPDATE [dbo].[cache_messages] SET [expires] = DATEADD(second, 604800, [changed]) +GO + +DROP INDEX [IX_cache_created] +GO +DROP INDEX [IX_cache_shared_created] +GO +ALTER TABLE [dbo].[cache_index] DROP COLUMN [changed] +GO +ALTER TABLE [dbo].[cache_thread] DROP COLUMN [changed] +GO +ALTER TABLE [dbo].[cache_messages] DROP COLUMN [changed] +GO + +CREATE INDEX [IX_cache_expires] ON [dbo].[cache]([expires]) ON [PRIMARY] +GO +CREATE INDEX [IX_cache_shared_expires] ON [dbo].[cache_shared]([expires]) ON [PRIMARY] +GO +CREATE INDEX [IX_cache_index_expires] ON [dbo].[cache_index]([expires]) ON [PRIMARY] +GO +CREATE INDEX [IX_cache_thread_expires] ON [dbo].[cache_thread]([expires]) ON [PRIMARY] +GO +CREATE INDEX [IX_cache_messages_expires] ON [dbo].[cache_messages]([expires]) ON [PRIMARY] +GO + \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2014042900.sql b/ruty/mails/SQL/mssql/2014042900.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/mssql/2014042900.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2015030800.sql b/ruty/mails/SQL/mssql/2015030800.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/mssql/2015030800.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2015111100.sql b/ruty/mails/SQL/mssql/2015111100.sql new file mode 100644 index 0000000..9abff98 --- /dev/null +++ b/ruty/mails/SQL/mssql/2015111100.sql @@ -0,0 +1,4 @@ +ALTER TABLE [dbo].[users] ADD [failed_login] [datetime] NULL +GO +ALTER TABLE [dbo].[users] ADD [failed_login_counter] [int] NULL +GO diff --git a/ruty/mails/SQL/mssql/2016081200.sql b/ruty/mails/SQL/mssql/2016081200.sql new file mode 100644 index 0000000..a8ee99c --- /dev/null +++ b/ruty/mails/SQL/mssql/2016081200.sql @@ -0,0 +1,5 @@ +ALTER TABLE [dbo].[session] DROP CONSTRAINT [DF_session_created] +GO + +ALTER TABLE [dbo].[session] DROP COLUMN [created] +GO diff --git a/ruty/mails/SQL/mssql/2016100900.sql b/ruty/mails/SQL/mssql/2016100900.sql new file mode 100644 index 0000000..38b359a --- /dev/null +++ b/ruty/mails/SQL/mssql/2016100900.sql @@ -0,0 +1,2 @@ +ALTER TABLE [dbo].[session] ALTER COLUMN [ip] [varchar] (40) COLLATE Latin1_General_CI_AI NOT NULL +GO diff --git a/ruty/mails/SQL/mssql/2016112200.sql b/ruty/mails/SQL/mssql/2016112200.sql new file mode 100644 index 0000000..302a3ae --- /dev/null +++ b/ruty/mails/SQL/mssql/2016112200.sql @@ -0,0 +1,36 @@ +DROP TABLE [dbo].[cache] +GO +DROP TABLE [dbo].[cache_shared] +GO + +CREATE TABLE [dbo].[cache] ( + [user_id] [int] NOT NULL , + [cache_key] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [expires] [datetime] NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO +CREATE TABLE [dbo].[cache_shared] ( + [cache_key] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [expires] [datetime] NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO +ALTER TABLE [dbo].[cache] ADD + CONSTRAINT [DF_cache_user_id] DEFAULT ('0') FOR [user_id], + CONSTRAINT [DF_cache_cache_key] DEFAULT ('') FOR [cache_key] +GO +CREATE INDEX [IX_cache_expires] ON [dbo].[cache]([expires]) ON [PRIMARY] +GO +CREATE INDEX [IX_cache_shared_expires] ON [dbo].[cache_shared]([expires]) ON [PRIMARY] +GO +ALTER TABLE [dbo].[cache] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED ( + [user_id],[cache_key] + ) ON [PRIMARY] +GO +ALTER TABLE [dbo].[cache_shared] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED ( + [cache_key] + ) ON [PRIMARY] +GO diff --git a/ruty/mails/SQL/mssql/2018021600.sql b/ruty/mails/SQL/mssql/2018021600.sql new file mode 100644 index 0000000..176a712 --- /dev/null +++ b/ruty/mails/SQL/mssql/2018021600.sql @@ -0,0 +1,24 @@ +CREATE TABLE [dbo].[filestore] ( + [file_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [filename] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , + [mtime] [int] NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NULL , +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[filestore] WITH NOCHECK ADD + CONSTRAINT [PK_filestore_file_id] PRIMARY KEY CLUSTERED + ( + [file_id] + ) ON [PRIMARY] +GO + +CREATE INDEX [IX_filestore_user_id] ON [dbo].[filestore]([user_id]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[filestore] ADD CONSTRAINT [FK_filestore_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + diff --git a/ruty/mails/SQL/mssql/2018122300.sql b/ruty/mails/SQL/mssql/2018122300.sql new file mode 100644 index 0000000..175b93f --- /dev/null +++ b/ruty/mails/SQL/mssql/2018122300.sql @@ -0,0 +1,9 @@ +ALTER TABLE [dbo].[filestore] ADD [context] varchar(32) COLLATE Latin1_General_CI_AI NOT NULL +GO + +UPDATE [dbo].[filestore] SET [context] = 'enigma' +GO + +CREATE UNIQUE INDEX [IX_filestore_user_id_context_filename] ON [dbo].[filestore]([user_id],[context],[filename]) ON [PRIMARY] +GO + diff --git a/ruty/mails/SQL/mssql/2019092900.sql b/ruty/mails/SQL/mssql/2019092900.sql new file mode 100644 index 0000000..3a14a5a --- /dev/null +++ b/ruty/mails/SQL/mssql/2019092900.sql @@ -0,0 +1,18 @@ +ALTER TABLE [dbo].[cache] ALTER COLUMN + [cache_key] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL +GO +ALTER TABLE [dbo].[cache_shared] ALTER COLUMN + [cache_key] [varchar] (255) COLLATE Latin1_General_CS_AS NOT NULL +GO +ALTER TABLE [dbo].[cache_index] ALTER COLUMN + [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL +GO +ALTER TABLE [dbo].[cache_messages] ALTER COLUMN + [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL +GO +ALTER TABLE [dbo].[cache_thread] ALTER COLUMN + [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL +GO +ALTER TABLE [dbo].[users] ALTER COLUMN + [username] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL +GO diff --git a/ruty/mails/SQL/mssql/2020020100.sql b/ruty/mails/SQL/mssql/2020020100.sql new file mode 100644 index 0000000..355e5a5 --- /dev/null +++ b/ruty/mails/SQL/mssql/2020020100.sql @@ -0,0 +1,4 @@ +ALTER TABLE [dbo].[users] ALTER COLUMN [language] [varchar] (16) COLLATE Latin1_General_CI_AI NULL +GO +ALTER TABLE [dbo].[dictionary] ALTER COLUMN [language] [varchar] (16) COLLATE Latin1_General_CI_AI NOT NULL +GO diff --git a/ruty/mails/SQL/mssql/2020020101.sql b/ruty/mails/SQL/mssql/2020020101.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/mssql/2020020101.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2020091000.sql b/ruty/mails/SQL/mssql/2020091000.sql new file mode 100644 index 0000000..2edb309 --- /dev/null +++ b/ruty/mails/SQL/mssql/2020091000.sql @@ -0,0 +1,31 @@ +CREATE TABLE [dbo].[collected_addresses] ( + [address_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [name] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [email] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [type] [int] NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[collected_addresses] WITH NOCHECK ADD + CONSTRAINT [PK_collected_addresses_address_id] PRIMARY KEY CLUSTERED + ( + [address_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[collected_addresses] ADD + CONSTRAINT [DF_collected_addresses_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_collected_addresses_changed] DEFAULT (getdate()) FOR [changed], + CONSTRAINT [DF_collected_addresses_name] DEFAULT ('') FOR [name], +GO + +CREATE UNIQUE INDEX [IX_collected_addresses_user_id] ON [dbo].[collected_addresses]([user_id],[type],[email]) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[collected_addresses] ADD CONSTRAINT [FK_collected_addresses_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + diff --git a/ruty/mails/SQL/mssql/2020122900.sql b/ruty/mails/SQL/mssql/2020122900.sql new file mode 100644 index 0000000..73cbb58 --- /dev/null +++ b/ruty/mails/SQL/mssql/2020122900.sql @@ -0,0 +1 @@ +--empty \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2021081000.sql b/ruty/mails/SQL/mssql/2021081000.sql new file mode 100644 index 0000000..011b155 --- /dev/null +++ b/ruty/mails/SQL/mssql/2021081000.sql @@ -0,0 +1,33 @@ +CREATE TABLE [dbo].[responses] ( + [response_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [changed] [datetime] NOT NULL , + [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL , + [name] [varchar] (255) COLLATE Latin1_General_CI_AI NOT NULL , + [data] [text] COLLATE Latin1_General_CI_AI NOT NULL, + [is_html] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [dbo].[responses] WITH NOCHECK ADD + PRIMARY KEY CLUSTERED + ( + [response_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[responses] ADD + CONSTRAINT [DF_responses_user] DEFAULT ('0') FOR [user_id], + CONSTRAINT [DF_responses_del] DEFAULT ('0') FOR [del], + CONSTRAINT [DF_responses_is_html] DEFAULT ('0') FOR [is_html], + CHECK ([del] = '1' or [del] = '0'), + CHECK ([is_html] = '1' or [is_html] = '0') +GO + +CREATE INDEX [IX_responses_user_id] ON [dbo].[responses]([user_id]) ON [PRIMARY] +GO +ALTER TABLE [dbo].[responses] ADD CONSTRAINT [FK_responses_user_id] + FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id]) + ON DELETE CASCADE ON UPDATE CASCADE +GO + diff --git a/ruty/mails/SQL/mssql/2021100300.sql b/ruty/mails/SQL/mssql/2021100300.sql new file mode 100644 index 0000000..49daeda --- /dev/null +++ b/ruty/mails/SQL/mssql/2021100300.sql @@ -0,0 +1 @@ +-- SQLite only \ No newline at end of file diff --git a/ruty/mails/SQL/mssql/2022081200.sql b/ruty/mails/SQL/mssql/2022081200.sql new file mode 100644 index 0000000..105e39e --- /dev/null +++ b/ruty/mails/SQL/mssql/2022081200.sql @@ -0,0 +1 @@ +-- SQLite/Postgres only \ No newline at end of file diff --git a/ruty/mails/SQL/mysql.initial.sql b/ruty/mails/SQL/mysql.initial.sql new file mode 100644 index 0000000..f829cb3 --- /dev/null +++ b/ruty/mails/SQL/mysql.initial.sql @@ -0,0 +1,263 @@ +-- Roundcube Webmail initial database structure + + +SET FOREIGN_KEY_CHECKS=0; + +-- Table structure for table `session` + +CREATE TABLE `session` ( + `sess_id` varchar(128) NOT NULL, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `ip` varchar(40) NOT NULL, + `vars` mediumtext NOT NULL, + PRIMARY KEY(`sess_id`), + INDEX `changed_index` (`changed`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `users` + +CREATE TABLE `users` ( + `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `username` varchar(128) BINARY NOT NULL, + `mail_host` varchar(128) NOT NULL, + `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `last_login` datetime, + `failed_login` datetime, + `failed_login_counter` int(10) UNSIGNED, + `language` varchar(16), + `preferences` longtext, + PRIMARY KEY(`user_id`), + UNIQUE `username` (`username`, `mail_host`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `cache` + +CREATE TABLE `cache` ( + `user_id` int(10) UNSIGNED NOT NULL, + `cache_key` varchar(128) BINARY NOT NULL, + `expires` datetime, + `data` longtext NOT NULL, + PRIMARY KEY (`user_id`, `cache_key`), + CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `expires_index` (`expires`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `cache_shared` + +CREATE TABLE `cache_shared` ( + `cache_key` varchar(255) BINARY NOT NULL, + `expires` datetime, + `data` longtext NOT NULL, + PRIMARY KEY (`cache_key`), + INDEX `expires_index` (`expires`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `cache_index` + +CREATE TABLE `cache_index` ( + `user_id` int(10) UNSIGNED NOT NULL, + `mailbox` varchar(255) BINARY NOT NULL, + `expires` datetime, + `valid` tinyint(1) NOT NULL DEFAULT '0', + `data` longtext NOT NULL, + CONSTRAINT `user_id_fk_cache_index` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `expires_index` (`expires`), + PRIMARY KEY (`user_id`, `mailbox`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `cache_thread` + +CREATE TABLE `cache_thread` ( + `user_id` int(10) UNSIGNED NOT NULL, + `mailbox` varchar(255) BINARY NOT NULL, + `expires` datetime, + `data` longtext NOT NULL, + CONSTRAINT `user_id_fk_cache_thread` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `expires_index` (`expires`), + PRIMARY KEY (`user_id`, `mailbox`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `cache_messages` + +CREATE TABLE `cache_messages` ( + `user_id` int(10) UNSIGNED NOT NULL, + `mailbox` varchar(255) BINARY NOT NULL, + `uid` int(11) UNSIGNED NOT NULL DEFAULT '0', + `expires` datetime, + `data` longtext NOT NULL, + `flags` int(11) NOT NULL DEFAULT '0', + CONSTRAINT `user_id_fk_cache_messages` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `expires_index` (`expires`), + PRIMARY KEY (`user_id`, `mailbox`, `uid`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `collected_addresses` + +CREATE TABLE `collected_addresses` ( + `address_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `name` varchar(255) NOT NULL DEFAULT '', + `email` varchar(255) NOT NULL, + `user_id` int(10) UNSIGNED NOT NULL, + `type` int(10) UNSIGNED NOT NULL, + PRIMARY KEY(`address_id`), + CONSTRAINT `user_id_fk_collected_addresses` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE INDEX `user_email_collected_addresses_index` (`user_id`, `type`, `email`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `contacts` + +CREATE TABLE `contacts` ( + `contact_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `del` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(128) NOT NULL DEFAULT '', + `email` text NOT NULL, + `firstname` varchar(128) NOT NULL DEFAULT '', + `surname` varchar(128) NOT NULL DEFAULT '', + `vcard` longtext, + `words` text, + `user_id` int(10) UNSIGNED NOT NULL, + PRIMARY KEY(`contact_id`), + CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `user_contacts_index` (`user_id`,`del`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `contactgroups` + +CREATE TABLE `contactgroups` ( + `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `del` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(128) NOT NULL DEFAULT '', + PRIMARY KEY(`contactgroup_id`), + CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `contactgroups_user_index` (`user_id`,`del`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `contactgroupmembers` + +CREATE TABLE `contactgroupmembers` ( + `contactgroup_id` int(10) UNSIGNED NOT NULL, + `contact_id` int(10) UNSIGNED NOT NULL, + `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + PRIMARY KEY (`contactgroup_id`, `contact_id`), + CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`) + REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`) + REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `contactgroupmembers_contact_index` (`contact_id`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB; + + +-- Table structure for table `identities` + +CREATE TABLE `identities` ( + `identity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `del` tinyint(1) NOT NULL DEFAULT '0', + `standard` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(128) NOT NULL, + `organization` varchar(128) NOT NULL DEFAULT '', + `email` varchar(128) NOT NULL, + `reply-to` varchar(128) NOT NULL DEFAULT '', + `bcc` varchar(128) NOT NULL DEFAULT '', + `signature` longtext, + `html_signature` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY(`identity_id`), + CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `user_identities_index` (`user_id`, `del`), + INDEX `email_identities_index` (`email`, `del`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `responses` + +CREATE TABLE `responses` ( + `response_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL, + `name` varchar(255) NOT NULL, + `data` longtext NOT NULL, + `is_html` tinyint(1) NOT NULL DEFAULT '0', + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `del` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`response_id`), + CONSTRAINT `user_id_fk_responses` FOREIGN KEY (`user_id`) + REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `user_responses_index` (`user_id`, `del`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `dictionary` + +CREATE TABLE `dictionary` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, -- redundant, for compat. with Galera Cluster + `user_id` int(10) UNSIGNED, -- NULL here is for "shared dictionaries" + `language` varchar(16) NOT NULL, + `data` longtext NOT NULL, + CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE `uniqueness` (`user_id`, `language`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + +-- Table structure for table `searches` + +CREATE TABLE `searches` ( + `search_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL, + `type` int(3) NOT NULL DEFAULT '0', + `name` varchar(128) NOT NULL, + `data` text, + PRIMARY KEY(`search_id`), + CONSTRAINT `user_id_fk_searches` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE `uniqueness` (`user_id`, `type`, `name`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- Table structure for table `filestore` + +CREATE TABLE `filestore` ( + `file_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL, + `context` varchar(32) NOT NULL, + `filename` varchar(128) NOT NULL, + `mtime` int(10) NOT NULL, + `data` longtext NOT NULL, + PRIMARY KEY (`file_id`), + CONSTRAINT `user_id_fk_filestore` FOREIGN KEY (`user_id`) + REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE `uniqueness` (`user_id`, `context`, `filename`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- Table structure for table `system` + +CREATE TABLE `system` ( + `name` varchar(64) NOT NULL, + `value` mediumtext, + PRIMARY KEY(`name`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +SET FOREIGN_KEY_CHECKS=1; + +INSERT INTO `system` (`name`, `value`) VALUES ('roundcube-version', '2022081200'); diff --git a/ruty/mails/SQL/mysql/2008030300.sql b/ruty/mails/SQL/mysql/2008030300.sql new file mode 100644 index 0000000..9a3d048 --- /dev/null +++ b/ruty/mails/SQL/mysql/2008030300.sql @@ -0,0 +1,16 @@ +-- Updates from version 0.1-stable + +TRUNCATE TABLE `messages`; + +ALTER TABLE `messages` + DROP INDEX `idx`, + DROP INDEX `uid`; + +ALTER TABLE `cache` + DROP INDEX `cache_key`, + DROP INDEX `session_id`, + ADD INDEX `user_cache_index` (`user_id`,`cache_key`); + +ALTER TABLE `users` + ADD INDEX `username_index` (`username`), + ADD INDEX `alias_index` (`alias`); diff --git a/ruty/mails/SQL/mysql/2008040500.sql b/ruty/mails/SQL/mysql/2008040500.sql new file mode 100644 index 0000000..f538f63 --- /dev/null +++ b/ruty/mails/SQL/mysql/2008040500.sql @@ -0,0 +1,9 @@ +-- Updates from version 0.1.1 + +ALTER TABLE `identities` + MODIFY `signature` text, + MODIFY `bcc` varchar(128) NOT NULL DEFAULT '', + MODIFY `reply-to` varchar(128) NOT NULL DEFAULT '', + MODIFY `organization` varchar(128) NOT NULL DEFAULT '', + MODIFY `name` varchar(128) NOT NULL, + MODIFY `email` varchar(128) NOT NULL; diff --git a/ruty/mails/SQL/mysql/2008060900.sql b/ruty/mails/SQL/mysql/2008060900.sql new file mode 100644 index 0000000..9f8de0a --- /dev/null +++ b/ruty/mails/SQL/mysql/2008060900.sql @@ -0,0 +1,4 @@ +-- Updates from version 0.2-alpha + +ALTER TABLE `messages` + ADD INDEX `created_index` (`created`); diff --git a/ruty/mails/SQL/mysql/2008092100.sql b/ruty/mails/SQL/mysql/2008092100.sql new file mode 100644 index 0000000..3989c75 --- /dev/null +++ b/ruty/mails/SQL/mysql/2008092100.sql @@ -0,0 +1,20 @@ +-- Updates from version 0.2-beta (InnoDB required) + +ALTER TABLE `cache` + DROP `session_id`; + +ALTER TABLE `session` + ADD INDEX `changed_index` (`changed`); + +ALTER TABLE `cache` + ADD INDEX `created_index` (`created`); + +ALTER TABLE `users` + CHANGE `language` `language` varchar(5); + +ALTER TABLE `cache` ENGINE=InnoDB; +ALTER TABLE `session` ENGINE=InnoDB; +ALTER TABLE `messages` ENGINE=InnoDB; +ALTER TABLE `users` ENGINE=InnoDB; +ALTER TABLE `contacts` ENGINE=InnoDB; +ALTER TABLE `identities` ENGINE=InnoDB; diff --git a/ruty/mails/SQL/mysql/2009090400.sql b/ruty/mails/SQL/mysql/2009090400.sql new file mode 100644 index 0000000..fd31bed --- /dev/null +++ b/ruty/mails/SQL/mysql/2009090400.sql @@ -0,0 +1,12 @@ +-- Updates from version 0.3-stable + +TRUNCATE `messages`; + +ALTER TABLE `messages` + ADD INDEX `index_index` (`user_id`, `cache_key`, `idx`); + +ALTER TABLE `session` + CHANGE `vars` `vars` MEDIUMTEXT NOT NULL; + +ALTER TABLE `contacts` + ADD INDEX `user_contacts_index` (`user_id`,`email`); diff --git a/ruty/mails/SQL/mysql/2009103100.sql b/ruty/mails/SQL/mysql/2009103100.sql new file mode 100644 index 0000000..aafbe23 --- /dev/null +++ b/ruty/mails/SQL/mysql/2009103100.sql @@ -0,0 +1,52 @@ +-- Updates from version 0.3.1 +-- WARNING: Make sure that all tables are using InnoDB engine!!! +-- If not, use: ALTER TABLE xxx ENGINE=InnoDB; + +/* MySQL bug workaround: http://bugs.mysql.com/bug.php?id=46293 */ +/*!40014 SET FOREIGN_KEY_CHECKS=0 */; + +ALTER TABLE `messages` DROP FOREIGN KEY `user_id_fk_messages`; +ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`; +ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`; +ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`; + +ALTER TABLE `messages` ADD CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `cache` ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; + +ALTER TABLE `contacts` ALTER `name` SET DEFAULT ''; +ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT ''; +ALTER TABLE `contacts` ALTER `surname` SET DEFAULT ''; + +ALTER TABLE `identities` ADD INDEX `user_identities_index` (`user_id`, `del`); +ALTER TABLE `identities` ADD `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00' AFTER `user_id`; + +CREATE TABLE `contactgroups` ( + `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `del` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(128) NOT NULL DEFAULT '', + PRIMARY KEY(`contactgroup_id`), + CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `contactgroups_user_index` (`user_id`,`del`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; + +CREATE TABLE `contactgroupmembers` ( + `contactgroup_id` int(10) UNSIGNED NOT NULL, + `contact_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + PRIMARY KEY (`contactgroup_id`, `contact_id`), + CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`) + REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`) + REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE +) /*!40000 ENGINE=INNODB */; + +/*!40014 SET FOREIGN_KEY_CHECKS=1 */; diff --git a/ruty/mails/SQL/mysql/2010042300.sql b/ruty/mails/SQL/mysql/2010042300.sql new file mode 100644 index 0000000..8b90af4 --- /dev/null +++ b/ruty/mails/SQL/mysql/2010042300.sql @@ -0,0 +1,4 @@ +-- Updates from version 0.4-beta + +ALTER TABLE `users` CHANGE `last_login` `last_login` datetime DEFAULT NULL; +UPDATE `users` SET `last_login` = NULL WHERE `last_login` = '1000-01-01 00:00:00'; diff --git a/ruty/mails/SQL/mysql/2010100600.sql b/ruty/mails/SQL/mysql/2010100600.sql new file mode 100644 index 0000000..ca0fec8 --- /dev/null +++ b/ruty/mails/SQL/mysql/2010100600.sql @@ -0,0 +1,8 @@ +-- Updates from version 0.4.2 + +ALTER TABLE `users` DROP INDEX `username_index`; +ALTER TABLE `users` ADD UNIQUE `username` (`username`, `mail_host`); + +ALTER TABLE `contacts` MODIFY `email` varchar(255) NOT NULL; + +TRUNCATE TABLE `messages`; diff --git a/ruty/mails/SQL/mysql/2011011200.sql b/ruty/mails/SQL/mysql/2011011200.sql new file mode 100644 index 0000000..6597034 --- /dev/null +++ b/ruty/mails/SQL/mysql/2011011200.sql @@ -0,0 +1,8 @@ +-- Updates from version 0.5.x + +ALTER TABLE `contacts` ADD `words` TEXT NULL AFTER `vcard`; +ALTER TABLE `contacts` CHANGE `vcard` `vcard` LONGTEXT /*!40101 CHARACTER SET utf8 */ NULL DEFAULT NULL; +ALTER TABLE `contactgroupmembers` ADD INDEX `contactgroupmembers_contact_index` (`contact_id`); + +TRUNCATE TABLE `messages`; +TRUNCATE TABLE `cache`; diff --git a/ruty/mails/SQL/mysql/2011092800.sql b/ruty/mails/SQL/mysql/2011092800.sql new file mode 100644 index 0000000..6b7cbe1 --- /dev/null +++ b/ruty/mails/SQL/mysql/2011092800.sql @@ -0,0 +1,67 @@ +-- Updates from version 0.6 + +/*!40014 SET FOREIGN_KEY_CHECKS=0 */; + +ALTER TABLE `users` CHANGE `alias` `alias` varchar(128) BINARY NOT NULL; +ALTER TABLE `users` CHANGE `username` `username` varchar(128) BINARY NOT NULL; + +CREATE TABLE `dictionary` ( + `user_id` int(10) UNSIGNED DEFAULT NULL, + `language` varchar(5) NOT NULL, + `data` longtext NOT NULL, + CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE `uniqueness` (`user_id`, `language`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; + +CREATE TABLE `searches` ( + `search_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `type` int(3) NOT NULL DEFAULT '0', + `name` varchar(128) NOT NULL, + `data` text, + PRIMARY KEY(`search_id`), + CONSTRAINT `user_id_fk_searches` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE `uniqueness` (`user_id`, `type`, `name`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; + +DROP TABLE `messages`; + +CREATE TABLE `cache_index` ( + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `mailbox` varchar(255) BINARY NOT NULL, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `valid` tinyint(1) NOT NULL DEFAULT '0', + `data` longtext NOT NULL, + CONSTRAINT `user_id_fk_cache_index` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `changed_index` (`changed`), + PRIMARY KEY (`user_id`, `mailbox`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; + +CREATE TABLE `cache_thread` ( + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `mailbox` varchar(255) BINARY NOT NULL, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `data` longtext NOT NULL, + CONSTRAINT `user_id_fk_cache_thread` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `changed_index` (`changed`), + PRIMARY KEY (`user_id`, `mailbox`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; + +CREATE TABLE `cache_messages` ( + `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `mailbox` varchar(255) BINARY NOT NULL, + `uid` int(11) UNSIGNED NOT NULL DEFAULT '0', + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `data` longtext NOT NULL, + `flags` int(11) NOT NULL DEFAULT '0', + CONSTRAINT `user_id_fk_cache_messages` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `changed_index` (`changed`), + PRIMARY KEY (`user_id`, `mailbox`, `uid`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; + +/*!40014 SET FOREIGN_KEY_CHECKS=1 */; diff --git a/ruty/mails/SQL/mysql/2011111600.sql b/ruty/mails/SQL/mysql/2011111600.sql new file mode 100644 index 0000000..6f53daa --- /dev/null +++ b/ruty/mails/SQL/mysql/2011111600.sql @@ -0,0 +1,3 @@ +-- Updates from version 0.7-beta + +ALTER TABLE `session` CHANGE `sess_id` `sess_id` varchar(128) NOT NULL; diff --git a/ruty/mails/SQL/mysql/2011121400.sql b/ruty/mails/SQL/mysql/2011121400.sql new file mode 100644 index 0000000..5aee806 --- /dev/null +++ b/ruty/mails/SQL/mysql/2011121400.sql @@ -0,0 +1,22 @@ +-- Updates from version 0.7 + +/*!40014 SET FOREIGN_KEY_CHECKS=0 */; + +ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`; +ALTER TABLE `contacts` DROP INDEX `user_contacts_index`; +ALTER TABLE `contacts` MODIFY `email` text NOT NULL; +ALTER TABLE `contacts` ADD INDEX `user_contacts_index` (`user_id`,`del`); +ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; + +ALTER TABLE `cache` ALTER `user_id` DROP DEFAULT; +ALTER TABLE `cache_index` ALTER `user_id` DROP DEFAULT; +ALTER TABLE `cache_thread` ALTER `user_id` DROP DEFAULT; +ALTER TABLE `cache_messages` ALTER `user_id` DROP DEFAULT; +ALTER TABLE `contacts` ALTER `user_id` DROP DEFAULT; +ALTER TABLE `contactgroups` ALTER `user_id` DROP DEFAULT; +ALTER TABLE `contactgroupmembers` ALTER `contact_id` DROP DEFAULT; +ALTER TABLE `identities` ALTER `user_id` DROP DEFAULT; +ALTER TABLE `searches` ALTER `user_id` DROP DEFAULT; + +/*!40014 SET FOREIGN_KEY_CHECKS=1 */; diff --git a/ruty/mails/SQL/mysql/2012080700.sql b/ruty/mails/SQL/mysql/2012080700.sql new file mode 100644 index 0000000..789b712 --- /dev/null +++ b/ruty/mails/SQL/mysql/2012080700.sql @@ -0,0 +1,5 @@ +-- Updates from version 0.8 + +ALTER TABLE `cache` DROP COLUMN `cache_id`; +ALTER TABLE `users` DROP COLUMN `alias`; +ALTER TABLE `identities` ADD INDEX `email_identities_index` (`email`, `del`); diff --git a/ruty/mails/SQL/mysql/2013011000.sql b/ruty/mails/SQL/mysql/2013011000.sql new file mode 100644 index 0000000..d1ea001 --- /dev/null +++ b/ruty/mails/SQL/mysql/2013011000.sql @@ -0,0 +1,7 @@ +-- Upgrade from 0.9-beta + +CREATE TABLE IF NOT EXISTS `system` ( + `name` varchar(64) NOT NULL, + `value` mediumtext, + PRIMARY KEY(`name`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; diff --git a/ruty/mails/SQL/mysql/2013042700.sql b/ruty/mails/SQL/mysql/2013042700.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/mysql/2013042700.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/mysql/2013052500.sql b/ruty/mails/SQL/mysql/2013052500.sql new file mode 100644 index 0000000..b5f72b8 --- /dev/null +++ b/ruty/mails/SQL/mysql/2013052500.sql @@ -0,0 +1,7 @@ +CREATE TABLE `cache_shared` ( + `cache_key` varchar(255) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL, + `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `data` longtext NOT NULL, + INDEX `created_index` (`created`), + INDEX `cache_key_index` (`cache_key`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; diff --git a/ruty/mails/SQL/mysql/2013061000.sql b/ruty/mails/SQL/mysql/2013061000.sql new file mode 100644 index 0000000..54041b3 --- /dev/null +++ b/ruty/mails/SQL/mysql/2013061000.sql @@ -0,0 +1,24 @@ +ALTER TABLE `cache` ADD `expires` datetime DEFAULT NULL; +ALTER TABLE `cache_shared` ADD `expires` datetime DEFAULT NULL; +ALTER TABLE `cache_index` ADD `expires` datetime DEFAULT NULL; +ALTER TABLE `cache_thread` ADD `expires` datetime DEFAULT NULL; +ALTER TABLE `cache_messages` ADD `expires` datetime DEFAULT NULL; + +-- initialize expires column with created/changed date + 7days +UPDATE `cache` SET `expires` = `created` + interval 604800 second; +UPDATE `cache_shared` SET `expires` = `created` + interval 604800 second; +UPDATE `cache_index` SET `expires` = `changed` + interval 604800 second; +UPDATE `cache_thread` SET `expires` = `changed` + interval 604800 second; +UPDATE `cache_messages` SET `expires` = `changed` + interval 604800 second; + +ALTER TABLE `cache` DROP INDEX `created_index`; +ALTER TABLE `cache_shared` DROP INDEX `created_index`; +ALTER TABLE `cache_index` DROP `changed`; +ALTER TABLE `cache_thread` DROP `changed`; +ALTER TABLE `cache_messages` DROP `changed`; + +ALTER TABLE `cache` ADD INDEX `expires_index` (`expires`); +ALTER TABLE `cache_shared` ADD INDEX `expires_index` (`expires`); +ALTER TABLE `cache_index` ADD INDEX `expires_index` (`expires`); +ALTER TABLE `cache_thread` ADD INDEX `expires_index` (`expires`); +ALTER TABLE `cache_messages` ADD INDEX `expires_index` (`expires`); diff --git a/ruty/mails/SQL/mysql/2014042900.sql b/ruty/mails/SQL/mysql/2014042900.sql new file mode 100644 index 0000000..9d93716 --- /dev/null +++ b/ruty/mails/SQL/mysql/2014042900.sql @@ -0,0 +1 @@ +ALTER TABLE `users` CHANGE `preferences` `preferences` longtext; diff --git a/ruty/mails/SQL/mysql/2015030800.sql b/ruty/mails/SQL/mysql/2015030800.sql new file mode 100644 index 0000000..5ff6f14 --- /dev/null +++ b/ruty/mails/SQL/mysql/2015030800.sql @@ -0,0 +1 @@ +ALTER TABLE `identities` CHANGE `signature` `signature` longtext; diff --git a/ruty/mails/SQL/mysql/2015111100.sql b/ruty/mails/SQL/mysql/2015111100.sql new file mode 100644 index 0000000..08ea8fc --- /dev/null +++ b/ruty/mails/SQL/mysql/2015111100.sql @@ -0,0 +1,3 @@ +ALTER TABLE `users` + ADD `failed_login` datetime DEFAULT NULL, + ADD `failed_login_counter` int(10) UNSIGNED DEFAULT NULL; diff --git a/ruty/mails/SQL/mysql/2016081200.sql b/ruty/mails/SQL/mysql/2016081200.sql new file mode 100644 index 0000000..aa09087 --- /dev/null +++ b/ruty/mails/SQL/mysql/2016081200.sql @@ -0,0 +1 @@ +ALTER TABLE `session` DROP COLUMN `created`; diff --git a/ruty/mails/SQL/mysql/2016100900.sql b/ruty/mails/SQL/mysql/2016100900.sql new file mode 100644 index 0000000..ea096e9 --- /dev/null +++ b/ruty/mails/SQL/mysql/2016100900.sql @@ -0,0 +1 @@ +ALTER TABLE `session` MODIFY `ip` varchar(40) NOT NULL; diff --git a/ruty/mails/SQL/mysql/2016112200.sql b/ruty/mails/SQL/mysql/2016112200.sql new file mode 100644 index 0000000..1bfc9ef --- /dev/null +++ b/ruty/mails/SQL/mysql/2016112200.sql @@ -0,0 +1,25 @@ +-- redundant column, for compat. with Galera Cluster +ALTER TABLE `dictionary` ADD COLUMN `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; + +DROP TABLE `cache`; +DROP TABLE `cache_shared`; + +CREATE TABLE `cache` ( + `user_id` int(10) UNSIGNED NOT NULL, + `cache_key` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL, + `expires` datetime DEFAULT NULL, + `data` longtext NOT NULL, + PRIMARY KEY (`user_id`, `cache_key`), + CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `expires_index` (`expires`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; + + +CREATE TABLE `cache_shared` ( + `cache_key` varchar(255) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL, + `expires` datetime DEFAULT NULL, + `data` longtext NOT NULL, + PRIMARY KEY (`cache_key`), + INDEX `expires_index` (`expires`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; diff --git a/ruty/mails/SQL/mysql/2018021600.sql b/ruty/mails/SQL/mysql/2018021600.sql new file mode 100644 index 0000000..ed72c0e --- /dev/null +++ b/ruty/mails/SQL/mysql/2018021600.sql @@ -0,0 +1,11 @@ +CREATE TABLE `filestore` ( + `file_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL, + `filename` varchar(128) NOT NULL, + `mtime` int(10) NOT NULL, + `data` longtext NOT NULL, + PRIMARY KEY (`file_id`), + CONSTRAINT `user_id_fk_filestore` FOREIGN KEY (`user_id`) + REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE `uniqueness` (`user_id`, `filename`) +) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; diff --git a/ruty/mails/SQL/mysql/2018122300.sql b/ruty/mails/SQL/mysql/2018122300.sql new file mode 100644 index 0000000..26e90a1 --- /dev/null +++ b/ruty/mails/SQL/mysql/2018122300.sql @@ -0,0 +1,7 @@ +ALTER TABLE `filestore` ADD COLUMN `context` varchar(32) NOT NULL; +UPDATE `filestore` SET `context` = 'enigma'; +ALTER TABLE `filestore` DROP FOREIGN KEY `user_id_fk_filestore`; +ALTER TABLE `filestore` DROP INDEX `uniqueness`; +ALTER TABLE `filestore` ADD UNIQUE INDEX `uniqueness` (`user_id`, `context`, `filename`); +ALTER TABLE `filestore` ADD CONSTRAINT `user_id_fk_filestore` FOREIGN KEY (`user_id`) + REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/ruty/mails/SQL/mysql/2019092900.sql b/ruty/mails/SQL/mysql/2019092900.sql new file mode 100644 index 0000000..204b159 --- /dev/null +++ b/ruty/mails/SQL/mysql/2019092900.sql @@ -0,0 +1,2 @@ +ALTER TABLE `cache` CHANGE `cache_key` `cache_key` varchar(128) BINARY NOT NULL; +ALTER TABLE `cache_shared` CHANGE `cache_key` `cache_key` varchar(255) BINARY NOT NULL; diff --git a/ruty/mails/SQL/mysql/2020020100.sql b/ruty/mails/SQL/mysql/2020020100.sql new file mode 100644 index 0000000..51b2f77 --- /dev/null +++ b/ruty/mails/SQL/mysql/2020020100.sql @@ -0,0 +1,2 @@ +ALTER TABLE `users` MODIFY `language` varchar(16); +ALTER TABLE `dictionary` MODIFY `language` varchar(16) NOT NULL; diff --git a/ruty/mails/SQL/mysql/2020020101.sql b/ruty/mails/SQL/mysql/2020020101.sql new file mode 100644 index 0000000..0a0402b --- /dev/null +++ b/ruty/mails/SQL/mysql/2020020101.sql @@ -0,0 +1,70 @@ +-- Dropping foreign keys and changing table format is needed for some versions of MySQL (#7277) +ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`; +ALTER TABLE `cache_index` DROP FOREIGN KEY `user_id_fk_cache_index`; +ALTER TABLE `cache_thread` DROP FOREIGN KEY `user_id_fk_cache_thread`; +ALTER TABLE `cache_messages` DROP FOREIGN KEY `user_id_fk_cache_messages`; +ALTER TABLE `contactgroups` DROP FOREIGN KEY `user_id_fk_contactgroups`; +ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`; +ALTER TABLE `dictionary` DROP FOREIGN KEY `user_id_fk_dictionary`; +ALTER TABLE `filestore` DROP FOREIGN KEY `user_id_fk_filestore`; +ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`; +ALTER TABLE `searches` DROP FOREIGN KEY `user_id_fk_searches`; + +ALTER TABLE `session` ROW_FORMAT=DYNAMIC; +ALTER TABLE `users` ROW_FORMAT=DYNAMIC; +ALTER TABLE `cache` ROW_FORMAT=DYNAMIC; +ALTER TABLE `cache_shared` ROW_FORMAT=DYNAMIC; +ALTER TABLE `cache_index` ROW_FORMAT=DYNAMIC; +ALTER TABLE `cache_thread` ROW_FORMAT=DYNAMIC; +ALTER TABLE `cache_messages` ROW_FORMAT=DYNAMIC; +ALTER TABLE `contacts` ROW_FORMAT=DYNAMIC; +ALTER TABLE `contactgroups` ROW_FORMAT=DYNAMIC; +ALTER TABLE `contactgroupmembers` ROW_FORMAT=DYNAMIC; +ALTER TABLE `identities` ROW_FORMAT=DYNAMIC; +ALTER TABLE `dictionary` ROW_FORMAT=DYNAMIC; +ALTER TABLE `searches` ROW_FORMAT=DYNAMIC; +ALTER TABLE `filestore` ROW_FORMAT=DYNAMIC; +ALTER TABLE `system` ROW_FORMAT=DYNAMIC; + +ALTER TABLE `session` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `users` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `cache_shared` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `cache_index` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `cache_thread` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `cache_messages` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `contacts` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `contactgroups` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `identities` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `dictionary` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `searches` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `filestore` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `system` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +ALTER TABLE `users` CHANGE `username` `username` varchar(128) BINARY NOT NULL; +ALTER TABLE `cache` CHANGE `cache_key` `cache_key` varchar(128) BINARY NOT NULL; +ALTER TABLE `cache_shared` CHANGE `cache_key` `cache_key` varchar(255) BINARY NOT NULL; +ALTER TABLE `cache_index` CHANGE `mailbox` `mailbox` varchar(255) BINARY NOT NULL; +ALTER TABLE `cache_thread` CHANGE `mailbox` `mailbox` varchar(255) BINARY NOT NULL; +ALTER TABLE `cache_messages` CHANGE `mailbox` `mailbox` varchar(255) BINARY NOT NULL; + +ALTER TABLE `cache` + ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `cache_index` + ADD CONSTRAINT `user_id_fk_cache_index` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `cache_thread` + ADD CONSTRAINT `user_id_fk_cache_thread` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `cache_messages` + ADD CONSTRAINT `user_id_fk_cache_messages` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `contactgroups` + ADD CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `contacts` + ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `dictionary` + ADD CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `filestore` + ADD CONSTRAINT `user_id_fk_filestore` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `identities` + ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `searches` + ADD CONSTRAINT `user_id_fk_searches` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/ruty/mails/SQL/mysql/2020091000.sql b/ruty/mails/SQL/mysql/2020091000.sql new file mode 100644 index 0000000..aa098e3 --- /dev/null +++ b/ruty/mails/SQL/mysql/2020091000.sql @@ -0,0 +1,12 @@ +CREATE TABLE `collected_addresses` ( + `address_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `name` varchar(255) NOT NULL DEFAULT '', + `email` varchar(255) NOT NULL, + `user_id` int(10) UNSIGNED NOT NULL, + `type` int(10) UNSIGNED NOT NULL, + PRIMARY KEY(`address_id`), + CONSTRAINT `user_id_fk_collected_addresses` FOREIGN KEY (`user_id`) + REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE INDEX `user_email_collected_addresses_index` (`user_id`, `type`, `email`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; diff --git a/ruty/mails/SQL/mysql/2020122900.sql b/ruty/mails/SQL/mysql/2020122900.sql new file mode 100644 index 0000000..0711ed9 --- /dev/null +++ b/ruty/mails/SQL/mysql/2020122900.sql @@ -0,0 +1 @@ +-- empty diff --git a/ruty/mails/SQL/mysql/2021081000.sql b/ruty/mails/SQL/mysql/2021081000.sql new file mode 100644 index 0000000..19068d1 --- /dev/null +++ b/ruty/mails/SQL/mysql/2021081000.sql @@ -0,0 +1,13 @@ +CREATE TABLE `responses` ( + `response_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` int(10) UNSIGNED NOT NULL, + `name` varchar(255) NOT NULL, + `data` longtext NOT NULL, + `is_html` tinyint(1) NOT NULL DEFAULT '0', + `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', + `del` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`response_id`), + CONSTRAINT `user_id_fk_responses` FOREIGN KEY (`user_id`) + REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + INDEX `user_responses_index` (`user_id`, `del`) +) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; diff --git a/ruty/mails/SQL/mysql/2021100300.sql b/ruty/mails/SQL/mysql/2021100300.sql new file mode 100644 index 0000000..49daeda --- /dev/null +++ b/ruty/mails/SQL/mysql/2021100300.sql @@ -0,0 +1 @@ +-- SQLite only \ No newline at end of file diff --git a/ruty/mails/SQL/mysql/2022081200.sql b/ruty/mails/SQL/mysql/2022081200.sql new file mode 100644 index 0000000..105e39e --- /dev/null +++ b/ruty/mails/SQL/mysql/2022081200.sql @@ -0,0 +1 @@ +-- SQLite/Postgres only \ No newline at end of file diff --git a/ruty/mails/SQL/oracle.initial.sql b/ruty/mails/SQL/oracle.initial.sql new file mode 100644 index 0000000..989681c --- /dev/null +++ b/ruty/mails/SQL/oracle.initial.sql @@ -0,0 +1,288 @@ +-- Roundcube Webmail initial database structure +-- This was tested with Oracle 11g + +CREATE TABLE "users" ( + "user_id" integer PRIMARY KEY, + "username" varchar(128) NOT NULL, + "mail_host" varchar(128) NOT NULL, + "created" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "last_login" timestamp with time zone DEFAULT NULL, + "failed_login" timestamp with time zone DEFAULT NULL, + "failed_login_counter" integer DEFAULT NULL, + "language" varchar(16), + "preferences" long DEFAULT NULL, + CONSTRAINT "users_username_key" UNIQUE ("username", "mail_host") +); + +CREATE SEQUENCE "users_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "users_seq_trig" +BEFORE INSERT ON "users" FOR EACH ROW +BEGIN + :NEW."user_id" := "users_seq".nextval; +END; +/ + +CREATE TABLE "session" ( + "sess_id" varchar(128) NOT NULL PRIMARY KEY, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "ip" varchar(41) NOT NULL, + "vars" long NOT NULL +); + +CREATE INDEX "session_changed_idx" ON "session" ("changed"); + + +CREATE TABLE "identities" ( + "identity_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "del" smallint DEFAULT 0 NOT NULL, + "standard" smallint DEFAULT 0 NOT NULL, + "name" varchar(128) NOT NULL, + "organization" varchar(128), + "email" varchar(128) NOT NULL, + "reply-to" varchar(128), + "bcc" varchar(128), + "signature" long, + "html_signature" integer DEFAULT 0 NOT NULL +); + +CREATE INDEX "identities_user_id_idx" ON "identities" ("user_id", "del"); +CREATE INDEX "identities_email_idx" ON "identities" ("email", "del"); + +CREATE SEQUENCE "identities_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "identities_seq_trig" +BEFORE INSERT ON "identities" FOR EACH ROW +BEGIN + :NEW."identity_id" := "identities_seq".nextval; +END; +/ + + +CREATE TABLE "responses" ( + "response_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "del" smallint DEFAULT 0 NOT NULL, + "name" varchar(128) NOT NULL, + "data" long NOT NULL, + "is_html" smallint DEFAULT 0 NOT NULL +); + +CREATE INDEX "responses_user_id_idx" ON "responses" ("user_id", "del"); + +CREATE SEQUENCE "responses_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "responses_seq_trig" +BEFORE INSERT ON "responses" FOR EACH ROW +BEGIN + :NEW."response_id" := "response_seq".nextval; +END; +/ + + +CREATE TABLE "collected_addresses" ( + "address_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "name" varchar(255) DEFAULT NULL, + "email" varchar(255) DEFAULT NULL, + "type" integer NOT NULL +); + +CREATE UNIQUE INDEX "collected_addresses_user_id_idx" ON "collected_addresses" ("user_id", "type", "email"); + +CREATE SEQUENCE "collected_addresses_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "collected_addresses_seq_trig" +BEFORE INSERT ON "collected_addresses" FOR EACH ROW +BEGIN + :NEW."address_id" := "collected_addresses_seq".nextval; +END; +/ + +CREATE TABLE "contacts" ( + "contact_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "del" smallint DEFAULT 0 NOT NULL, + "name" varchar(128) DEFAULT NULL, + "email" varchar(4000) DEFAULT NULL, + "firstname" varchar(128) DEFAULT NULL, + "surname" varchar(128) DEFAULT NULL, + "vcard" long, + "words" varchar(4000) +); + +CREATE INDEX "contacts_user_id_idx" ON "contacts" ("user_id", "del"); + +CREATE SEQUENCE "contacts_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "contacts_seq_trig" +BEFORE INSERT ON "contacts" FOR EACH ROW +BEGIN + :NEW."contact_id" := "contacts_seq".nextval; +END; +/ + +CREATE TABLE "contactgroups" ( + "contactgroup_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "del" smallint DEFAULT 0 NOT NULL, + "name" varchar(128) NOT NULL +); + +CREATE INDEX "contactgroups_user_id_idx" ON "contactgroups" ("user_id", "del"); + +CREATE SEQUENCE "contactgroups_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "contactgroups_seq_trig" +BEFORE INSERT ON "contactgroups" FOR EACH ROW +BEGIN + :NEW."contactgroup_id" := "contactgroups_seq".nextval; +END; +/ + +CREATE TABLE "contactgroupmembers" ( + "contactgroup_id" integer NOT NULL + REFERENCES "contactgroups" ("contactgroup_id") ON DELETE CASCADE, + "contact_id" integer NOT NULL + REFERENCES "contacts" ("contact_id") ON DELETE CASCADE, + "created" timestamp with time zone DEFAULT current_timestamp NOT NULL, + PRIMARY KEY ("contactgroup_id", "contact_id") +); + +CREATE INDEX "contactgroupmembers_idx" ON "contactgroupmembers" ("contact_id"); + + +CREATE TABLE "cache" ( + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "cache_key" varchar(128) NOT NULL, + "expires" timestamp with time zone DEFAULT NULL, + "data" long NOT NULL, + PRIMARY KEY ("user_id", "cache_key") +); + +CREATE INDEX "cache_expires_idx" ON "cache" ("expires"); + + +CREATE TABLE "cache_shared" ( + "cache_key" varchar(255) NOT NULL, + "expires" timestamp with time zone DEFAULT NULL, + "data" long NOT NULL, + PRIMARY KEY ("cache_key") +); + +CREATE INDEX "cache_shared_expires_idx" ON "cache_shared" ("expires"); + + +CREATE TABLE "cache_index" ( + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "mailbox" varchar(255) NOT NULL, + "expires" timestamp with time zone DEFAULT NULL, + "valid" smallint DEFAULT 0 NOT NULL, + "data" long NOT NULL, + PRIMARY KEY ("user_id", "mailbox") +); + +CREATE INDEX "cache_index_expires_idx" ON "cache_index" ("expires"); + + +CREATE TABLE "cache_thread" ( + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "mailbox" varchar(255) NOT NULL, + "expires" timestamp with time zone DEFAULT NULL, + "data" long NOT NULL, + PRIMARY KEY ("user_id", "mailbox") +); + +CREATE INDEX "cache_thread_expires_idx" ON "cache_thread" ("expires"); + + +CREATE TABLE "cache_messages" ( + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "mailbox" varchar(255) NOT NULL, + "uid" integer NOT NULL, + "expires" timestamp with time zone DEFAULT NULL, + "data" long NOT NULL, + "flags" integer DEFAULT 0 NOT NULL, + PRIMARY KEY ("user_id", "mailbox", "uid") +); + +CREATE INDEX "cache_messages_expires_idx" ON "cache_messages" ("expires"); + + +CREATE TABLE "dictionary" ( + "user_id" integer DEFAULT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "language" varchar(16) NOT NULL, + "data" long DEFAULT NULL, + CONSTRAINT "dictionary_user_id_lang_key" UNIQUE ("user_id", "language") +); + + +CREATE TABLE "searches" ( + "search_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "type" smallint DEFAULT 0 NOT NULL, + "name" varchar(128) NOT NULL, + "data" long NOT NULL, + CONSTRAINT "searches_user_id_key" UNIQUE ("user_id", "type", "name") +); + +CREATE SEQUENCE "searches_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "searches_seq_trig" +BEFORE INSERT ON "searches" FOR EACH ROW +BEGIN + :NEW."search_id" := "searches_seq".nextval; +END; +/ + +CREATE TABLE "filestore" ( + "file_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE ON UPDATE CASCADE, + "context" varchar(32) NOT NULL, + "filename" varchar(128) NOT NULL, + "mtime" integer NOT NULL, + "data" long, + CONSTRAINT "filestore_user_id_key" UNIQUE ("user_id", "context", "filename") +); + +CREATE SEQUENCE "filestore_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "filestore_seq_trig" +BEFORE INSERT ON "filestore" FOR EACH ROW +BEGIN + :NEW."user_id" := "filestore_seq".nextval; +END; +/ + +CREATE TABLE "system" ( + "name" varchar(64) NOT NULL PRIMARY KEY, + "value" long +); + +INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2022081200'); diff --git a/ruty/mails/SQL/oracle/2015030800.sql b/ruty/mails/SQL/oracle/2015030800.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/oracle/2015030800.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/oracle/2015111100.sql b/ruty/mails/SQL/oracle/2015111100.sql new file mode 100644 index 0000000..010203f --- /dev/null +++ b/ruty/mails/SQL/oracle/2015111100.sql @@ -0,0 +1,2 @@ +ALTER TABLE "users" ADD "failed_login" timestamp with time zone DEFAULT NULL; +ALTER TABLE "users" ADD "failed_login_counter" integer DEFAULT NULL; diff --git a/ruty/mails/SQL/oracle/2016081200.sql b/ruty/mails/SQL/oracle/2016081200.sql new file mode 100644 index 0000000..aacfe41 --- /dev/null +++ b/ruty/mails/SQL/oracle/2016081200.sql @@ -0,0 +1 @@ +ALTER TABLE "session" DROP COLUMN "created"; diff --git a/ruty/mails/SQL/oracle/2016100900.sql b/ruty/mails/SQL/oracle/2016100900.sql new file mode 100644 index 0000000..030f169 --- /dev/null +++ b/ruty/mails/SQL/oracle/2016100900.sql @@ -0,0 +1 @@ +ALTER TABLE "session" MODIFY "ip" varchar(41) NOT NULL; diff --git a/ruty/mails/SQL/oracle/2016112200.sql b/ruty/mails/SQL/oracle/2016112200.sql new file mode 100644 index 0000000..3aab265 --- /dev/null +++ b/ruty/mails/SQL/oracle/2016112200.sql @@ -0,0 +1,23 @@ +DROP TABLE "cache"; +DROP TABLE "cache_shared"; + +CREATE TABLE "cache" ( + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "cache_key" varchar(128) NOT NULL, + "expires" timestamp with time zone DEFAULT NULL, + "data" long NOT NULL, + PRIMARY KEY ("user_id", "cache_key") +); + +CREATE INDEX "cache_expires_idx" ON "cache" ("expires"); + + +CREATE TABLE "cache_shared" ( + "cache_key" varchar(255) NOT NULL, + "expires" timestamp with time zone DEFAULT NULL, + "data" long NOT NULL, + PRIMARY KEY ("cache_key") +); + +CREATE INDEX "cache_shared_expires_idx" ON "cache_shared" ("expires"); diff --git a/ruty/mails/SQL/oracle/2018021600.sql b/ruty/mails/SQL/oracle/2018021600.sql new file mode 100644 index 0000000..2fe3bcd --- /dev/null +++ b/ruty/mails/SQL/oracle/2018021600.sql @@ -0,0 +1,19 @@ +CREATE TABLE "filestore" ( + "file_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE ON UPDATE CASCADE, + "filename" varchar(128) NOT NULL, + "mtime" integer NOT NULL, + "data" long, + CONSTRAINT "filestore_user_id_key" UNIQUE ("user_id", "filename") +); + +CREATE SEQUENCE "filestore_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "filestore_seq_trig" +BEFORE INSERT ON "filestore" FOR EACH ROW +BEGIN + :NEW."user_id" := "filestore_seq".nextval; +END; +/ diff --git a/ruty/mails/SQL/oracle/2018122300.sql b/ruty/mails/SQL/oracle/2018122300.sql new file mode 100644 index 0000000..dd75dfc --- /dev/null +++ b/ruty/mails/SQL/oracle/2018122300.sql @@ -0,0 +1,4 @@ +ALTER TABLE "filestore" ADD COLUMN "context" varchar(32) NOT NULL; +UPDATE "filestore" SET "context" = 'enigma'; +ALTER TABLE "filestore" DROP CONSTRAINT "filestore_user_id_key"; +ALTER TABLE "filestore" ADD CONSTRAINT "filestore_user_id_key" UNIQUE ("user_id", "context", "filename"); diff --git a/ruty/mails/SQL/oracle/2019092900.sql b/ruty/mails/SQL/oracle/2019092900.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/oracle/2019092900.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/oracle/2020020100.sql b/ruty/mails/SQL/oracle/2020020100.sql new file mode 100644 index 0000000..2590179 --- /dev/null +++ b/ruty/mails/SQL/oracle/2020020100.sql @@ -0,0 +1,2 @@ +ALTER TABLE "users" MODIFY "language" varchar(16) NOT NULL; +ALTER TABLE "dictionary" MODIFY "language" varchar(16); diff --git a/ruty/mails/SQL/oracle/2020020101.sql b/ruty/mails/SQL/oracle/2020020101.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/oracle/2020020101.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/oracle/2020091000.sql b/ruty/mails/SQL/oracle/2020091000.sql new file mode 100644 index 0000000..0e598cd --- /dev/null +++ b/ruty/mails/SQL/oracle/2020091000.sql @@ -0,0 +1,21 @@ +CREATE TABLE "collected_addresses" ( + "address_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "name" varchar(255) DEFAULT NULL, + "email" varchar(255) DEFAULT NULL, + "type" integer NOT NULL +); + +CREATE UNIQUE INDEX "collected_addresses_user_id_idx" ON "collected_addresses" ("user_id", "type", "email"); + +CREATE SEQUENCE "collected_addresses_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "collected_addresses_seq_trig" +BEFORE INSERT ON "collected_addresses" FOR EACH ROW +BEGIN + :NEW."address_id" := "collected_addresses_seq".nextval; +END; +/ diff --git a/ruty/mails/SQL/oracle/2020122900.sql b/ruty/mails/SQL/oracle/2020122900.sql new file mode 100644 index 0000000..73cbb58 --- /dev/null +++ b/ruty/mails/SQL/oracle/2020122900.sql @@ -0,0 +1 @@ +--empty \ No newline at end of file diff --git a/ruty/mails/SQL/oracle/2021081000.sql b/ruty/mails/SQL/oracle/2021081000.sql new file mode 100644 index 0000000..fb99b5d --- /dev/null +++ b/ruty/mails/SQL/oracle/2021081000.sql @@ -0,0 +1,22 @@ +CREATE TABLE "responses" ( + "response_id" integer PRIMARY KEY, + "user_id" integer NOT NULL + REFERENCES "users" ("user_id") ON DELETE CASCADE, + "changed" timestamp with time zone DEFAULT current_timestamp NOT NULL, + "del" smallint DEFAULT 0 NOT NULL, + "name" varchar(128) NOT NULL, + "data" long NOT NULL, + "is_html" smallint DEFAULT 0 NOT NULL +); + +CREATE INDEX "responses_user_id_idx" ON "responses" ("user_id", "del"); + +CREATE SEQUENCE "responses_seq" + START WITH 1 INCREMENT BY 1 NOMAXVALUE; + +CREATE TRIGGER "responses_seq_trig" +BEFORE INSERT ON "responses" FOR EACH ROW +BEGIN + :NEW."response_id" := "response_seq".nextval; +END; +/ diff --git a/ruty/mails/SQL/oracle/2021100300.sql b/ruty/mails/SQL/oracle/2021100300.sql new file mode 100644 index 0000000..49daeda --- /dev/null +++ b/ruty/mails/SQL/oracle/2021100300.sql @@ -0,0 +1 @@ +-- SQLite only \ No newline at end of file diff --git a/ruty/mails/SQL/oracle/2022081200.sql b/ruty/mails/SQL/oracle/2022081200.sql new file mode 100644 index 0000000..105e39e --- /dev/null +++ b/ruty/mails/SQL/oracle/2022081200.sql @@ -0,0 +1 @@ +-- SQLite/Postgres only \ No newline at end of file diff --git a/ruty/mails/SQL/postgres.initial.sql b/ruty/mails/SQL/postgres.initial.sql new file mode 100644 index 0000000..209f006 --- /dev/null +++ b/ruty/mails/SQL/postgres.initial.sql @@ -0,0 +1,378 @@ +-- Roundcube Webmail initial database structure + +-- +-- Sequence "users_seq" +-- Name: users_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE users_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "users" +-- Name: users; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE users ( + user_id integer DEFAULT nextval('users_seq'::text) PRIMARY KEY, + username varchar(128) DEFAULT '' NOT NULL, + mail_host varchar(128) DEFAULT '' NOT NULL, + created timestamp with time zone DEFAULT now() NOT NULL, + last_login timestamp with time zone, + failed_login timestamp with time zone, + failed_login_counter integer, + "language" varchar(16), + preferences text, + CONSTRAINT users_username_key UNIQUE (username, mail_host) +); + + +-- +-- Table "session" +-- Name: session; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE "session" ( + sess_id varchar(128) DEFAULT '' PRIMARY KEY, + changed timestamp with time zone DEFAULT now() NOT NULL, + ip varchar(41) NOT NULL, + vars text NOT NULL +); + +CREATE INDEX session_changed_idx ON session (changed); + + +-- +-- Sequence "identities_seq" +-- Name: identities_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE identities_seq + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "identities" +-- Name: identities; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE identities ( + identity_id integer DEFAULT nextval('identities_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + del smallint DEFAULT 0 NOT NULL, + standard smallint DEFAULT 0 NOT NULL, + name varchar(128) NOT NULL, + organization varchar(128), + email varchar(128) NOT NULL, + "reply-to" varchar(128), + bcc varchar(128), + signature text, + html_signature smallint DEFAULT 0 NOT NULL +); + +CREATE INDEX identities_user_id_idx ON identities (user_id, del); +CREATE INDEX identities_email_idx ON identities (email, del); + + +-- +-- Sequence "responses_seq" +-- Name: responses_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE responses_seq + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "responses" +-- Name: responses; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE responses ( + response_id integer DEFAULT nextval('responses_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + del smallint DEFAULT 0 NOT NULL, + name varchar(255) NOT NULL, + data text NOT NULL, + is_html smallint DEFAULT 0 NOT NULL +); + +CREATE INDEX responses_user_id_idx ON responses (user_id, del); + + +-- +-- Sequence "collected_addresses_seq" +-- Name: collected_addresses_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE collected_addresses_seq + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "collected_addresses" +-- Name: collected_addresses; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE collected_addresses ( + address_id integer DEFAULT nextval('collected_addresses_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + name varchar(255) DEFAULT '' NOT NULL, + email varchar(255) NOT NULL, + "type" integer NOT NULL +); + +CREATE UNIQUE INDEX collected_addresses_user_id_idx ON collected_addresses (user_id, "type", email); + + +-- +-- Sequence "contacts_seq" +-- Name: contacts_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE contacts_seq + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "contacts" +-- Name: contacts; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE contacts ( + contact_id integer DEFAULT nextval('contacts_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + del smallint DEFAULT 0 NOT NULL, + name varchar(128) DEFAULT '' NOT NULL, + email text DEFAULT '' NOT NULL, + firstname varchar(128) DEFAULT '' NOT NULL, + surname varchar(128) DEFAULT '' NOT NULL, + vcard text, + words text +); + +CREATE INDEX contacts_user_id_idx ON contacts (user_id, del); + +-- +-- Sequence "contactgroups_seq" +-- Name: contactgroups_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE contactgroups_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "contactgroups" +-- Name: contactgroups; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE contactgroups ( + contactgroup_id integer DEFAULT nextval('contactgroups_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + del smallint NOT NULL DEFAULT 0, + name varchar(128) NOT NULL DEFAULT '' +); + +CREATE INDEX contactgroups_user_id_idx ON contactgroups (user_id, del); + +-- +-- Table "contactgroupmembers" +-- Name: contactgroupmembers; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE contactgroupmembers ( + contactgroup_id integer NOT NULL + REFERENCES contactgroups(contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE, + contact_id integer NOT NULL + REFERENCES contacts(contact_id) ON DELETE CASCADE ON UPDATE CASCADE, + created timestamp with time zone DEFAULT now() NOT NULL, + PRIMARY KEY (contactgroup_id, contact_id) +); + +CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id); + +-- +-- Table "cache" +-- Name: cache; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE "cache" ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + cache_key varchar(128) DEFAULT '' NOT NULL, + expires timestamp with time zone, + data text NOT NULL, + PRIMARY KEY (user_id, cache_key) +); + +CREATE INDEX cache_expires_idx ON "cache" (expires); + +-- +-- Table "cache_shared" +-- Name: cache_shared; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE "cache_shared" ( + cache_key varchar(255) NOT NULL PRIMARY KEY, + expires timestamp with time zone, + data text NOT NULL +); + +CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires); + +-- +-- Table "cache_index" +-- Name: cache_index; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE cache_index ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + expires timestamp with time zone, + valid smallint NOT NULL DEFAULT 0, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX cache_index_expires_idx ON cache_index (expires); + +-- +-- Table "cache_thread" +-- Name: cache_thread; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE cache_thread ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + expires timestamp with time zone, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX cache_thread_expires_idx ON cache_thread (expires); + +-- +-- Table "cache_messages" +-- Name: cache_messages; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE cache_messages ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + uid integer NOT NULL, + expires timestamp with time zone, + data text NOT NULL, + flags integer NOT NULL DEFAULT 0, + PRIMARY KEY (user_id, mailbox, uid) +); + +CREATE INDEX cache_messages_expires_idx ON cache_messages (expires); + +-- +-- Table "dictionary" +-- Name: dictionary; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE dictionary ( + user_id integer + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + "language" varchar(16) NOT NULL, + data text NOT NULL, + CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language") +); + +-- +-- Sequence "searches_seq" +-- Name: searches_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE searches_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "searches" +-- Name: searches; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE searches ( + search_id integer DEFAULT nextval('searches_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + "type" smallint DEFAULT 0 NOT NULL, + name varchar(128) NOT NULL, + data text NOT NULL, + CONSTRAINT searches_user_id_key UNIQUE (user_id, "type", name) +); + +-- +-- Sequence "filestore_seq" +-- Name: filestore_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE "filestore_seq" + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +-- +-- Table "filestore" +-- Name: filestore; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE "filestore" ( + file_id integer DEFAULT nextval('filestore_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + context varchar(32) NOT NULL, + filename varchar(128) NOT NULL, + mtime integer NOT NULL, + data text NOT NULL, + CONSTRAINT filestore_user_id_filename UNIQUE (user_id, context, filename) +); + +-- +-- Table "system" +-- Name: system; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE "system" ( + name varchar(64) NOT NULL PRIMARY KEY, + value text +); + +INSERT INTO "system" (name, value) VALUES ('roundcube-version', '2022081200'); diff --git a/ruty/mails/SQL/postgres/2008030300.sql b/ruty/mails/SQL/postgres/2008030300.sql new file mode 100644 index 0000000..67a8f15 --- /dev/null +++ b/ruty/mails/SQL/postgres/2008030300.sql @@ -0,0 +1,18 @@ +-- Updates from version 0.1-stable to 0.1.1 + +CREATE INDEX cache_user_id_idx ON cache (user_id, cache_key); +CREATE INDEX contacts_user_id_idx ON contacts (user_id); +CREATE INDEX identities_user_id_idx ON identities (user_id); + +CREATE INDEX users_username_id_idx ON users (username); +CREATE INDEX users_alias_id_idx ON users (alias); + +-- added ON DELETE/UPDATE actions +ALTER TABLE messages DROP CONSTRAINT messages_user_id_fkey; +ALTER TABLE messages ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE identities DROP CONSTRAINT identities_user_id_fkey; +ALTER TABLE identities ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE contacts DROP CONSTRAINT contacts_user_id_fkey; +ALTER TABLE contacts ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE cache DROP CONSTRAINT cache_user_id_fkey; +ALTER TABLE cache ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/ruty/mails/SQL/postgres/2008060900.sql b/ruty/mails/SQL/postgres/2008060900.sql new file mode 100644 index 0000000..7c60a44 --- /dev/null +++ b/ruty/mails/SQL/postgres/2008060900.sql @@ -0,0 +1,3 @@ +-- Updates from version 0.2-alpha + +CREATE INDEX messages_created_idx ON messages (created); diff --git a/ruty/mails/SQL/postgres/2008092100.sql b/ruty/mails/SQL/postgres/2008092100.sql new file mode 100644 index 0000000..6cd1929 --- /dev/null +++ b/ruty/mails/SQL/postgres/2008092100.sql @@ -0,0 +1,14 @@ +-- Updates from version 0.2-beta + +ALTER TABLE cache DROP session_id; + +CREATE INDEX session_changed_idx ON session (changed); +CREATE INDEX cache_created_idx ON "cache" (created); + +ALTER TABLE users ALTER "language" DROP NOT NULL; +ALTER TABLE users ALTER "language" DROP DEFAULT; + +ALTER TABLE identities ALTER del TYPE smallint; +ALTER TABLE identities ALTER standard TYPE smallint; +ALTER TABLE contacts ALTER del TYPE smallint; +ALTER TABLE messages ALTER del TYPE smallint; diff --git a/ruty/mails/SQL/postgres/2009090400.sql b/ruty/mails/SQL/postgres/2009090400.sql new file mode 100644 index 0000000..8eb4949 --- /dev/null +++ b/ruty/mails/SQL/postgres/2009090400.sql @@ -0,0 +1,6 @@ +-- Updates from version 0.3-stable + +TRUNCATE messages; +CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx); +DROP INDEX contacts_user_id_idx; +CREATE INDEX contacts_user_id_idx ON contacts (user_id, email); diff --git a/ruty/mails/SQL/postgres/2009103100.sql b/ruty/mails/SQL/postgres/2009103100.sql new file mode 100644 index 0000000..2350f79 --- /dev/null +++ b/ruty/mails/SQL/postgres/2009103100.sql @@ -0,0 +1,32 @@ +-- Updates from version 0.3.1 + +DROP INDEX identities_user_id_idx; +CREATE INDEX identities_user_id_idx ON identities (user_id, del); + +ALTER TABLE identities ADD changed timestamp with time zone DEFAULT now() NOT NULL; + +CREATE SEQUENCE contactgroups_ids + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE TABLE contactgroups ( + contactgroup_id integer DEFAULT nextval('contactgroups_ids'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + del smallint NOT NULL DEFAULT 0, + name varchar(128) NOT NULL DEFAULT '' +); + +CREATE INDEX contactgroups_user_id_idx ON contactgroups (user_id, del); + +CREATE TABLE contactgroupmembers ( + contactgroup_id integer NOT NULL + REFERENCES contactgroups(contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE, + contact_id integer NOT NULL + REFERENCES contacts(contact_id) ON DELETE CASCADE ON UPDATE CASCADE, + created timestamp with time zone DEFAULT now() NOT NULL, + PRIMARY KEY (contactgroup_id, contact_id) +); diff --git a/ruty/mails/SQL/postgres/2010042300.sql b/ruty/mails/SQL/postgres/2010042300.sql new file mode 100644 index 0000000..bc9bd82 --- /dev/null +++ b/ruty/mails/SQL/postgres/2010042300.sql @@ -0,0 +1,4 @@ +-- Updates from version 0.4-beta + +ALTER TABLE users ALTER last_login DROP NOT NULL; +ALTER TABLE users ALTER last_login SET DEFAULT NULL; diff --git a/ruty/mails/SQL/postgres/2010100600.sql b/ruty/mails/SQL/postgres/2010100600.sql new file mode 100644 index 0000000..8dfcc12 --- /dev/null +++ b/ruty/mails/SQL/postgres/2010100600.sql @@ -0,0 +1,7 @@ +-- Updates from version 0.4.2 + +DROP INDEX users_username_id_idx; +ALTER TABLE users ADD CONSTRAINT users_username_key UNIQUE (username, mail_host); +ALTER TABLE contacts ALTER email TYPE varchar(255); + +TRUNCATE messages; diff --git a/ruty/mails/SQL/postgres/2011011200.sql b/ruty/mails/SQL/postgres/2011011200.sql new file mode 100644 index 0000000..db468d8 --- /dev/null +++ b/ruty/mails/SQL/postgres/2011011200.sql @@ -0,0 +1,7 @@ +-- Updates from version 0.5.x + +ALTER TABLE contacts ADD words TEXT NULL; +CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id); + +TRUNCATE messages; +TRUNCATE cache; diff --git a/ruty/mails/SQL/postgres/2011092800.sql b/ruty/mails/SQL/postgres/2011092800.sql new file mode 100644 index 0000000..fac3cd3 --- /dev/null +++ b/ruty/mails/SQL/postgres/2011092800.sql @@ -0,0 +1,64 @@ +-- Updates from version 0.6 + +CREATE TABLE dictionary ( + user_id integer DEFAULT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + "language" varchar(5) NOT NULL, + data text NOT NULL, + CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language") +); + +CREATE SEQUENCE search_ids + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE TABLE searches ( + search_id integer DEFAULT nextval('search_ids'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + "type" smallint DEFAULT 0 NOT NULL, + name varchar(128) NOT NULL, + data text NOT NULL, + CONSTRAINT searches_user_id_key UNIQUE (user_id, "type", name) +); + +DROP SEQUENCE message_ids; +DROP TABLE messages; + +CREATE TABLE cache_index ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + changed timestamp with time zone DEFAULT now() NOT NULL, + valid smallint NOT NULL DEFAULT 0, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX cache_index_changed_idx ON cache_index (changed); + +CREATE TABLE cache_thread ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + changed timestamp with time zone DEFAULT now() NOT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX cache_thread_changed_idx ON cache_thread (changed); + +CREATE TABLE cache_messages ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + uid integer NOT NULL, + changed timestamp with time zone DEFAULT now() NOT NULL, + data text NOT NULL, + flags integer NOT NULL DEFAULT 0, + PRIMARY KEY (user_id, mailbox, uid) +); + +CREATE INDEX cache_messages_changed_idx ON cache_messages (changed); diff --git a/ruty/mails/SQL/postgres/2011111600.sql b/ruty/mails/SQL/postgres/2011111600.sql new file mode 100644 index 0000000..a382ba0 --- /dev/null +++ b/ruty/mails/SQL/postgres/2011111600.sql @@ -0,0 +1,3 @@ +-- Updates from version 0.7-beta + +ALTER TABLE "session" ALTER sess_id TYPE varchar(128); diff --git a/ruty/mails/SQL/postgres/2011121400.sql b/ruty/mails/SQL/postgres/2011121400.sql new file mode 100644 index 0000000..81a0cb8 --- /dev/null +++ b/ruty/mails/SQL/postgres/2011121400.sql @@ -0,0 +1,5 @@ +-- Updates from version 0.7 + +DROP INDEX contacts_user_id_idx; +CREATE INDEX contacts_user_id_idx ON contacts USING btree (user_id, del); +ALTER TABLE contacts ALTER email TYPE text; diff --git a/ruty/mails/SQL/postgres/2012080700.sql b/ruty/mails/SQL/postgres/2012080700.sql new file mode 100644 index 0000000..41f6016 --- /dev/null +++ b/ruty/mails/SQL/postgres/2012080700.sql @@ -0,0 +1,7 @@ +-- Updates from version 0.8 + +ALTER TABLE cache DROP COLUMN cache_id; +DROP SEQUENCE cache_ids; + +ALTER TABLE users DROP COLUMN alias; +CREATE INDEX identities_email_idx ON identities (email, del); diff --git a/ruty/mails/SQL/postgres/2013011000.sql b/ruty/mails/SQL/postgres/2013011000.sql new file mode 100644 index 0000000..a8cf917 --- /dev/null +++ b/ruty/mails/SQL/postgres/2013011000.sql @@ -0,0 +1,4 @@ +CREATE TABLE "system" ( + name varchar(64) NOT NULL PRIMARY KEY, + value text +); diff --git a/ruty/mails/SQL/postgres/2013042700.sql b/ruty/mails/SQL/postgres/2013042700.sql new file mode 100644 index 0000000..bbd5675 --- /dev/null +++ b/ruty/mails/SQL/postgres/2013042700.sql @@ -0,0 +1,14 @@ +ALTER SEQUENCE user_ids RENAME TO users_seq; +ALTER TABLE users ALTER COLUMN user_id SET DEFAULT nextval('users_seq'::text); + +ALTER SEQUENCE identity_ids RENAME TO identities_seq; +ALTER TABLE identities ALTER COLUMN identity_id SET DEFAULT nextval('identities_seq'::text); + +ALTER SEQUENCE contact_ids RENAME TO contacts_seq; +ALTER TABLE contacts ALTER COLUMN contact_id SET DEFAULT nextval('contacts_seq'::text); + +ALTER SEQUENCE contactgroups_ids RENAME TO contactgroups_seq; +ALTER TABLE contactgroups ALTER COLUMN contactgroup_id SET DEFAULT nextval('contactgroups_seq'::text); + +ALTER SEQUENCE search_ids RENAME TO searches_seq; +ALTER TABLE searches ALTER COLUMN search_id SET DEFAULT nextval('searches_seq'::text); diff --git a/ruty/mails/SQL/postgres/2013052500.sql b/ruty/mails/SQL/postgres/2013052500.sql new file mode 100644 index 0000000..471e571 --- /dev/null +++ b/ruty/mails/SQL/postgres/2013052500.sql @@ -0,0 +1,8 @@ +CREATE TABLE "cache_shared" ( + cache_key varchar(255) NOT NULL, + created timestamp with time zone DEFAULT now() NOT NULL, + data text NOT NULL +); + +CREATE INDEX cache_shared_cache_key_idx ON "cache_shared" (cache_key); +CREATE INDEX cache_shared_created_idx ON "cache_shared" (created); diff --git a/ruty/mails/SQL/postgres/2013061000.sql b/ruty/mails/SQL/postgres/2013061000.sql new file mode 100644 index 0000000..9db0ebc --- /dev/null +++ b/ruty/mails/SQL/postgres/2013061000.sql @@ -0,0 +1,24 @@ +ALTER TABLE "cache" ADD expires timestamp with time zone DEFAULT NULL; +ALTER TABLE "cache_shared" ADD expires timestamp with time zone DEFAULT NULL; +ALTER TABLE "cache_index" ADD expires timestamp with time zone DEFAULT NULL; +ALTER TABLE "cache_thread" ADD expires timestamp with time zone DEFAULT NULL; +ALTER TABLE "cache_messages" ADD expires timestamp with time zone DEFAULT NULL; + +-- initialize expires column with created/changed date + 7days +UPDATE "cache" SET expires = created + interval '604800 seconds'; +UPDATE "cache_shared" SET expires = created + interval '604800 seconds'; +UPDATE "cache_index" SET expires = changed + interval '604800 seconds'; +UPDATE "cache_thread" SET expires = changed + interval '604800 seconds'; +UPDATE "cache_messages" SET expires = changed + interval '604800 seconds'; + +DROP INDEX cache_created_idx; +DROP INDEX cache_shared_created_idx; +ALTER TABLE "cache_index" DROP "changed"; +ALTER TABLE "cache_thread" DROP "changed"; +ALTER TABLE "cache_messages" DROP "changed"; + +CREATE INDEX cache_expires_idx ON "cache" (expires); +CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires); +CREATE INDEX cache_index_expires_idx ON "cache_index" (expires); +CREATE INDEX cache_thread_expires_idx ON "cache_thread" (expires); +CREATE INDEX cache_messages_expires_idx ON "cache_messages" (expires); diff --git a/ruty/mails/SQL/postgres/2014042900.sql b/ruty/mails/SQL/postgres/2014042900.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/postgres/2014042900.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/postgres/2015030800.sql b/ruty/mails/SQL/postgres/2015030800.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/postgres/2015030800.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/postgres/2015111100.sql b/ruty/mails/SQL/postgres/2015111100.sql new file mode 100644 index 0000000..3eea6d5 --- /dev/null +++ b/ruty/mails/SQL/postgres/2015111100.sql @@ -0,0 +1,2 @@ +ALTER TABLE "users" ADD failed_login timestamp with time zone DEFAULT NULL; +ALTER TABLE "users" ADD failed_login_counter integer DEFAULT NULL; diff --git a/ruty/mails/SQL/postgres/2016081200.sql b/ruty/mails/SQL/postgres/2016081200.sql new file mode 100644 index 0000000..7235b40 --- /dev/null +++ b/ruty/mails/SQL/postgres/2016081200.sql @@ -0,0 +1 @@ +ALTER TABLE "session" DROP COLUMN created; diff --git a/ruty/mails/SQL/postgres/2016100900.sql b/ruty/mails/SQL/postgres/2016100900.sql new file mode 100644 index 0000000..8eb7eed --- /dev/null +++ b/ruty/mails/SQL/postgres/2016100900.sql @@ -0,0 +1 @@ +ALTER TABLE session ALTER COLUMN ip TYPE character varying(41); diff --git a/ruty/mails/SQL/postgres/2016112200.sql b/ruty/mails/SQL/postgres/2016112200.sql new file mode 100644 index 0000000..34af971 --- /dev/null +++ b/ruty/mails/SQL/postgres/2016112200.sql @@ -0,0 +1,21 @@ +DROP TABLE "cache"; +DROP TABLE "cache_shared"; + +CREATE TABLE "cache" ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + cache_key varchar(128) DEFAULT '' NOT NULL, + expires timestamp with time zone DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, cache_key) +); + +CREATE INDEX cache_expires_idx ON "cache" (expires); + +CREATE TABLE "cache_shared" ( + cache_key varchar(255) NOT NULL PRIMARY KEY, + expires timestamp with time zone DEFAULT NULL, + data text NOT NULL +); + +CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires); diff --git a/ruty/mails/SQL/postgres/2018021600.sql b/ruty/mails/SQL/postgres/2018021600.sql new file mode 100644 index 0000000..e67ef1b --- /dev/null +++ b/ruty/mails/SQL/postgres/2018021600.sql @@ -0,0 +1,15 @@ +CREATE SEQUENCE "filestore_seq" + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE TABLE "filestore" ( + file_id integer DEFAULT nextval('filestore_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + filename varchar(128) NOT NULL, + mtime integer NOT NULL, + data text NOT NULL, + CONSTRAINT filestore_user_id_filename UNIQUE (user_id, filename) +); diff --git a/ruty/mails/SQL/postgres/2018122300.sql b/ruty/mails/SQL/postgres/2018122300.sql new file mode 100644 index 0000000..1a7d895 --- /dev/null +++ b/ruty/mails/SQL/postgres/2018122300.sql @@ -0,0 +1,5 @@ +ALTER TABLE "filestore" ADD COLUMN context varchar(32); +UPDATE "filestore" SET context = 'enigma'; +ALTER TABLE "filestore" ALTER COLUMN context SET NOT NULL; +ALTER TABLE "filestore" DROP CONSTRAINT "filestore_user_id_filename"; +ALTER TABLE "filestore" ADD CONSTRAINT "filestore_user_id_context_filename" UNIQUE (user_id, context, filename); diff --git a/ruty/mails/SQL/postgres/2019092900.sql b/ruty/mails/SQL/postgres/2019092900.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/postgres/2019092900.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/postgres/2020020100.sql b/ruty/mails/SQL/postgres/2020020100.sql new file mode 100644 index 0000000..f9c0e91 --- /dev/null +++ b/ruty/mails/SQL/postgres/2020020100.sql @@ -0,0 +1,2 @@ +ALTER TABLE "dictionary" ALTER COLUMN "language" TYPE varchar(16); +ALTER TABLE "users" ALTER COLUMN "language" TYPE varchar(16); diff --git a/ruty/mails/SQL/postgres/2020020101.sql b/ruty/mails/SQL/postgres/2020020101.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/postgres/2020020101.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/postgres/2020091000.sql b/ruty/mails/SQL/postgres/2020091000.sql new file mode 100644 index 0000000..fa618b3 --- /dev/null +++ b/ruty/mails/SQL/postgres/2020091000.sql @@ -0,0 +1,19 @@ + +CREATE SEQUENCE collected_addresses_seq + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE TABLE collected_addresses ( + address_id integer DEFAULT nextval('collected_addresses_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + name varchar(255) DEFAULT '' NOT NULL, + email varchar(255) NOT NULL, + "type" integer NOT NULL +); + +CREATE UNIQUE INDEX collected_addresses_user_id_idx ON collected_addresses (user_id, "type", email); diff --git a/ruty/mails/SQL/postgres/2020122900.sql b/ruty/mails/SQL/postgres/2020122900.sql new file mode 100644 index 0000000..4789533 --- /dev/null +++ b/ruty/mails/SQL/postgres/2020122900.sql @@ -0,0 +1,2 @@ +ALTER TABLE "users" ALTER COLUMN "preferences" DROP NOT NULL; +ALTER TABLE "users" ALTER COLUMN "preferences" SET DEFAULT NULL; diff --git a/ruty/mails/SQL/postgres/2021081000.sql b/ruty/mails/SQL/postgres/2021081000.sql new file mode 100644 index 0000000..8525521 --- /dev/null +++ b/ruty/mails/SQL/postgres/2021081000.sql @@ -0,0 +1,21 @@ +CREATE SEQUENCE responses_seq + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE TABLE responses ( + response_id integer DEFAULT nextval('responses_seq'::text) PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed timestamp with time zone DEFAULT now() NOT NULL, + del smallint DEFAULT 0 NOT NULL, + name varchar(255) NOT NULL, + data text NOT NULL, + is_html smallint DEFAULT 0 NOT NULL +); + +CREATE UNIQUE INDEX responses_user_id_idx ON responses (user_id, del); + +ALTER TABLE identities ALTER html_signature TYPE smallint; diff --git a/ruty/mails/SQL/postgres/2021100300.sql b/ruty/mails/SQL/postgres/2021100300.sql new file mode 100644 index 0000000..49daeda --- /dev/null +++ b/ruty/mails/SQL/postgres/2021100300.sql @@ -0,0 +1 @@ +-- SQLite only \ No newline at end of file diff --git a/ruty/mails/SQL/postgres/2022081200.sql b/ruty/mails/SQL/postgres/2022081200.sql new file mode 100644 index 0000000..fee9438 --- /dev/null +++ b/ruty/mails/SQL/postgres/2022081200.sql @@ -0,0 +1,2 @@ +DROP INDEX responses_user_id_idx; +CREATE INDEX responses_user_id_idx ON responses (user_id, del); diff --git a/ruty/mails/SQL/sqlite.initial.sql b/ruty/mails/SQL/sqlite.initial.sql new file mode 100644 index 0000000..dd8f2f5 --- /dev/null +++ b/ruty/mails/SQL/sqlite.initial.sql @@ -0,0 +1,263 @@ +-- Roundcube Webmail initial database structure + +-- +-- Table structure for table users +-- + +CREATE TABLE users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + failed_login datetime DEFAULT NULL, + failed_login_counter integer DEFAULT NULL, + language varchar(16), + preferences text DEFAULT NULL +); + +CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host); + +-- +-- Table structure for table contacts and related +-- + +CREATE TABLE contacts ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email text NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '', + words text NOT NULL default '' +); + +CREATE INDEX ix_contacts_user_id ON contacts(user_id, del); + + +CREATE TABLE contactgroups ( + contactgroup_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '' +); + +CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del); + + +CREATE TABLE contactgroupmembers ( + contactgroup_id integer NOT NULL + REFERENCES contactgroups(contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE, + contact_id integer NOT NULL + REFERENCES contacts(contact_id) ON DELETE CASCADE ON UPDATE CASCADE, + created datetime NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (contactgroup_id, contact_id) +); + +CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id); + +-- +-- Table structure for table collected_addresses +-- + +CREATE TABLE collected_addresses ( + address_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + name varchar(255) NOT NULL default '', + email varchar(255) NOT NULL, + "type" integer NOT NULL +); + +CREATE UNIQUE INDEX ix_collected_addresses_user_id ON collected_addresses(user_id, "type", email); + +-- +-- Table structure for table identities +-- + +CREATE TABLE identities ( + identity_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + standard tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + organization varchar(128) default '', + email varchar(128) NOT NULL default '', + "reply-to" varchar(128) NOT NULL default '', + bcc varchar(128) NOT NULL default '', + signature text NOT NULL default '', + html_signature tinyint NOT NULL default '0' +); + +CREATE INDEX ix_identities_user_id ON identities(user_id, del); +CREATE INDEX ix_identities_email ON identities(email, del); + +-- +-- Table structure for table responses +-- + +CREATE TABLE responses ( + response_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(255) NOT NULL, + data text NOT NULL, + is_html tinyint NOT NULL default '0' +); + +CREATE INDEX ix_responses_user_id ON responses(user_id, del); + +-- +-- Table structure for table session +-- + +CREATE TABLE session ( + sess_id varchar(128) NOT NULL PRIMARY KEY, + changed datetime NOT NULL default '0000-00-00 00:00:00', + ip varchar(40) NOT NULL default '', + vars text NOT NULL +); + +CREATE INDEX ix_session_changed ON session (changed); + +-- +-- Table structure for table dictionary +-- + +CREATE TABLE dictionary ( + user_id integer DEFAULT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + language varchar(16) NOT NULL, + data text NOT NULL +); + +CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, language); + +-- +-- Table structure for table searches +-- + +CREATE TABLE searches ( + search_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + "type" smallint NOT NULL DEFAULT '0', + name varchar(128) NOT NULL, + data text NOT NULL +); + +CREATE UNIQUE INDEX ix_searches_user_type_name ON searches (user_id, type, name); + +-- +-- Table structure for table cache +-- + +CREATE TABLE cache ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + cache_key varchar(128) NOT NULL default '', + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, cache_key) +); + +CREATE INDEX ix_cache_expires ON cache(expires); + +-- +-- Table structure for table cache_shared +-- + +CREATE TABLE cache_shared ( + cache_key varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (cache_key) +); + +CREATE INDEX ix_cache_shared_expires ON cache_shared(expires); + +-- +-- Table structure for table cache_index +-- + +CREATE TABLE cache_index ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + valid smallint NOT NULL DEFAULT '0', + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX ix_cache_index_expires ON cache_index (expires); + +-- +-- Table structure for table cache_thread +-- + +CREATE TABLE cache_thread ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX ix_cache_thread_expires ON cache_thread (expires); + +-- +-- Table structure for table cache_messages +-- + +CREATE TABLE cache_messages ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + uid integer NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + flags integer NOT NULL DEFAULT '0', + PRIMARY KEY (user_id, mailbox, uid) +); + +CREATE INDEX ix_cache_messages_expires ON cache_messages (expires); + +-- +-- Table structure for table filestore +-- + +CREATE TABLE filestore ( + file_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + context varchar(32) NOT NULL, + filename varchar(128) NOT NULL, + mtime integer NOT NULL, + data text NOT NULL +); + +CREATE UNIQUE INDEX ix_filestore_user_id ON filestore(user_id, context, filename); + +-- +-- Table structure for table system +-- + +CREATE TABLE system ( + name varchar(64) NOT NULL PRIMARY KEY, + value text NOT NULL +); + +INSERT INTO system (name, value) VALUES ('roundcube-version', '2022081200'); diff --git a/ruty/mails/SQL/sqlite/2008030300.sql b/ruty/mails/SQL/sqlite/2008030300.sql new file mode 100644 index 0000000..b5b4890 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2008030300.sql @@ -0,0 +1,25 @@ +-- Updates from version 0.1-stable to 0.1.1 + +DROP TABLE messages; + +CREATE TABLE messages ( + message_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + del tinyint NOT NULL default '0', + cache_key varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + idx integer NOT NULL default '0', + uid integer NOT NULL default '0', + subject varchar(255) NOT NULL default '', + "from" varchar(255) NOT NULL default '', + "to" varchar(255) NOT NULL default '', + "cc" varchar(255) NOT NULL default '', + "date" datetime NOT NULL default '0000-00-00 00:00:00', + size integer NOT NULL default '0', + headers text NOT NULL, + structure text +); + +CREATE INDEX ix_messages_user_cache_uid ON messages(user_id,cache_key,uid); +CREATE INDEX ix_users_username ON users(username); +CREATE INDEX ix_users_alias ON users(alias); diff --git a/ruty/mails/SQL/sqlite/2008060900.sql b/ruty/mails/SQL/sqlite/2008060900.sql new file mode 100644 index 0000000..157029c --- /dev/null +++ b/ruty/mails/SQL/sqlite/2008060900.sql @@ -0,0 +1,3 @@ +-- Updates from version 0.2-alpha + +CREATE INDEX ix_messages_created ON messages (created); diff --git a/ruty/mails/SQL/sqlite/2008092100.sql b/ruty/mails/SQL/sqlite/2008092100.sql new file mode 100644 index 0000000..8bc081c --- /dev/null +++ b/ruty/mails/SQL/sqlite/2008092100.sql @@ -0,0 +1,4 @@ +-- Updates from version 0.2-beta + +CREATE INDEX ix_session_changed ON session (changed); +CREATE INDEX ix_cache_created ON cache (created); diff --git a/ruty/mails/SQL/sqlite/2009090400.sql b/ruty/mails/SQL/sqlite/2009090400.sql new file mode 100644 index 0000000..c8a53ed --- /dev/null +++ b/ruty/mails/SQL/sqlite/2009090400.sql @@ -0,0 +1,8 @@ +-- Updates from version 0.3-stable + +DELETE FROM messages; +DROP INDEX ix_messages_user_cache_uid; +CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid); +CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx); +DROP INDEX ix_contacts_user_id; +CREATE INDEX ix_contacts_user_id ON contacts(user_id, email); diff --git a/ruty/mails/SQL/sqlite/2009103100.sql b/ruty/mails/SQL/sqlite/2009103100.sql new file mode 100644 index 0000000..bd7b174 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2009103100.sql @@ -0,0 +1,61 @@ +-- Updates from version 0.3.1 + +-- ALTER TABLE identities ADD COLUMN changed datetime NOT NULL default '0000-00-00 00:00:00'; -- + +CREATE TABLE temp_identities ( + identity_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + standard tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + organization varchar(128) default '', + email varchar(128) NOT NULL default '', + "reply-to" varchar(128) NOT NULL default '', + bcc varchar(128) NOT NULL default '', + signature text NOT NULL default '', + html_signature tinyint NOT NULL default '0' +); +INSERT INTO temp_identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature) + SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature + FROM identities WHERE del=0; + +DROP INDEX ix_identities_user_id; +DROP TABLE identities; + +CREATE TABLE identities ( + identity_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + standard tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + organization varchar(128) default '', + email varchar(128) NOT NULL default '', + "reply-to" varchar(128) NOT NULL default '', + bcc varchar(128) NOT NULL default '', + signature text NOT NULL default '', + html_signature tinyint NOT NULL default '0' +); +CREATE INDEX ix_identities_user_id ON identities(user_id, del); + +INSERT INTO identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature) + SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature + FROM temp_identities; + +DROP TABLE temp_identities; + +CREATE TABLE contactgroups ( + contactgroup_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '' +); + +CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del); + +CREATE TABLE contactgroupmembers ( + contactgroup_id integer NOT NULL, + contact_id integer NOT NULL default '0', + created datetime NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (contactgroup_id, contact_id) +); diff --git a/ruty/mails/SQL/sqlite/2010042300.sql b/ruty/mails/SQL/sqlite/2010042300.sql new file mode 100644 index 0000000..1a9023c --- /dev/null +++ b/ruty/mails/SQL/sqlite/2010042300.sql @@ -0,0 +1,35 @@ +-- Updates from version 0.4-beta + +CREATE TABLE tmp_users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + alias varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime NOT NULL default '0000-00-00 00:00:00', + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO tmp_users (user_id, username, mail_host, alias, created, last_login, language, preferences) + SELECT user_id, username, mail_host, alias, created, last_login, language, preferences FROM users; + +DROP TABLE users; + +CREATE TABLE users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + alias varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO users (user_id, username, mail_host, alias, created, last_login, language, preferences) + SELECT user_id, username, mail_host, alias, created, last_login, language, preferences FROM tmp_users; + +CREATE INDEX ix_users_username ON users(username); +CREATE INDEX ix_users_alias ON users(alias); +DROP TABLE tmp_users; diff --git a/ruty/mails/SQL/sqlite/2010100600.sql b/ruty/mails/SQL/sqlite/2010100600.sql new file mode 100644 index 0000000..5c7259f --- /dev/null +++ b/ruty/mails/SQL/sqlite/2010100600.sql @@ -0,0 +1,40 @@ +-- Updates from version 0.4.2 + +DROP INDEX ix_users_username; +CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host); + +CREATE TABLE contacts_tmp ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email varchar(255) NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '' +); + +INSERT INTO contacts_tmp (contact_id, user_id, changed, del, name, email, firstname, surname, vcard) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts; + +DROP TABLE contacts; +CREATE TABLE contacts ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email varchar(255) NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '' +); + +INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts_tmp; + +CREATE INDEX ix_contacts_user_id ON contacts(user_id, email); +DROP TABLE contacts_tmp; + +DELETE FROM messages; diff --git a/ruty/mails/SQL/sqlite/2011011200.sql b/ruty/mails/SQL/sqlite/2011011200.sql new file mode 100644 index 0000000..4cca740 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2011011200.sql @@ -0,0 +1,41 @@ +-- Updates from version 0.5.x + +CREATE TABLE contacts_tmp ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email varchar(255) NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '' +); + +INSERT INTO contacts_tmp (contact_id, user_id, changed, del, name, email, firstname, surname, vcard) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts; + +DROP TABLE contacts; +CREATE TABLE contacts ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email varchar(255) NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '', + words text NOT NULL default '' +); + +INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard FROM contacts_tmp; + +CREATE INDEX ix_contacts_user_id ON contacts(user_id, email); +DROP TABLE contacts_tmp; + + +DELETE FROM messages; +DELETE FROM cache; +CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id); diff --git a/ruty/mails/SQL/sqlite/2011092800.sql b/ruty/mails/SQL/sqlite/2011092800.sql new file mode 100644 index 0000000..27dbffc --- /dev/null +++ b/ruty/mails/SQL/sqlite/2011092800.sql @@ -0,0 +1,54 @@ +-- Updates from version 0.6 + +CREATE TABLE dictionary ( + user_id integer DEFAULT NULL, + "language" varchar(5) NOT NULL, + data text NOT NULL +); + +CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, "language"); + +CREATE TABLE searches ( + search_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL DEFAULT '0', + "type" smallint NOT NULL DEFAULT '0', + name varchar(128) NOT NULL, + data text NOT NULL +); + +CREATE UNIQUE INDEX ix_searches_user_type_name ON searches (user_id, type, name); + +DROP TABLE messages; + +CREATE TABLE cache_index ( + user_id integer NOT NULL, + mailbox varchar(255) NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + valid smallint NOT NULL DEFAULT '0', + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX ix_cache_index_changed ON cache_index (changed); + +CREATE TABLE cache_thread ( + user_id integer NOT NULL, + mailbox varchar(255) NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX ix_cache_thread_changed ON cache_thread (changed); + +CREATE TABLE cache_messages ( + user_id integer NOT NULL, + mailbox varchar(255) NOT NULL, + uid integer NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + data text NOT NULL, + flags integer NOT NULL DEFAULT '0', + PRIMARY KEY (user_id, mailbox, uid) +); + +CREATE INDEX ix_cache_messages_changed ON cache_messages (changed); diff --git a/ruty/mails/SQL/sqlite/2011111600.sql b/ruty/mails/SQL/sqlite/2011111600.sql new file mode 100644 index 0000000..cea0d12 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2011111600.sql @@ -0,0 +1,11 @@ +-- Updates from version 0.7-beta + +DROP TABLE session; +CREATE TABLE session ( + sess_id varchar(128) NOT NULL PRIMARY KEY, + created datetime NOT NULL default '0000-00-00 00:00:00', + changed datetime NOT NULL default '0000-00-00 00:00:00', + ip varchar(40) NOT NULL default '', + vars text NOT NULL +); +CREATE INDEX ix_session_changed ON session (changed); diff --git a/ruty/mails/SQL/sqlite/2011121400.sql b/ruty/mails/SQL/sqlite/2011121400.sql new file mode 100644 index 0000000..9d92276 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2011121400.sql @@ -0,0 +1,38 @@ +-- Updates from version 0.7 + +CREATE TABLE contacts_tmp ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email text NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '', + words text NOT NULL default '' +); + +INSERT INTO contacts_tmp (contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words FROM contacts; + +DROP TABLE contacts; + +CREATE TABLE contacts ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email text NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '', + words text NOT NULL default '' +); + +INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words FROM contacts_tmp; + +CREATE INDEX ix_contacts_user_id ON contacts(user_id, del); +DROP TABLE contacts_tmp; diff --git a/ruty/mails/SQL/sqlite/2012080700.sql b/ruty/mails/SQL/sqlite/2012080700.sql new file mode 100644 index 0000000..c6ede89 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2012080700.sql @@ -0,0 +1,44 @@ +-- Updates from version 0.8 + +DROP TABLE cache; +CREATE TABLE cache ( + user_id integer NOT NULL default 0, + cache_key varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + data text NOT NULL +); + +CREATE INDEX ix_cache_user_cache_key ON cache(user_id, cache_key); +CREATE INDEX ix_cache_created ON cache(created); + +CREATE TABLE tmp_users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO tmp_users (user_id, username, mail_host, created, last_login, language, preferences) + SELECT user_id, username, mail_host, created, last_login, language, preferences FROM users; + +DROP TABLE users; + +CREATE TABLE users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO users (user_id, username, mail_host, created, last_login, language, preferences) + SELECT user_id, username, mail_host, created, last_login, language, preferences FROM tmp_users; + +CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host); + +CREATE INDEX ix_identities_email ON identities(email, del); diff --git a/ruty/mails/SQL/sqlite/2013011000.sql b/ruty/mails/SQL/sqlite/2013011000.sql new file mode 100644 index 0000000..ec261a6 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2013011000.sql @@ -0,0 +1,6 @@ +-- Updates from version 0.9-beta + +CREATE TABLE IF NOT EXISTS system ( + name varchar(64) NOT NULL PRIMARY KEY, + value text NOT NULL +); diff --git a/ruty/mails/SQL/sqlite/2013011700.sql b/ruty/mails/SQL/sqlite/2013011700.sql new file mode 100644 index 0000000..533e70f --- /dev/null +++ b/ruty/mails/SQL/sqlite/2013011700.sql @@ -0,0 +1,2 @@ +-- drop temp table created in 2012080700.sql +DROP TABLE IF EXISTS tmp_users; diff --git a/ruty/mails/SQL/sqlite/2013042700.sql b/ruty/mails/SQL/sqlite/2013042700.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/sqlite/2013042700.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/sqlite/2013052500.sql b/ruty/mails/SQL/sqlite/2013052500.sql new file mode 100644 index 0000000..19ae1b1 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2013052500.sql @@ -0,0 +1,8 @@ +CREATE TABLE cache_shared ( + cache_key varchar(255) NOT NULL, + created datetime NOT NULL default '0000-00-00 00:00:00', + data text NOT NULL +); + +CREATE INDEX ix_cache_shared_cache_key ON cache_shared(cache_key); +CREATE INDEX ix_cache_shared_created ON cache_shared(created); diff --git a/ruty/mails/SQL/sqlite/2013061000.sql b/ruty/mails/SQL/sqlite/2013061000.sql new file mode 100644 index 0000000..3c6b43e --- /dev/null +++ b/ruty/mails/SQL/sqlite/2013061000.sql @@ -0,0 +1,48 @@ +DROP TABLE cache_index; +DROP TABLE cache_thread; +DROP TABLE cache_messages; + +ALTER TABLE cache ADD expires datetime DEFAULT NULL; +DROP INDEX ix_cache_created; + +ALTER TABLE cache_shared ADD expires datetime DEFAULT NULL; +DROP INDEX ix_cache_shared_created; + +UPDATE cache SET expires = datetime(created, '+604800 seconds'); +UPDATE cache_shared SET expires = datetime(created, '+604800 seconds'); + +CREATE INDEX ix_cache_expires ON cache(expires); +CREATE INDEX ix_cache_shared_expires ON cache_shared(expires); + +CREATE TABLE cache_index ( + user_id integer NOT NULL, + mailbox varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + valid smallint NOT NULL DEFAULT '0', + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX ix_cache_index_expires ON cache_index (expires); + +CREATE TABLE cache_thread ( + user_id integer NOT NULL, + mailbox varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); + +CREATE INDEX ix_cache_thread_expires ON cache_thread (expires); + +CREATE TABLE cache_messages ( + user_id integer NOT NULL, + mailbox varchar(255) NOT NULL, + uid integer NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + flags integer NOT NULL DEFAULT '0', + PRIMARY KEY (user_id, mailbox, uid) +); + +CREATE INDEX ix_cache_messages_expires ON cache_messages (expires); diff --git a/ruty/mails/SQL/sqlite/2014042900.sql b/ruty/mails/SQL/sqlite/2014042900.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/sqlite/2014042900.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/sqlite/2015030800.sql b/ruty/mails/SQL/sqlite/2015030800.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/sqlite/2015030800.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/sqlite/2015111100.sql b/ruty/mails/SQL/sqlite/2015111100.sql new file mode 100644 index 0000000..34df0ea --- /dev/null +++ b/ruty/mails/SQL/sqlite/2015111100.sql @@ -0,0 +1,35 @@ +CREATE TABLE tmp_users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + failed_login datetime DEFAULT NULL, + failed_login_counter integer DEFAULT NULL, + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO tmp_users (user_id, username, mail_host, created, last_login, language, preferences) + SELECT user_id, username, mail_host, created, last_login, language, preferences FROM users; + +DROP TABLE users; + +CREATE TABLE users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + failed_login datetime DEFAULT NULL, + failed_login_counter integer DEFAULT NULL, + language varchar(5), + preferences text NOT NULL default '' +); + +INSERT INTO users (user_id, username, mail_host, created, last_login, language, preferences) + SELECT user_id, username, mail_host, created, last_login, language, preferences FROM tmp_users; + +CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host); + +DROP TABLE tmp_users; diff --git a/ruty/mails/SQL/sqlite/2016081200.sql b/ruty/mails/SQL/sqlite/2016081200.sql new file mode 100644 index 0000000..8c3a3f1 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2016081200.sql @@ -0,0 +1,9 @@ +DROP TABLE session; +CREATE TABLE session ( + sess_id varchar(128) NOT NULL PRIMARY KEY, + changed datetime NOT NULL default '0000-00-00 00:00:00', + ip varchar(40) NOT NULL default '', + vars text NOT NULL +); + +CREATE INDEX ix_session_changed ON session (changed); diff --git a/ruty/mails/SQL/sqlite/2016100900.sql b/ruty/mails/SQL/sqlite/2016100900.sql new file mode 100644 index 0000000..e69de29 diff --git a/ruty/mails/SQL/sqlite/2016112200.sql b/ruty/mails/SQL/sqlite/2016112200.sql new file mode 100644 index 0000000..c185493 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2016112200.sql @@ -0,0 +1,21 @@ +DROP TABLE cache; +DROP TABLE cache_shared; + +CREATE TABLE cache ( + user_id integer NOT NULL default 0, + cache_key varchar(128) NOT NULL default '', + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, cache_key) +); + +CREATE INDEX ix_cache_expires ON cache(expires); + +CREATE TABLE cache_shared ( + cache_key varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (cache_key) +); + +CREATE INDEX ix_cache_shared_expires ON cache_shared(expires); diff --git a/ruty/mails/SQL/sqlite/2018021600.sql b/ruty/mails/SQL/sqlite/2018021600.sql new file mode 100644 index 0000000..c7973cd --- /dev/null +++ b/ruty/mails/SQL/sqlite/2018021600.sql @@ -0,0 +1,9 @@ +CREATE TABLE filestore ( + file_id integer PRIMARY KEY, + user_id integer NOT NULL, + filename varchar(128) NOT NULL, + mtime integer NOT NULL, + data text NOT NULL +); + +CREATE UNIQUE INDEX ix_filestore_user_id ON filestore(user_id, filename); diff --git a/ruty/mails/SQL/sqlite/2018122300.sql b/ruty/mails/SQL/sqlite/2018122300.sql new file mode 100644 index 0000000..7abb098 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2018122300.sql @@ -0,0 +1,29 @@ +CREATE TABLE tmp_filestore ( + file_id integer PRIMARY KEY, + user_id integer NOT NULL, + filename varchar(128) NOT NULL, + mtime integer NOT NULL, + data text NOT NULL +); + +INSERT INTO tmp_filestore (file_id, user_id, filename, mtime, data) + SELECT file_id, user_id, filename, mtime, data FROM filestore; + +DROP TABLE filestore; + +CREATE TABLE filestore ( + file_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL, + context varchar(32) NOT NULL, + filename varchar(128) NOT NULL, + mtime integer NOT NULL, + data text NOT NULL +); + +INSERT INTO filestore (file_id, user_id, filename, mtime, data, context) + SELECT file_id, user_id, filename, mtime, data, 'enigma' FROM tmp_filestore; + +CREATE UNIQUE INDEX ix_filestore_user_id ON filestore(user_id, context, filename); + +DROP TABLE tmp_filestore; + diff --git a/ruty/mails/SQL/sqlite/2019092900.sql b/ruty/mails/SQL/sqlite/2019092900.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/sqlite/2019092900.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/sqlite/2020020100.sql b/ruty/mails/SQL/sqlite/2020020100.sql new file mode 100644 index 0000000..03fdb72 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2020020100.sql @@ -0,0 +1,57 @@ +CREATE TABLE tmp_users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + failed_login datetime DEFAULT NULL, + failed_login_counter integer DEFAULT NULL, + language varchar(16), + preferences text NOT NULL default '' +); + +INSERT INTO tmp_users (user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences) + SELECT user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences FROM users; + +DROP TABLE users; + +CREATE TABLE users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + failed_login datetime DEFAULT NULL, + failed_login_counter integer DEFAULT NULL, + language varchar(16), + preferences text NOT NULL default '' +); + +INSERT INTO users (user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences) + SELECT user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences FROM tmp_users; + +CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host); + +DROP TABLE tmp_users; + +CREATE TABLE tmp_dictionary ( + user_id integer DEFAULT NULL, + language varchar(16) NOT NULL, + data text NOT NULL +); + +INSERT INTO tmp_dictionary (user_id, language, data) SELECT user_id, language, data FROM dictionary; + +DROP TABLE dictionary; + +CREATE TABLE dictionary ( + user_id integer DEFAULT NULL, + language varchar(16) NOT NULL, + data text NOT NULL +); + +INSERT INTO dictionary (user_id, language, data) SELECT user_id, language, data FROM tmp_dictionary; + +CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, language); + +DROP TABLE tmp_dictionary; diff --git a/ruty/mails/SQL/sqlite/2020020101.sql b/ruty/mails/SQL/sqlite/2020020101.sql new file mode 100644 index 0000000..fe6741a --- /dev/null +++ b/ruty/mails/SQL/sqlite/2020020101.sql @@ -0,0 +1 @@ +-- empty \ No newline at end of file diff --git a/ruty/mails/SQL/sqlite/2020091000.sql b/ruty/mails/SQL/sqlite/2020091000.sql new file mode 100644 index 0000000..2ea3096 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2020091000.sql @@ -0,0 +1,10 @@ +CREATE TABLE collected_addresses ( + address_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL, + changed datetime NOT NULL default '0000-00-00 00:00:00', + name varchar(255) NOT NULL default '', + email varchar(255) NOT NULL, + "type" integer NOT NULL +); + +CREATE UNIQUE INDEX ix_collected_addresses_user_id ON collected_addresses(user_id, "type", email); diff --git a/ruty/mails/SQL/sqlite/2020122900.sql b/ruty/mails/SQL/sqlite/2020122900.sql new file mode 100644 index 0000000..c3fb546 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2020122900.sql @@ -0,0 +1,35 @@ +CREATE TABLE tmp_users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + failed_login datetime DEFAULT NULL, + failed_login_counter integer DEFAULT NULL, + language varchar(16), + preferences text DEFAULT NULL +); + +INSERT INTO tmp_users (user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences) + SELECT user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences FROM users; + +DROP TABLE users; + +CREATE TABLE users ( + user_id integer NOT NULL PRIMARY KEY, + username varchar(128) NOT NULL default '', + mail_host varchar(128) NOT NULL default '', + created datetime NOT NULL default '0000-00-00 00:00:00', + last_login datetime DEFAULT NULL, + failed_login datetime DEFAULT NULL, + failed_login_counter integer DEFAULT NULL, + language varchar(16), + preferences text DEFAULT NULL +); + +INSERT INTO users (user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences) + SELECT user_id, username, mail_host, created, last_login, failed_login, failed_login_counter, language, preferences FROM tmp_users; + +CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host); + +DROP TABLE tmp_users; diff --git a/ruty/mails/SQL/sqlite/2021081000.sql b/ruty/mails/SQL/sqlite/2021081000.sql new file mode 100644 index 0000000..9fa55d9 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2021081000.sql @@ -0,0 +1,11 @@ +CREATE TABLE responses ( + response_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL default '0', + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(255) NOT NULL, + data text NOT NULL, + is_html tinyint NOT NULL default '0' +); + +CREATE UNIQUE INDEX ix_responses_user_id ON responses(user_id, del); diff --git a/ruty/mails/SQL/sqlite/2021100300.sql b/ruty/mails/SQL/sqlite/2021100300.sql new file mode 100644 index 0000000..2a547a6 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2021100300.sql @@ -0,0 +1,211 @@ +-- Add foreign keys + +DELETE FROM contacts WHERE user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE contacts RENAME TO old_contacts; +DROP INDEX ix_contacts_user_id; +CREATE TABLE contacts ( + contact_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + email text NOT NULL default '', + firstname varchar(128) NOT NULL default '', + surname varchar(128) NOT NULL default '', + vcard text NOT NULL default '', + words text NOT NULL default '' +); +CREATE INDEX ix_contacts_user_id ON contacts(user_id, del); +INSERT INTO contacts (contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words) + SELECT contact_id, user_id, changed, del, name, email, firstname, surname, vcard, words FROM old_contacts; +DROP TABLE old_contacts; + +DELETE FROM contactgroups WHERE user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE contactgroups RENAME TO old_contactgroups; +DROP INDEX ix_contactgroups_user_id; +CREATE TABLE contactgroups ( + contactgroup_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '' +); +CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del); +INSERT INTO contactgroups (contactgroup_id, user_id, changed, del, name) + SELECT contactgroup_id, user_id, changed, del, name FROM old_contactgroups; +DROP TABLE old_contactgroups; + +DELETE FROM contactgroupmembers WHERE contact_id NOT IN (SELECT contact_id FROM contacts); +DELETE FROM contactgroupmembers WHERE contactgroup_id NOT IN (SELECT contactgroup_id FROM contactgroups); +ALTER TABLE contactgroupmembers RENAME TO old_contactgroupmembers; +DROP INDEX ix_contactgroupmembers_contact_id; +CREATE TABLE contactgroupmembers ( + contactgroup_id integer NOT NULL + REFERENCES contactgroups (contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE, + contact_id integer NOT NULL + REFERENCES contacts (contact_id) ON DELETE CASCADE ON UPDATE CASCADE, + created datetime NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (contactgroup_id, contact_id) +); +INSERT INTO contactgroupmembers (contactgroup_id, contact_id, created) + SELECT contactgroup_id, contact_id, created FROM old_contactgroupmembers; +CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id); +DROP TABLE old_contactgroupmembers; + +DELETE FROM collected_addresses WHERE user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE collected_addresses RENAME TO old_collected_addresses; +DROP INDEX ix_collected_addresses_user_id; +CREATE TABLE collected_addresses ( + address_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + name varchar(255) NOT NULL default '', + email varchar(255) NOT NULL, + "type" integer NOT NULL +); +CREATE UNIQUE INDEX ix_collected_addresses_user_id ON collected_addresses(user_id, "type", email); +INSERT INTO collected_addresses (address_id, user_id, changed, name, email, "type") + SELECT address_id, user_id, changed, name, email, "type" FROM old_collected_addresses; +DROP TABLE old_collected_addresses; + +DELETE FROM identities WHERE user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE identities RENAME TO old_identities; +DROP INDEX ix_identities_user_id; +DROP INDEX ix_identities_email; +CREATE TABLE identities ( + identity_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + standard tinyint NOT NULL default '0', + name varchar(128) NOT NULL default '', + organization varchar(128) default '', + email varchar(128) NOT NULL default '', + "reply-to" varchar(128) NOT NULL default '', + bcc varchar(128) NOT NULL default '', + signature text NOT NULL default '', + html_signature tinyint NOT NULL default '0' +); +CREATE INDEX ix_identities_user_id ON identities(user_id, del); +CREATE INDEX ix_identities_email ON identities(email, del); +INSERT INTO identities (identity_id, user_id, changed, del, standard, name, organization, email, "reply-to", bcc, signature, html_signature) + SELECT identity_id, user_id, changed, del, standard, name, organization, email, "reply-to", bcc, signature, html_signature FROM old_identities; +DROP TABLE old_identities; + +DELETE FROM responses WHERE user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE responses RENAME TO old_responses; +DROP INDEX ix_responses_user_id; +CREATE TABLE responses ( + response_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + changed datetime NOT NULL default '0000-00-00 00:00:00', + del tinyint NOT NULL default '0', + name varchar(255) NOT NULL, + data text NOT NULL, + is_html tinyint NOT NULL default '0' +); +CREATE INDEX ix_responses_user_id ON responses(user_id, del); +INSERT INTO responses (response_id, user_id, changed, del, name, data, is_html) + SELECT response_id, user_id, changed, del, name, data, is_html FROM old_responses; +DROP TABLE old_responses; + +DELETE FROM dictionary WHERE user_id IS NOT NULL AND user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE dictionary RENAME TO old_dictionary; +DROP INDEX ix_dictionary_user_language; +CREATE TABLE dictionary ( + user_id integer DEFAULT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + language varchar(16) NOT NULL, + data text NOT NULL +); +CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, language); +INSERT INTO dictionary (user_id, language, data) + SELECT user_id, language, data FROM old_dictionary; +DROP TABLE old_dictionary; + +DELETE FROM searches WHERE user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE searches RENAME TO old_searches; +DROP INDEX ix_searches_user_type_name; +CREATE TABLE searches ( + search_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + "type" smallint NOT NULL DEFAULT '0', + name varchar(128) NOT NULL, + data text NOT NULL +); +CREATE UNIQUE INDEX ix_searches_user_type_name ON searches (user_id, type, name); +INSERT INTO searches (search_id, user_id, "type", name, data) + SELECT search_id, user_id, "type", name, data FROM old_searches; +DROP TABLE old_searches; + +DELETE FROM filestore WHERE user_id NOT IN (SELECT user_id FROM users); +ALTER TABLE filestore RENAME TO old_filestore; +DROP INDEX ix_filestore_user_id; +CREATE TABLE filestore ( + file_id integer NOT NULL PRIMARY KEY, + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + context varchar(32) NOT NULL, + filename varchar(128) NOT NULL, + mtime integer NOT NULL, + data text NOT NULL +); +CREATE UNIQUE INDEX ix_filestore_user_id ON filestore(user_id, context, filename); +INSERT INTO filestore (file_id, user_id, context, filename, mtime, data) + SELECT file_id, user_id, context, filename, mtime, data FROM old_filestore; +DROP TABLE old_filestore; + + +DROP TABLE cache; +CREATE TABLE cache ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + cache_key varchar(128) NOT NULL default '', + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, cache_key) +); +CREATE INDEX ix_cache_expires ON cache(expires); + +DROP TABLE cache_index; +CREATE TABLE cache_index ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + valid smallint NOT NULL DEFAULT '0', + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); +CREATE INDEX ix_cache_index_expires ON cache_index (expires); + +DROP TABLE cache_thread; +CREATE TABLE cache_thread ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + PRIMARY KEY (user_id, mailbox) +); +CREATE INDEX ix_cache_thread_expires ON cache_thread (expires); + +DROP TABLE cache_messages; +CREATE TABLE cache_messages ( + user_id integer NOT NULL + REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, + mailbox varchar(255) NOT NULL, + uid integer NOT NULL, + expires datetime DEFAULT NULL, + data text NOT NULL, + flags integer NOT NULL DEFAULT '0', + PRIMARY KEY (user_id, mailbox, uid) +); + +CREATE INDEX ix_cache_messages_expires ON cache_messages (expires); diff --git a/ruty/mails/SQL/sqlite/2022081200.sql b/ruty/mails/SQL/sqlite/2022081200.sql new file mode 100644 index 0000000..d379fc5 --- /dev/null +++ b/ruty/mails/SQL/sqlite/2022081200.sql @@ -0,0 +1,2 @@ +DROP INDEX ix_responses_user_id; +CREATE INDEX ix_responses_user_id ON responses(user_id, del); diff --git a/ruty/mails/skins/elastic/README.md b/ruty/mails/skins/elastic/README.md new file mode 100644 index 0000000..8c663cd --- /dev/null +++ b/ruty/mails/skins/elastic/README.md @@ -0,0 +1,119 @@ +Roundcube Webmail Skin "Elastic" +================================ + +This skin package contains a theme for the Roundcube Webmail +software. It can be used, modified and redistributed according to +the terms described in the LICENSE section. + +For information about building or modifying Roundcube skins please visit +https://github.com/roundcube/roundcubemail/wiki/Skins + + +LICENSE +------- + +The contents of this folder are subject to the Creative Commons +Attribution-ShareAlike License. It is allowed to copy, distribute, +transmit and to adapt the work by keeping credits to the original +authors in the README.md file. +See http://creativecommons.org/licenses/by-sa/3.0/ for details. + +This folder also contains code licensed separately: +- Bootstrap Framework 4 from https://github.com/twbs/bootstrap +- FontAwesome 5 fonts from https://fontawesome.com/ +- Roboto font from https://google-webfonts-helper.herokuapp.com/fonts/roboto?subsets=cyrillic,latin-ext,cyrillic-ext,latin,greek,greek-ext + + +INSTALLATION +------------ + +All styles are written using LESS syntax. Thus it needs to be compiled +using the `lessc` (>= 2.5.2) command line tool. This comes with the `nodejs-less` +RPM package or using `npm install less` which depend on nodejs. +``` + $ lessc --clean-css="--s1 --advanced" styles/styles.less > styles/styles.min.css + $ lessc --clean-css="--s1 --advanced" styles/print.less > styles/print.min.css + $ lessc --clean-css="--s1 --advanced" styles/embed.less > styles/embed.min.css +``` +(`--clean-css="--s1 --advanced"` minifies the css, requires the clean-css Less plugin. +The plugin can be installed using `npm install less-plugin-clean-css`) + +References to image files from the included CSS files can be appended +with cache-buster marks to avoid browser caching issues after updating. + +Run `bin/updatecss.sh --dir skins/elastic` before packaging the skin +or after installing it on the destination system. + + +FOR DEVELOPERS +-------------- + +- Supported browsers: IE11+, Edge, Last 2 versions for Chrome/Firefox/Safari, + Android Browser 5+, iOS Safari 9+. + +- Skin color palette changes and other css modifications can be done + via _styles.less and _variables.less files. Where you can overwrite all + variables and add custom styles. + +- Minimum supported screen width is 240px (note that even if the device screen + resolution is e.g.320x372 changing the text size in device settings will reduce + the resolution) + +- Every page (which is not a frame) has following required structure: +``` + +
+
+
+
+
+
+ +``` + where `#layout-sidebar` and `#layout-list` are optional. Which element of the `#layout` will be displayed + as a main view on mobile devices can be defined by adding `selected` class to it. + +- The `` element will receive special classes that will be updated on resize + or orientation change: + - `touch`: A touch device, screen width <= 1024px, + - `layout-large`: Screen width > 1200px, + - `layout-normal`: Screen width <= 1200px and >= 768px, + - `layout-small`: Screen width < 768px and > 480px, + - `layout-phone`: Screen width <= 480px. + + Frames will have the same classes applied as their parent windows. + +- Every button, that is not + + +
+

+ +
+ + + + +
+

+ +

+
+ +
+
+ + +
+

+ +
+ +
+

+ +
+ +
+

+ +
+ +
+

+ +
+ +
+

+ +
+ + diff --git a/ruty/mails/skins/elastic/templates/bounce.html b/ruty/mails/skins/elastic/templates/bounce.html new file mode 100644 index 0000000..f9fbf02 --- /dev/null +++ b/ruty/mails/skins/elastic/templates/bounce.html @@ -0,0 +1,74 @@ + + +

+ +
+ + +
+

+
+
+ +
+
+ + + " tabindex="1"> +
+
+
+
+ +
+
+ + + " tabindex="1"> + +
+
+
+ + +
+ +
+ +
+ +
+
+ + +
+ +
+

+ +
+ + diff --git a/ruty/mails/skins/elastic/templates/compose.html b/ruty/mails/skins/elastic/templates/compose.html new file mode 100644 index 0000000..0f7cad8 --- /dev/null +++ b/ruty/mails/skins/elastic/templates/compose.html @@ -0,0 +1,286 @@ + + + + + + + + + +

+ + + + +
+

+
+ + +
+ + +
+
+ + + +
+

+
+
+ +
+
+ + + " tabindex="1"> + +
+
+
+
+ +
+ +
+
+ + + + +
+ +
+ +
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+
+
+
+ + + +
+ +
+

+ +
+ +
+

+ +
+ +
+

+ +
+ +
+ +
+ +
+
+ +
+ + +
+ +
+
+ + diff --git a/ruty/mails/skins/elastic/templates/contact.html b/ruty/mails/skins/elastic/templates/contact.html new file mode 100644 index 0000000..3df09b8 --- /dev/null +++ b/ruty/mails/skins/elastic/templates/contact.html @@ -0,0 +1,23 @@ + + +

+ +
+
+
+ +
+ +
+
+ +
+
+ +
+ +
+ + diff --git a/ruty/mails/skins/elastic/templates/contactedit.html b/ruty/mails/skins/elastic/templates/contactedit.html new file mode 100644 index 0000000..3842208 --- /dev/null +++ b/ruty/mails/skins/elastic/templates/contactedit.html @@ -0,0 +1,29 @@ + + +

+ + +
+
+ + + + + +
+ +
+
+ +
+ + +
+ +
+ + + + diff --git a/ruty/mails/skins/elastic/templates/contactimport.html b/ruty/mails/skins/elastic/templates/contactimport.html new file mode 100644 index 0000000..b7f30ee --- /dev/null +++ b/ruty/mails/skins/elastic/templates/contactimport.html @@ -0,0 +1,9 @@ + + +

:

+ +
+ +
+ + diff --git a/ruty/mails/skins/elastic/templates/contactprint.html b/ruty/mails/skins/elastic/templates/contactprint.html new file mode 100644 index 0000000..ffa16b5 --- /dev/null +++ b/ruty/mails/skins/elastic/templates/contactprint.html @@ -0,0 +1,19 @@ + + +