/**
 * Schema for the file lixcol metadata cache.
 *
 * This cache stores the expensive-to-compute lixcol columns for files,
 * avoiding the need for complex subqueries in the file view.
 *
 * The view can query this table directly using SQL:
 * SELECT latest_change_id, latest_commit_id, created_at, updated_at, writer_key
 * FROM lix_internal_file_lixcol_cache
 * WHERE file_id = ? AND version_id = ?
 */
export function applyFileLixcolCacheSchema(args) {
    // Create the cache table for file lixcol metadata
    args.engine.sqlite.exec(`
		CREATE TABLE IF NOT EXISTS lix_internal_file_lixcol_cache (
			file_id TEXT NOT NULL,
			version_id TEXT NOT NULL,
			latest_change_id TEXT,
			latest_commit_id TEXT,
			created_at TEXT,
			updated_at TEXT,
			writer_key TEXT,
			PRIMARY KEY (file_id, version_id)
		) STRICT;

		-- Index for fast lookups
		CREATE INDEX IF NOT EXISTS idx_file_lixcol_cache_lookup 
		ON lix_internal_file_lixcol_cache(file_id, version_id);
	`);
}
//# sourceMappingURL=lixcol-schema.js.map