Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

64 linhas
1.9 KiB

  1. /* Copyright 2015, 2016 OpenMarket Ltd
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. CREATE TABLE IF NOT EXISTS rejections(
  16. event_id TEXT NOT NULL,
  17. reason TEXT NOT NULL,
  18. last_check TEXT NOT NULL,
  19. UNIQUE (event_id)
  20. );
  21. -- Push notification endpoints that users have configured
  22. CREATE TABLE IF NOT EXISTS pushers (
  23. id INTEGER PRIMARY KEY AUTOINCREMENT,
  24. user_name TEXT NOT NULL,
  25. profile_tag VARCHAR(32) NOT NULL,
  26. kind VARCHAR(8) NOT NULL,
  27. app_id VARCHAR(64) NOT NULL,
  28. app_display_name VARCHAR(64) NOT NULL,
  29. device_display_name VARCHAR(128) NOT NULL,
  30. pushkey VARBINARY(512) NOT NULL,
  31. ts BIGINT UNSIGNED NOT NULL,
  32. lang VARCHAR(8),
  33. data LONGBLOB,
  34. last_token TEXT,
  35. last_success BIGINT UNSIGNED,
  36. failing_since BIGINT UNSIGNED,
  37. UNIQUE (app_id, pushkey)
  38. );
  39. CREATE TABLE IF NOT EXISTS push_rules (
  40. id INTEGER PRIMARY KEY AUTOINCREMENT,
  41. user_name TEXT NOT NULL,
  42. rule_id TEXT NOT NULL,
  43. priority_class TINYINT NOT NULL,
  44. priority INTEGER NOT NULL DEFAULT 0,
  45. conditions TEXT NOT NULL,
  46. actions TEXT NOT NULL,
  47. UNIQUE(user_name, rule_id)
  48. );
  49. CREATE INDEX IF NOT EXISTS push_rules_user_name on push_rules (user_name);
  50. CREATE TABLE IF NOT EXISTS user_filters(
  51. user_id TEXT,
  52. filter_id BIGINT UNSIGNED,
  53. filter_json LONGBLOB
  54. );
  55. CREATE INDEX IF NOT EXISTS user_filters_by_user_id_filter_id ON user_filters(
  56. user_id, filter_id
  57. );