1. CREATE DATABASE IF NOT EXISTS hos
2. DEFAULT CHARACTER SET UTF8
3. COLLATE UTF8_GENERAL_CI;
4.
5. USE hos;
6.
7. --
8. -- Table structure for table `USER_INFO`
9. --
10. DROP TABLE IF EXISTS USER_INFO;
11.
12. CREATE TABLE USER_INFO
13. (
14. USER_ID VARCHAR(32) NOT NULL,
15. USER_NAME VARCHAR(32) NOT NULL,
16. PASSWORD VARCHAR(64) NOT NULL
17. COMMENT 'PASSWORD md5',
18. SYSTEM_ROLE VARCHAR(32) NOT NULL
19. COMMENT 'ADMIN OR USER',
20. CREATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
21. DETAIL VARCHAR(256),
22. PRIMARY KEY (USER_ID),
23. UNIQUE KEY AK_UQ_USER_NAME (USER_NAME)
24. )
25. ENGINE = InnoDB
26. DEFAULT CHARSET = utf8
27. COMMENT = '用户信息';
28.
29. --
30. -- Table structure for table `TOKEN_INFO`
31. --
32.
33. DROP TABLE IF EXISTS TOKEN_INFO;
34.
35. CREATE TABLE TOKEN_INFO
36. (
37. TOKEN VARCHAR(32) NOT NULL,
38. EXPIRE_TIME INT(11) NOT NULL,
39. CREATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
40. REFRESH_TIME TIMESTAMP NOT NULL,
41. ACTIVE TINYINT NOT NULL,
42. CREATOR VARCHAR(32) NOT NULL,
43. PRIMARY KEY (TOKEN)
44. )
45. ENGINE = InnoDB
46. DEFAULT CHARSET = utf8
47. COMMENT = 'token 信息表';
48.
49. --
50. -- Table structure for table `HOS_BUCKET`
51. --
52.
53. DROP TABLE IF EXISTS HOS_BUCKET;
54.
55. CREATE TABLE HOS_BUCKET (
56. BUCKET_ID VARCHAR(32),
57. BUCKET_NAME VARCHAR(32),
58. CREATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
59. DETAIL VARCHAR(256),
60. CREATOR VARCHAR(32) NOT NULL,
61. UNIQUE KEY AK_KEY_BUCKET_NAME(BUCKET_NAME),
62. PRIMARY KEY (BUCKET_ID)
63. )
64. ENGINE = InnoDB
65. DEFAULT CHARSET = utf8
66. COMMENT = 'HOS BUCKET';
67.
68. --
69. -- Table structure for table SERVICE_AUTH
70. --
71.
72. DROP TABLE IF EXISTS SERVICE_AUTH;
73.
74. CREATE TABLE SERVICE_AUTH
75. (
76. BUCKET_NAME VARCHAR(32) NOT NULL,
77. TARGET_TOKEN VARCHAR(32) NOT NULL
78. COMMENT '被授权对象token',
79. AUTH_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
80. PRIMARY KEY (BUCKET_NAME, TARGET_TOKEN)
81. )
82. ENGINE = InnoDB
83. DEFAULT CHARSET = utf8
84. COMMENT = '对象存储服务授权表';
85.