feat: add peer_approval_requests table and migration
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE `peer_approval_requests` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`origin` text NOT NULL,
|
||||
`instance_name` text,
|
||||
`hmac_secret` text NOT NULL,
|
||||
`requested_at` integer NOT NULL,
|
||||
`expires_at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `peer_approval_requests_origin_unique` ON `peer_approval_requests` (`origin`);
|
||||
@@ -15,6 +15,13 @@
|
||||
"when": 1775734599940,
|
||||
"tag": "0001_clear_earthquake",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "6",
|
||||
"when": 1776689384005,
|
||||
"tag": "0002_peer_approval_requests",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -373,6 +373,15 @@ export const federationPeers = sqliteTable('federation_peers', {
|
||||
createdAt: integer('created_at').notNull(),
|
||||
});
|
||||
|
||||
export const peerApprovalRequests = sqliteTable('peer_approval_requests', {
|
||||
id: text('id').primaryKey(),
|
||||
origin: text('origin').notNull().unique(),
|
||||
instanceName: text('instance_name'),
|
||||
hmacSecret: text('hmac_secret').notNull(),
|
||||
requestedAt: integer('requested_at').notNull(),
|
||||
expiresAt: integer('expires_at').notNull(),
|
||||
});
|
||||
|
||||
export const federationOutbox = sqliteTable('federation_outbox', {
|
||||
id: text('id').primaryKey(),
|
||||
peerId: text('peer_id').notNull().references(() => federationPeers.id, { onDelete: 'cascade' }),
|
||||
|
||||
Reference in New Issue
Block a user