Timify uses Drizzle Kit to manage schema evolution. The source of truth isDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Aking16/timify/llms.txt
Use this file to discover all available pages before exploring further.
src/db/schema.ts; Drizzle Kit compares that file against the live database (or generates SQL migration files from it) so your SQLite schema always stays in sync with your TypeScript definitions. All generated migration files are stored in the ./drizzle/ directory and tracked in version control.
Configuration
Drizzle Kit is configured indrizzle.config.ts at the project root:
| Option | Value | Notes |
|---|---|---|
out | ./drizzle | Where migration SQL files and the meta journal are written |
schema | ./src/db/schema.ts | Single schema file containing all table definitions |
dialect | sqlite | Targets SQLite via @libsql/client |
dbCredentials.url | DB_FILE_NAME env var | Falls back to file:./src/db/local.db if the variable is unset |
Set the
DB_FILE_NAME environment variable in your .env.local file, for example DB_FILE_NAME=file:./src/db/local.db. The file: prefix is required by @libsql/client.Migration History
The journal file atdrizzle/meta/_journal.json records every applied migration in order. Timify currently has three migrations:
| Index | Tag | Timestamp |
|---|---|---|
| 0 | 0000_typical_wolfpack | 2026-05-14 |
| 1 | 0001_perpetual_spitfire | 2026-05-19 |
| 2 | 0002_pink_darkhawk | 2026-05-20 |
Migration 0 — 0000_typical_wolfpack.sql
This is the initial schema migration. It creates all eight tables from scratch and establishes every foreign-key relationship and index.
Tables created: user, session, account, verification, projects, time_entries, tags, time_entry_tags
Foreign keys added:
account.user_id→user.id(cascade delete)projects.user_id→user.id(cascade delete)session.user_id→user.id(cascade delete)tags.user_id→user.id(cascade delete)time_entries.user_id→user.id(cascade delete)time_entries.project_id→projects.id(set null on delete)time_entry_tags.time_entry_id→time_entries.id(cascade delete)time_entry_tags.tag_id→tags.id(cascade delete)
account_userId_idx, session_userId_idx, verification_identifier_idx
Migration 1 — 0001_perpetual_spitfire.sql
This migration hardens nullable columns that were missing NOT NULL constraints in the initial schema, and adds missing columns to projects and tags.
Changes:
projects.created_at— madeNOT NULLtime_entries.created_at— madeNOT NULLtime_entries.updated_at— given aDEFAULT now()and madeNOT NULLprojects— new columnhourly_rate real DEFAULT 0projects— new columnupdated_at timestamp DEFAULT now() NOT NULLtags— new columncreated_at timestamp DEFAULT now() NOT NULLtags— new columnupdated_at timestamp DEFAULT now() NOT NULL
Migration 2 — 0002_pink_darkhawk.sql
This migration adds the composite unique constraint to the time_entry_tags join table, preventing a tag from being applied to the same time entry more than once.
Change: time_entry_tags — new constraint time_entry_tags_time_entry_id_tag_id_unique on (time_entry_id, tag_id)
Drizzle Kit Commands
The project’s
AGENTS.md lists npx drizzle-kit push and npx drizzle-kit studio as the primary day-to-day commands. The generate and migrate commands are available for production-grade deployments where an auditable migration trail is required.drizzle-kit push — Sync schema directly to the database
src/db/schema.ts, introspects the live database, and applies the diff without generating any migration files. Changes are immediate.
When to use: Local development, single-developer instances, or rapid prototyping where you want schema changes reflected instantly without maintaining a migration history.
drizzle-kit generate — Generate a migration file from schema changes
src/db/schema.ts against the last snapshot in drizzle/meta/ and writes a new numbered .sql file to ./drizzle/. Nothing is applied to the database yet.
When to use: Before deploying to staging or production. Review the generated SQL before running migrate.
drizzle-kit migrate — Apply pending migration files
drizzle/meta/_journal.json, determines which migrations have not yet been applied to the target database, and runs them in order.
When to use: Production deployments and any environment where you need a controlled, auditable rollout of schema changes.
drizzle-kit studio — Visual database browser
push vs migrate — which should you use?Use drizzle-kit push during local development and for single-instance self-hosted deployments where you don’t need an auditable migration trail. It is faster and requires no intermediate file generation.Use drizzle-kit generate + drizzle-kit migrate for production or any multi-environment setup (staging → production). Migration files can be reviewed in pull requests, rolled back by reverting commits, and re-run reliably on any fresh database — giving you full control over schema changes.