···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { type ValidationResult, BlobRef } from '@atproto/lexicon';
55+import { CID } from 'multiformats/cid';
66+import { validate as _validate } from '../../../lexicons';
77+import {
88+ type $Typed,
99+ is$typed as _is$typed,
1010+ type OmitKey,
1111+} from '../../../util';
1212+1313+const is$typed = _is$typed,
1414+ validate = _validate;
1515+const id = 'network.cosmik.follow';
1616+1717+export interface Record {
1818+ $type: 'network.cosmik.follow';
1919+ /** DID of the user being followed, or AT URI of the collection being followed */
2020+ subject: string;
2121+ /** Timestamp when this follow was created. */
2222+ createdAt: string;
2323+ [k: string]: unknown;
2424+}
2525+2626+const hashRecord = 'main';
2727+2828+export function isRecord<V>(v: V) {
2929+ return is$typed(v, id, hashRecord);
3030+}
3131+3232+export function validateRecord<V>(v: V) {
3333+ return validate<Record & V>(v, id, hashRecord, true);
3434+}
···11+{
22+ "lexicon": 1,
33+ "id": "network.cosmik.follow",
44+ "description": "A record representing a follow relationship.",
55+ "defs": {
66+ "main": {
77+ "type": "record",
88+ "description": "A record representing a follow of a user or collection.",
99+ "key": "tid",
1010+ "record": {
1111+ "type": "object",
1212+ "required": ["subject", "createdAt"],
1313+ "properties": {
1414+ "subject": {
1515+ "type": "string",
1616+ "description": "DID of the user being followed, or AT URI of the collection being followed"
1717+ },
1818+ "createdAt": {
1919+ "type": "string",
2020+ "format": "datetime",
2121+ "description": "Timestamp when this follow was created."
2222+ }
2323+ }
2424+ }
2525+ }
2626+ }
2727+}
···110110 updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
111111 )`,
112112113113- // Follows table (no dependencies)
113113+ // Follows table (references published_records)
114114 sql`CREATE TABLE IF NOT EXISTS follows (
115115 follower_id TEXT NOT NULL,
116116 target_id TEXT NOT NULL,
117117 target_type TEXT NOT NULL,
118118+ published_record_id UUID REFERENCES published_records(id),
118119 created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
119120 PRIMARY KEY (follower_id, target_id, target_type)
120121 )`,