Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. -- Create database called 'Oxygen' --
  2.  
  3. CREATE DATABASE IF NOT EXISTS `oxygen` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
  4. USE oxygen;
  5.  
  6.  
  7. -- Create new table for users --
  8.  
  9. CREATE TABLE `users` (
  10.  
  11. `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'ID ',
  12.  
  13. `username` varchar(255) DEFAULT NULL,
  14.  
  15. `role` enum('admin','user') NOT NULL DEFAULT 'user',
  16.  
  17. `password` varchar(255) NOT NULL,
  18.  
  19. `created_at` timestamp NULL DEFAULT NULL,
  20.  
  21. `updated_at` timestamp NULL DEFAULT NULL
  22.  
  23. ) COMMENT='Users table';
  24.  
  25.  
  26. -- Insert new user: admin, password: admin ---
  27. INSERT INTO `users` (`id`, `username`, `role`, `email`, `password`, `created_at`, `updated_at`) VALUES
  28. (1, 'admin', 'admin', 'admin@example.com', '$2y$10$wakNCVErdbYpXDdeNC/eDeSUMgcKLg1/48ZAFgYcwJeXF859O4yHi', NULL, NULL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement