Files
award/drizzle/0000_burly_unus.sql
Joerg 8c26fc93e3 Initial commit: Ham Radio Award Portal
Features implemented:
- User authentication (register/login) with JWT
- SQLite database with Drizzle ORM
- SvelteKit frontend with authentication flow
- ElysiaJS backend with CORS enabled
- Award definition JSON schemas (DXCC, WAS, VUCC, SAT)
- Responsive dashboard with user profile

Tech stack:
- Backend: ElysiaJS, Drizzle ORM, SQLite, JWT
- Frontend: SvelteKit, Svelte stores
- Runtime: Bun
- Language: JavaScript

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 11:01:10 +01:00

65 lines
1.8 KiB
SQL

CREATE TABLE `award_progress` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` integer NOT NULL,
`award_id` text NOT NULL,
`worked_count` integer DEFAULT 0 NOT NULL,
`confirmed_count` integer DEFAULT 0 NOT NULL,
`total_required` integer NOT NULL,
`worked_entities` text,
`confirmed_entities` text,
`last_calculated_at` integer,
`last_qso_sync_at` integer,
`updated_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`award_id`) REFERENCES `awards`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `awards` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`description` text,
`definition` text NOT NULL,
`is_active` integer DEFAULT true NOT NULL,
`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE TABLE `qsos` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` integer NOT NULL,
`callsign` text NOT NULL,
`qso_date` text NOT NULL,
`time_on` text NOT NULL,
`band` text,
`mode` text,
`freq` integer,
`freq_rx` integer,
`entity` text,
`entity_id` integer,
`grid` text,
`grid_source` text,
`continent` text,
`cq_zone` integer,
`itu_zone` integer,
`state` text,
`county` text,
`sat_name` text,
`sat_mode` text,
`lotw_qsl_rdate` text,
`lotw_qsl_rstatus` text,
`lotw_synced_at` integer,
`created_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `users` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`email` text NOT NULL,
`password_hash` text NOT NULL,
`callsign` text NOT NULL,
`lotw_username` text,
`lotw_password` text,
`created_at` integer NOT NULL,
`updated_at` integer NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);