34619-vm/db/migrations/001_create_users_table.sql
2025-10-03 13:03:26 +00:00

12 lines
497 B
SQL

CREATE TABLE IF NOT EXISTS `users` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`username` VARCHAR(50) NOT NULL UNIQUE,
`password` VARCHAR(255) NOT NULL,
`email` VARCHAR(100) NOT NULL UNIQUE,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Insert a default admin user for testing
-- IMPORTANT: This is for initial setup only. Passwords should be hashed in a real application.
INSERT IGNORE INTO `users` (`username`, `password`, `email`) VALUES ('admin', 'admin', 'admin@example.com');