···1+# If you prefer the allow list template instead of the deny list, see community template:
2+# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+#
4+# Binaries for programs and plugins
5+*.exe
6+*.exe~
7+*.dll
8+*.so
9+*.dylib
10+11+# Test binary, built with `go test -c`
12+*.test
13+14+# Code coverage profiles and other test artifacts
15+*.out
16+coverage.*
17+*.coverprofile
18+profile.cov
19+20+# Dependency directories (remove the comment below to include it)
21+# vendor/
22+23+# Go workspace file
24+go.work
25+go.work.sum
26+27+# env file
28+.env
29+30+# Editor/IDE
31+# .idea/
32+# .vscode/
+5
README.md
···00000
···1+# Noteleaf
2+3+A task & time management CLI built with Golang & Charm.sh libs.
4+5+## Development
···1+CREATE TABLE IF NOT EXISTS migrations (
2+ id INTEGER PRIMARY KEY,
3+ version TEXT UNIQUE NOT NULL,
4+ applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
5+);
···1+-- Drop books table and indexes
2+DROP INDEX IF EXISTS idx_books_title;
3+DROP INDEX IF EXISTS idx_books_author;
4+DROP INDEX IF EXISTS idx_books_status;
5+DROP TABLE IF EXISTS books;
6+7+-- Drop TV shows table and indexes
8+DROP INDEX IF EXISTS idx_tv_shows_season_episode;
9+DROP INDEX IF EXISTS idx_tv_shows_title;
10+DROP INDEX IF EXISTS idx_tv_shows_status;
11+DROP TABLE IF EXISTS tv_shows;
12+13+-- Drop movies table and indexes
14+DROP INDEX IF EXISTS idx_movies_title;
15+DROP INDEX IF EXISTS idx_movies_status;
16+DROP TABLE IF EXISTS movies;
17+18+-- Drop tasks table and indexes
19+DROP INDEX IF EXISTS idx_tasks_uuid;
20+DROP INDEX IF EXISTS idx_tasks_due;
21+DROP INDEX IF EXISTS idx_tasks_project;
22+DROP INDEX IF EXISTS idx_tasks_status;
23+DROP TABLE IF EXISTS tasks;
···1+-- Tasks table
2+CREATE TABLE IF NOT EXISTS tasks (
3+ id INTEGER PRIMARY KEY AUTOINCREMENT,
4+ uuid TEXT UNIQUE NOT NULL,
5+ description TEXT NOT NULL,
6+ status TEXT DEFAULT 'pending',
7+ priority TEXT,
8+ project TEXT,
9+ tags TEXT, -- JSON array
10+ due DATETIME,
11+ entry DATETIME DEFAULT CURRENT_TIMESTAMP,
12+ modified DATETIME DEFAULT CURRENT_TIMESTAMP,
13+ end DATETIME,
14+ start DATETIME,
15+ annotations TEXT -- JSON array
16+);
17+18+CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status);
19+CREATE INDEX IF NOT EXISTS idx_tasks_project ON tasks(project);
20+CREATE INDEX IF NOT EXISTS idx_tasks_due ON tasks(due);
21+CREATE INDEX IF NOT EXISTS idx_tasks_uuid ON tasks(uuid);
22+23+-- Movies table
24+CREATE TABLE IF NOT EXISTS movies (
25+ id INTEGER PRIMARY KEY AUTOINCREMENT,
26+ title TEXT NOT NULL,
27+ year INTEGER,
28+ status TEXT DEFAULT 'queued',
29+ rating REAL,
30+ notes TEXT,
31+ added DATETIME DEFAULT CURRENT_TIMESTAMP,
32+ watched DATETIME
33+);
34+35+CREATE INDEX IF NOT EXISTS idx_movies_status ON movies(status);
36+CREATE INDEX IF NOT EXISTS idx_movies_title ON movies(title);
37+38+-- TV Shows table
39+CREATE TABLE IF NOT EXISTS tv_shows (
40+ id INTEGER PRIMARY KEY AUTOINCREMENT,
41+ title TEXT NOT NULL,
42+ season INTEGER,
43+ episode INTEGER,
44+ status TEXT DEFAULT 'queued',
45+ rating REAL,
46+ notes TEXT,
47+ added DATETIME DEFAULT CURRENT_TIMESTAMP,
48+ last_watched DATETIME
49+);
50+51+CREATE INDEX IF NOT EXISTS idx_tv_shows_status ON tv_shows(status);
52+CREATE INDEX IF NOT EXISTS idx_tv_shows_title ON tv_shows(title);
53+CREATE INDEX IF NOT EXISTS idx_tv_shows_season_episode ON tv_shows(title, season, episode);
54+55+-- Books table
56+CREATE TABLE IF NOT EXISTS books (
57+ id INTEGER PRIMARY KEY AUTOINCREMENT,
58+ title TEXT NOT NULL,
59+ author TEXT,
60+ status TEXT DEFAULT 'queued',
61+ progress INTEGER DEFAULT 0,
62+ pages INTEGER,
63+ rating REAL,
64+ notes TEXT,
65+ added DATETIME DEFAULT CURRENT_TIMESTAMP,
66+ started DATETIME,
67+ finished DATETIME
68+);
69+70+CREATE INDEX IF NOT EXISTS idx_books_status ON books(status);
71+CREATE INDEX IF NOT EXISTS idx_books_author ON books(author);
72+CREATE INDEX IF NOT EXISTS idx_books_title ON books(title);