25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

39 satır
1.2 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 receipts_graph(
  16. room_id TEXT NOT NULL,
  17. receipt_type TEXT NOT NULL,
  18. user_id TEXT NOT NULL,
  19. event_ids TEXT NOT NULL,
  20. data TEXT NOT NULL,
  21. CONSTRAINT receipts_graph_uniqueness UNIQUE (room_id, receipt_type, user_id)
  22. );
  23. CREATE TABLE IF NOT EXISTS receipts_linearized (
  24. stream_id BIGINT NOT NULL,
  25. room_id TEXT NOT NULL,
  26. receipt_type TEXT NOT NULL,
  27. user_id TEXT NOT NULL,
  28. event_id TEXT NOT NULL,
  29. data TEXT NOT NULL,
  30. CONSTRAINT receipts_linearized_uniqueness UNIQUE (room_id, receipt_type, user_id)
  31. );
  32. CREATE INDEX receipts_linearized_id ON receipts_linearized(
  33. stream_id
  34. );