I'd limit input size for a user's name and email, and ensure they exist here:
|
CREATE TABLE IF NOT EXISTS interests ( |
|
id SERIAL PRIMARY KEY, |
|
name TEXT, |
|
email TEXT, |
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP |
|
); |
CREATE TABLE IF NOT EXISTS interests (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
And here limit the title size and enforce uniqueness. Also make sure the date exists (optional).
|
CREATE TABLE IF NOT EXISTS stories ( |
|
id SERIAL PRIMARY KEY, |
|
title TEXT, |
|
content TEXT, |
|
date DATE, |
|
comments TEXT, |
|
interest_id INTEGER REFERENCES interests(id), |
|
embedding vector(1536) |
|
); |
CREATE TABLE IF NOT EXISTS stories (
id SERIAL PRIMARY KEY,
title VARCHAR(1000) NOT NULL UNIQUE,
content TEXT,
date DATE NOT NULL,
comments TEXT,
interest_id INTEGER REFERENCES interests(id),
embedding vector(1536)
);
DATE could be changed to DATETIME type but that would involve a wider range of project changes.
I'd limit input size for a user's name and email, and ensure they exist here:
agentkit-render-tutorial/packages/indexer/schema.sql
Lines 3 to 8 in d8a1617
And here limit the title size and enforce uniqueness. Also make sure the date exists (optional).
agentkit-render-tutorial/packages/indexer/schema.sql
Lines 10 to 18 in d8a1617
DATEcould be changed toDATETIMEtype but that would involve a wider range of project changes.