mysql-update.sql 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. -- 18.09
  2. ALTER TABLE spool MODIFY xml mediumtext NOT NULL;
  3. ALTER TABLE archive MODIFY xml mediumtext NOT NULL;
  4. ALTER TABLE archive MODIFY txt mediumtext;
  5. ALTER TABLE pubsub_item MODIFY payload mediumtext NOT NULL;
  6. -- 18.12
  7. ALTER TABLE pubsub_item MODIFY payload mediumtext NOT NULL;
  8. DROP INDEX i_pubsub_node_tuple ON pubsub_node;
  9. CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node(host(71), node(120));
  10. -- MIX setup
  11. CREATE TABLE mix_channel (
  12. channel text NOT NULL,
  13. service text NOT NULL,
  14. username text NOT NULL,
  15. domain text NOT NULL,
  16. jid text NOT NULL,
  17. hidden boolean NOT NULL,
  18. hmac_key text NOT NULL,
  19. created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  20. ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  21. CREATE UNIQUE INDEX i_mix_channel ON mix_channel (channel(191), service(191));
  22. CREATE INDEX i_mix_channel_serv ON mix_channel (service(191));
  23. CREATE TABLE mix_participant (
  24. channel text NOT NULL,
  25. service text NOT NULL,
  26. username text NOT NULL,
  27. domain text NOT NULL,
  28. jid text NOT NULL,
  29. id text NOT NULL,
  30. nick text NOT NULL,
  31. created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  32. ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  33. CREATE UNIQUE INDEX i_mix_participant ON mix_participant (channel(191), service(191), username(191), domain(191));
  34. CREATE INDEX i_mix_participant_chan_serv ON mix_participant (channel(191), service(191));
  35. CREATE TABLE mix_subscription (
  36. channel text NOT NULL,
  37. service text NOT NULL,
  38. username text NOT NULL,
  39. domain text NOT NULL,
  40. node text NOT NULL,
  41. jid text NOT NULL
  42. ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  43. CREATE UNIQUE INDEX i_mix_subscription ON mix_subscription (channel(153), service(153), username(153), domain(153), node(153));
  44. CREATE INDEX i_mix_subscription_chan_serv_ud ON mix_subscription (channel(191), service(191), username(191), domain(191));
  45. CREATE INDEX i_mix_subscription_chan_serv_node ON mix_subscription (channel(191), service(191), node(191));
  46. CREATE INDEX i_mix_subscription_chan_serv ON mix_subscription (channel(191), service(191));
  47. CREATE TABLE mix_pam (
  48. username text NOT NULL,
  49. channel text NOT NULL,
  50. service text NOT NULL,
  51. id text NOT NULL,
  52. created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  53. ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  54. CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username(191), channel(191), service(191));
  55. CREATE INDEX i_mix_pam_u ON mix_pam (username(191));
  56. -- MQTT
  57. CREATE TABLE mqtt_pub (
  58. username varchar(191) NOT NULL,
  59. server_host varchar(191) NOT NULL,
  60. resource varchar(191) NOT NULL,
  61. topic text NOT NULL,
  62. qos tinyint NOT NULL,
  63. payload blob NOT NULL,
  64. payload_format tinyint NOT NULL,
  65. content_type text NOT NULL,
  66. response_topic text NOT NULL,
  67. correlation_data blob NOT NULL,
  68. user_properties blob NOT NULL,
  69. expiry int unsigned NOT NULL,
  70. UNIQUE KEY i_mqtt_topic_server (topic(191))
  71. );
  72. -- 19.08
  73. ALTER TABLE users MODIFY server_host varchar(191) NOT NULL;
  74. ALTER TABLE last MODIFY server_host varchar(191) NOT NULL;
  75. ALTER TABLE rosterusers MODIFY server_host varchar(191) NOT NULL;
  76. ALTER TABLE rostergroups MODIFY server_host varchar(191) NOT NULL;
  77. ALTER TABLE sr_group MODIFY server_host varchar(191) NOT NULL;
  78. ALTER TABLE sr_user MODIFY server_host varchar(191) NOT NULL;
  79. ALTER TABLE spool MODIFY server_host varchar(191) NOT NULL;
  80. ALTER TABLE archive MODIFY server_host varchar(191) NOT NULL;
  81. ALTER TABLE archive_prefs MODIFY server_host varchar(191) NOT NULL;
  82. ALTER TABLE vcard MODIFY server_host varchar(191) NOT NULL;
  83. ALTER TABLE vcard_search MODIFY server_host varchar(191) NOT NULL;
  84. ALTER TABLE privacy_default_list MODIFY server_host varchar(191) NOT NULL;
  85. ALTER TABLE privacy_list MODIFY server_host varchar(191) NOT NULL;
  86. ALTER TABLE private_storage MODIFY server_host varchar(191) NOT NULL;
  87. ALTER TABLE roster_version MODIFY server_host varchar(191) NOT NULL;
  88. ALTER TABLE muc_room MODIFY server_host varchar(191) NOT NULL;
  89. ALTER TABLE muc_registered MODIFY server_host varchar(191) NOT NULL;
  90. ALTER TABLE muc_online_room MODIFY server_host varchar(191) NOT NULL;
  91. ALTER TABLE muc_online_users MODIFY server_host varchar(191) NOT NULL;
  92. ALTER TABLE motd MODIFY server_host varchar(191) NOT NULL;
  93. ALTER TABLE sm MODIFY server_host varchar(191) NOT NULL;
  94. ALTER TABLE route MODIFY server_host varchar(191) NOT NULL;
  95. ALTER TABLE push_session MODIFY server_host varchar(191) NOT NULL;
  96. ALTER TABLE mix_pam MODIFY server_host varchar(191) NOT NULL;
  97. -- 20.01
  98. ALTER TABLE oauth_client CHANGE `client` `client_id` text PRIMARY KEY;
  99. ALTER TABLE oauth_client CHANGE `secret` `client_name` text NOT NULL;