CREATE TABLE `cache` (
	`key` text PRIMARY KEY NOT NULL,
	`value` text NOT NULL,
	`expire_at` integer NOT NULL,
	`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE TABLE `xhs_note` (
	`id` text PRIMARY KEY NOT NULL,
	`title` text,
	`summary` text,
	`description` text,
	`link` text,
	`data` text,
	`tags` text,
	`status` text,
	`author_url` text,
	`cover` text,
	`sync_status` integer NOT NULL,
	`sync_at` integer NOT NULL,
	`star` integer,
	`user_id` text,
	`pushed_at` integer,
	`created_at` integer NOT NULL,
	`updated_at` integer NOT NULL,
	`deleted_at` integer
);
--> statement-breakpoint
CREATE INDEX `idx_xhs_note_user_id` ON `xhs_note` (`user_id`);--> statement-breakpoint
CREATE INDEX `idx_xhs_note_tags` ON `xhs_note` (`tags`);--> statement-breakpoint
CREATE TABLE `xhs_user` (
	`id` text PRIMARY KEY NOT NULL,
	`user_id` text NOT NULL,
	`xsec_token` text,
	`username` text,
	`nickname` text,
	`avatar` text,
	`title` text,
	`summary` text,
	`description` text,
	`link` text,
	`data` text,
	`tags` text,
	`bun_tags` text,
	`followers_count` integer,
	`following_count` integer,
	`status` text,
	`sync_status` integer DEFAULT 0 NOT NULL,
	`sync_at` integer DEFAULT 0 NOT NULL,
	`star` integer,
	`created_at` integer DEFAULT 1767349555883 NOT NULL,
	`updated_at` integer DEFAULT 1767349555883 NOT NULL,
	`deleted_at` integer
);
--> statement-breakpoint
CREATE INDEX `idx_xhs_user_user_id` ON `xhs_user` (`user_id`);--> statement-breakpoint
CREATE INDEX `idx_xhs_user_tags` ON `xhs_user` (`tags`);--> statement-breakpoint
CREATE INDEX `idx_xhs_user_bun_tags` ON `xhs_user` (`bun_tags`);