← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~pappacena/launchpad:comment-editing-db-patch into launchpad:db-devel

 


Diff comments:

> diff --git a/database/schema/patch-2210-31-0.sql b/database/schema/patch-2210-31-0.sql
> new file mode 100644
> index 0000000..9bcceb5
> --- /dev/null
> +++ b/database/schema/patch-2210-31-0.sql
> @@ -0,0 +1,21 @@
> +-- Copyright 2021 Canonical Ltd.  This software is licensed under the
> +-- GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +SET client_min_messages=ERROR;
> +
> +ALTER TABLE Message
> +    ADD COLUMN date_deleted timestamp without time zone,
> +    ADD COLUMN date_last_edit timestamp without time zone;
> +
> +CREATE TABLE MessageRevision (
> +    id serial PRIMARY KEY,
> +    message integer NOT NULL REFERENCES Message,
> +    content text,

Are there so many places that query MessageChunk?  I see only:

 * Bug._indexed_messages
 * Bug.getMessagesForView
 * BranchMergeProposal.getVoteSummariesForProposals
 * distroseriesdifference.message_chunks
 * distroseriesdifference.eager_load_dsds
 * oopsreferences.referenced_oops
 * Message._chunks

But I suppose it's true that most things that want to query MessageChunk should only care about the latest revision, and doing that might get rather complicated especially when doing a full-text search of some kind.  So I'm OK with your proposal to put only historical revisions into MessageRevision(Chunk).

> +    date_created timestamp without time zone,
> +    date_deleted timestamp without time zone
> +);
> +
> +CREATE UNIQUE INDEX messagerevision__message__date_created__key
> +    ON MessageRevision(message, date_created);
> +
> +INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 31, 0);


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/401976
Your team Launchpad code reviewers is subscribed to branch ~pappacena/launchpad:comment-editing-db-patch.


References