Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3303133
D11903.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11903.diff
View Options
diff --git a/keyserver/src/database/migration-config.js b/keyserver/src/database/migration-config.js
--- a/keyserver/src/database/migration-config.js
+++ b/keyserver/src/database/migration-config.js
@@ -800,6 +800,29 @@
);
},
],
+ [
+ 64,
+ async () => {
+ await dbQuery(
+ SQL`
+ CREATE TABLE IF NOT EXISTS communities (
+ id bigint(20) NOT NULL,
+ farcaster_channel_id varchar(255) CHARSET latin1 DEFAULT NULL,
+ blob_holder char(36) CHARSET latin1 DEFAULT NULL
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+ ALTER TABLE communities
+ ADD PRIMARY KEY (id);
+
+ INSERT INTO communities (id)
+ SELECT id
+ FROM threads t
+ WHERE t.depth = 0;
+ `,
+ { multipleStatements: true },
+ );
+ },
+ ],
]);
const newDatabaseVersion: number = Math.max(...migrations.keys());
diff --git a/keyserver/src/database/setup-db.js b/keyserver/src/database/setup-db.js
--- a/keyserver/src/database/setup-db.js
+++ b/keyserver/src/database/setup-db.js
@@ -298,6 +298,12 @@
COLLATE latin1_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
+ CREATE TABLE communities (
+ id bigint(20) NOT NULL,
+ farcaster_channel_id varchar(255) CHARSET latin1 DEFAULT NULL,
+ blob_holder char(36) CHARSET latin1 DEFAULT NULL
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
ALTER TABLE cookies
ADD PRIMARY KEY (id),
ADD UNIQUE KEY device_token (device_token(512)),
@@ -426,6 +432,9 @@
ALTER TABLE olm_accounts
ADD PRIMARY KEY (is_content);
+
+ ALTER TABLE communities
+ ADD PRIMARY KEY (id);
`,
{ multipleStatements: true },
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 10:31 AM (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2537734
Default Alt Text
D11903.diff (1 KB)
Attached To
Mode
D11903: [keyserver] introduce a table for communities
Attached
Detach File
Event Timeline
Log In to Comment