Commit 194c11d0 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Better abstraction for message removal.

parent 91dc2c9e
Loading
Loading
Loading
Loading
+239 −249

File changed.

Preview size limit exceeded, changes collapsed.

+3 −5
Original line number Diff line number Diff line
@@ -572,14 +572,12 @@ message ChannelMessage {
  string username = 5;
  // The content payload.
  string content = 6;
  // Another message ID reference, if any.
  google.protobuf.StringValue reference_id = 7;
  // The UNIX time when the message was created.
  google.protobuf.Timestamp create_time = 8;
  google.protobuf.Timestamp create_time = 7;
  // The UNIX time when the message was last updated.
  google.protobuf.Timestamp update_time = 9;
  google.protobuf.Timestamp update_time = 8;
  // True if the message was persisted to the channel's history, false otherwise.
  google.protobuf.BoolValue persistent = 10;
  google.protobuf.BoolValue persistent = 9;
}

// A list of channel messages, usually a result of a list operation.
+0 −4
Original line number Diff line number Diff line
@@ -1524,10 +1524,6 @@
          "type": "string",
          "description": "The content payload."
        },
        "reference_id": {
          "type": "string",
          "description": "Another message ID reference, if any."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
+1 −3
Original line number Diff line number Diff line
@@ -104,10 +104,9 @@ CREATE INDEX IF NOT EXISTS collection_read_user_id_key_idx ON storage (collectio
CREATE TABLE IF NOT EXISTS message (
  PRIMARY KEY (stream_mode, stream_subject, stream_descriptor, stream_label, create_time, id),
  FOREIGN KEY (sender_id) REFERENCES users (id) ON DELETE CASCADE,
  FOREIGN KEY (reference_id) REFERENCES message (id) ON DELETE CASCADE,

  id                UUID         UNIQUE NOT NULL,
  -- chat(0), chat_update(1), group_join(2), group_add(3), group_leave(4), group_kick(5), group_promoted(6)
  -- chat(0), chat_update(1), chat_remove(2), group_join(3), group_add(4), group_leave(5), group_kick(6), group_promoted(7)
  code              SMALLINT     DEFAULT 0 NOT NULL,
  sender_id         UUID         NOT NULL,
  username          VARCHAR(128) NOT NULL,
@@ -116,7 +115,6 @@ CREATE TABLE IF NOT EXISTS message (
  stream_descriptor UUID         NOT NULL,
  stream_label      VARCHAR(128) NOT NULL,
  content           JSONB        DEFAULT '{}' NOT NULL,
  reference_id      UUID,
  create_time       TIMESTAMPTZ  DEFAULT now() NOT NULL,
  update_time       TIMESTAMPTZ  DEFAULT now() NOT NULL,

+285 −214

File changed.

Preview size limit exceeded, changes collapsed.

Loading