-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_init.sql
More file actions
33 lines (21 loc) · 890 Bytes
/
db_init.sql
File metadata and controls
33 lines (21 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE DATABASE `example-server-deno` COLLATE utf8_unicode_ci;
USE `example-server-deno`;
CREATE TABLE `users` (
`id` bigint(20) NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`role` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`);
ALTER TABLE `users`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
INSERT INTO `users` (`email`, `password`, `phone`, `role`) VALUES
('admin@admin.com', '$2b$10$5Qm3Z62Llku5fGp3nHDubO1U8wbo2zMCGTy2xglmf.FyzFgBB8siG', '111222333', 'administrator');
COMMIT;