|
@@ -0,0 +1,54 @@
|
|
|
+CREATE DATABASE Coffee DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
|
+
|
|
|
+
|
|
|
+CREATE TABLE IF NOT EXISTS user (
|
|
|
+userID int(11) NOT NULL AUTO_INCREMENT,
|
|
|
+datetime TIMESTAMP NOT NULL DEFAULT current_timestamp() COMMENT '紀錄時間',
|
|
|
+firstname varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '姓氏',
|
|
|
+lastname varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名字',
|
|
|
+mail varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '電子郵件',
|
|
|
+phone varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '連絡電話',
|
|
|
+username varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '使用者名稱',
|
|
|
+password varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密碼',
|
|
|
+status int(11) NOT NULL COMMENT '0:admin;1:superuser;2:enduser;8:new;9:disable',
|
|
|
+PRIMARY KEY(userID)
|
|
|
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
+
|
|
|
+INSERT INTO user (firstname, lastname, mail, phone, username, password, status) VALUES
|
|
|
+('firstname', 'lastname', 'aaa@gmail.com', '0987654321', 'user', '123456', 1);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|