dd/drizzle/0001_wakeful_silver_fox.sql
pd0a6847 bdffa90305 Refactor user management and authentication system
- Removed nickname from user table and UserRecord interface.
- Updated user creation to generate UUID for user ID.
- Changed user ID type from number to string in authentication functions.
- Modified database schema to accommodate new user structure.
- Enhanced login flow to redirect users based on query parameters.
- Improved profile management with nickname update functionality.
- Added automatic nickname setting based on email input during registration.
- Implemented WebSocket connection management and duplicate login detection.
- Updated UI components for better user experience and responsiveness.
2025-11-20 15:46:17 +09:00

14 lines
694 B
SQL

PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_users` (
`id` text PRIMARY KEY NOT NULL,
`email` text NOT NULL,
`password_hash` text NOT NULL,
`nickname` text NOT NULL,
`created_at` integer DEFAULT (strftime('%s', 'now')) NOT NULL
);
--> statement-breakpoint
INSERT INTO `__new_users`("id", "email", "password_hash", "nickname", "created_at") SELECT "id", "email", "password_hash", "nickname", "created_at" FROM `users`;--> statement-breakpoint
DROP TABLE `users`;--> statement-breakpoint
ALTER TABLE `__new_users` RENAME TO `users`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);