Skip to content

Commit 5020f00

Browse files
Ja1zmeclaude
andcommitted
fix(desktop): corregir schema SQLite — añadir columnas is_read/notes/reminder_at + bump v0.3.18
El sqlite-driver.ts creaba la tabla links sin las columnas is_read, notes, reminder_at que sí existen en schema.sqlite.ts. Drizzle ORM genera SELECT con todos los campos del schema, causando "no such column: is_read" al crear/listar enlaces en la app desktop. Cambios: - sqlite-driver.ts: añadir is_read, notes, reminder_at al CREATE TABLE links - sqlite-driver.ts: añadir índices idx_links_is_read e idx_links_user_favorite - sqlite-driver.ts: migraciones incrementales para DBs existentes (v0.3.17) - Bump version 0.3.17 → 0.3.18 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 18d1b15 commit 5020f00

4 files changed

Lines changed: 31 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stacklume",
3-
"version": "0.3.17",
3+
"version": "0.3.18",
44
"private": true,
55
"author": "Stacklume",
66
"description": "Link management dashboard with bento grid layout",

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stacklume"
3-
version = "0.3.17"
3+
version = "0.3.18"
44
edition = "2021"
55

66
[lib]

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "Stacklume",
4-
"version": "0.3.17",
4+
"version": "0.3.18",
55
"identifier": "com.stacklume.app",
66
"build": {
77
"beforeDevCommand": "pnpm dev:tauri",
@@ -67,4 +67,4 @@
6767
}
6868
}
6969
}
70-
}
70+
}

src/lib/db/sqlite-driver.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ async function initializeSQLiteTables(client: ReturnType<typeof createClient>) {
141141
updated_at INTEGER NOT NULL,
142142
deleted_at INTEGER,
143143
last_checked_at INTEGER,
144-
health_status TEXT
144+
health_status TEXT,
145+
is_read INTEGER DEFAULT 0,
146+
notes TEXT,
147+
reminder_at INTEGER
145148
)`,
146149
`CREATE INDEX IF NOT EXISTS idx_links_user_id ON links(user_id)`,
147150
`CREATE UNIQUE INDEX IF NOT EXISTS idx_links_url ON links(url)`,
@@ -154,6 +157,8 @@ async function initializeSQLiteTables(client: ReturnType<typeof createClient>) {
154157
`CREATE INDEX IF NOT EXISTS idx_links_health_status ON links(health_status)`,
155158
`CREATE INDEX IF NOT EXISTS idx_links_category_created_at ON links(category_id, created_at)`,
156159
`CREATE INDEX IF NOT EXISTS idx_links_user_created_at ON links(user_id, created_at)`,
160+
`CREATE INDEX IF NOT EXISTS idx_links_is_read ON links(is_read)`,
161+
`CREATE INDEX IF NOT EXISTS idx_links_user_favorite ON links(user_id, is_favorite)`,
157162
`CREATE TABLE IF NOT EXISTS tags (
158163
id TEXT PRIMARY KEY,
159164
user_id TEXT REFERENCES users(id) ON DELETE CASCADE,
@@ -278,6 +283,27 @@ async function runSQLiteMigrations(client: ReturnType<typeof createClient>) {
278283
sql: `ALTER TABLE user_settings ADD COLUMN mcp_api_key TEXT`,
279284
description: "user_settings.mcp_api_key",
280285
},
286+
// v0.3.18 — Campos de lectura y recordatorio en enlaces
287+
{
288+
sql: `ALTER TABLE links ADD COLUMN is_read INTEGER DEFAULT 0`,
289+
description: "links.is_read",
290+
},
291+
{
292+
sql: `ALTER TABLE links ADD COLUMN notes TEXT`,
293+
description: "links.notes",
294+
},
295+
{
296+
sql: `ALTER TABLE links ADD COLUMN reminder_at INTEGER`,
297+
description: "links.reminder_at",
298+
},
299+
{
300+
sql: `CREATE INDEX IF NOT EXISTS idx_links_is_read ON links(is_read)`,
301+
description: "idx_links_is_read",
302+
},
303+
{
304+
sql: `CREATE INDEX IF NOT EXISTS idx_links_user_favorite ON links(user_id, is_favorite)`,
305+
description: "idx_links_user_favorite",
306+
},
281307
];
282308

283309
for (const migration of migrations) {

0 commit comments

Comments
 (0)