Skip to content

Commit

Permalink
Response to code review: rocicorp/replidraw#5
Browse files Browse the repository at this point in the history
Also added a LastModified column to Object table. We will use this
eventually to do things like prune old client state.
  • Loading branch information
aboodman committed Mar 2, 2021
1 parent dc8a01c commit 162630d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/rds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ async function createDatabase() {
await executeStatement(`CREATE TABLE Object (
K VARCHAR(255) PRIMARY KEY NOT NULL,
V TEXT NOT NULL,
Version BIGINT NOT NULL)`);
Version BIGINT NOT NULL,
LastModified TIMESTAMP NOT NULL
DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX (Version))`);

await executeStatement(`INSERT INTO Cookie (Version) VALUES (0)`);

Expand Down

0 comments on commit 162630d

Please sign in to comment.