2019-05-12 20:39:01 +08:00
|
|
|
|
CREATE TABLE Users (
|
2018-11-02 12:46:56 +08:00
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
UserName NVARCHAR (50) NOT NULL,
|
|
|
|
|
Password VARCHAR (50) NOT NULL,
|
|
|
|
|
PassSalt VARCHAR (50) NOT NULL,
|
|
|
|
|
DisplayName VARCHAR (50) NOT NULL,
|
|
|
|
|
RegisterTime DATETIME NOT NULL,
|
|
|
|
|
ApprovedTime DATETIME,
|
|
|
|
|
ApprovedBy VARCHAR (50),
|
|
|
|
|
Description VARCHAR (500) NOT NULL,
|
|
|
|
|
RejectedBy VARCHAR (50),
|
|
|
|
|
RejectedTime DATETIME,
|
|
|
|
|
RejectedReason VARCHAR (50),
|
|
|
|
|
Icon VARCHAR (50),
|
2019-02-27 15:57:58 +08:00
|
|
|
|
Css VARCHAR (50),
|
|
|
|
|
App VARCHAR (50)
|
2018-11-02 12:46:56 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE UserRole (
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
UserID INT NOT NULL,
|
|
|
|
|
RoleID INT NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE UserGroup(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
UserID INT NOT NULL,
|
|
|
|
|
GroupID INT NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Roles(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
2019-02-26 17:02:38 +08:00
|
|
|
|
RoleName VARCHAR (50) NOT NULL,
|
2018-11-02 12:46:56 +08:00
|
|
|
|
Description VARCHAR (500) NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE RoleGroup(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
RoleID INT NOT NULL,
|
|
|
|
|
GroupID INT NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
2019-02-24 16:14:09 +08:00
|
|
|
|
CREATE TABLE RoleApp(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
AppID VARCHAR (500) NOT NULL,
|
|
|
|
|
RoleID INT NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
2018-11-02 12:46:56 +08:00
|
|
|
|
CREATE TABLE Notifications(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
Category VARCHAR (50) NOT NULL,
|
|
|
|
|
Title VARCHAR (50) NOT NULL,
|
|
|
|
|
Content VARCHAR (50) NOT NULL,
|
|
|
|
|
RegisterTime DATETIME NOT NULL,
|
|
|
|
|
ProcessTime DATETIME NULL,
|
|
|
|
|
ProcessBy VARCHAR (50) NULL,
|
|
|
|
|
ProcessResult VARCHAR (50) NULL,
|
|
|
|
|
Status VARCHAR (50) DEFAULT 0
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Navigations(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
ParentId INT DEFAULT 0,
|
|
|
|
|
Name VARCHAR (50) NOT NULL,
|
2019-01-12 11:39:23 +08:00
|
|
|
|
`Order` INT NOT NULL DEFAULT 0,
|
2018-11-02 12:46:56 +08:00
|
|
|
|
Icon VARCHAR (50) DEFAULT 'fa fa-fa',
|
|
|
|
|
Url VARCHAR (4000) NULL,
|
|
|
|
|
Category VARCHAR (50) DEFAULT 0,
|
|
|
|
|
Target VARCHAR (10) DEFAULT '_self',
|
|
|
|
|
IsResource INT DEFAULT 0,
|
|
|
|
|
Application VARCHAR (200) DEFAULT 0
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE NavigationRole(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
NavigationID INT NOT NULL,
|
|
|
|
|
RoleID INT NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Logs(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
CRUD VARCHAR (50) NOT NULL,
|
|
|
|
|
UserName VARCHAR (50) NOT NULL,
|
2019-03-04 16:40:28 +08:00
|
|
|
|
LogTime DATETIME NOT NULL,
|
|
|
|
|
Ip VARCHAR (15) NOT NULL,
|
|
|
|
|
Browser VARCHAR (50) NULL,
|
|
|
|
|
OS VARCHAR (50) NULL,
|
|
|
|
|
City VARCHAR (50) NULL,
|
2019-03-09 19:46:58 +08:00
|
|
|
|
RequestUrl VARCHAR (500) NOT NULL,
|
2019-04-30 00:15:11 +08:00
|
|
|
|
RequestData MEDIUMTEXT NULL,
|
2019-04-27 20:39:24 +08:00
|
|
|
|
UserAgent VARCHAR (2000) NULL
|
2018-11-02 12:46:56 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE `Groups`(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
2019-02-26 17:02:38 +08:00
|
|
|
|
GroupName VARCHAR (50) NOT NULL,
|
2018-11-02 12:46:56 +08:00
|
|
|
|
Description VARCHAR (500) NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Exceptions(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
AppDomainName VARCHAR (50) NOT NULL,
|
|
|
|
|
ErrorPage VARCHAR (50) NOT NULL,
|
|
|
|
|
UserID VARCHAR (50) NULL,
|
|
|
|
|
UserIp VARCHAR (15) NULL,
|
|
|
|
|
ExceptionType TEXT NOT NULL,
|
|
|
|
|
Message TEXT NOT NULL,
|
|
|
|
|
StackTrace TEXT NULL,
|
2019-04-16 17:58:46 +08:00
|
|
|
|
LogTime DATETIME NOT NULL,
|
|
|
|
|
Category VARCHAR (50) NULL
|
2018-11-02 12:46:56 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Dicts(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
Category VARCHAR (50) NOT NULL,
|
|
|
|
|
Name VARCHAR (50) NOT NULL,
|
2019-04-27 11:08:45 +08:00
|
|
|
|
Code VARCHAR (2000) NOT NULL,
|
2019-01-12 17:59:42 +08:00
|
|
|
|
Define INT NOT NULL DEFAULT 1
|
2018-11-02 12:46:56 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Messages(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
Title VARCHAR (50) NOT NULL,
|
|
|
|
|
Content VARCHAR (500) NOT NULL,
|
|
|
|
|
`From` VARCHAR (50) NOT NULL,
|
|
|
|
|
`To` VARCHAR (50) NOT NULL,
|
|
|
|
|
SendTime DATETIME NOT NULL,
|
|
|
|
|
Status VARCHAR (50) NOT NULL,
|
|
|
|
|
Flag INT DEFAULT 0,
|
|
|
|
|
IsDelete INT DEFAULT 0,
|
|
|
|
|
Label VARCHAR (50)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Tasks(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
TaskName VARCHAR (500) NOT NULL,
|
|
|
|
|
AssignName VARCHAR (50) NOT NULL,
|
|
|
|
|
UserName VARCHAR (50) NOT NULL,
|
|
|
|
|
TaskTime INT NOT NULL,
|
|
|
|
|
TaskProgress INT NOT NULL,
|
|
|
|
|
AssignTime DATETIME NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE RejectUsers(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
UserName VARCHAR (50) NOT NULL,
|
|
|
|
|
DisplayName VARCHAR (50) NOT NULL,
|
|
|
|
|
RegisterTime DATETIME NOT NULL,
|
2019-02-26 17:02:38 +08:00
|
|
|
|
RejectedBy VARCHAR (50) NOT NULL,
|
|
|
|
|
RejectedTime DATETIME NOT NULL,
|
2018-11-02 12:46:56 +08:00
|
|
|
|
RejectedReason VARCHAR (50) NULL
|
2019-03-04 01:34:43 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE LoginLogs(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
UserName VARCHAR (50) NOT NULL,
|
|
|
|
|
LoginTime DATETIME NOT NULL,
|
2019-03-22 15:46:32 +08:00
|
|
|
|
Ip VARCHAR (15) NOT NULL,
|
2019-03-04 01:34:43 +08:00
|
|
|
|
OS VARCHAR (50) NULL,
|
|
|
|
|
Browser VARCHAR (50) NULL,
|
|
|
|
|
City VARCHAR (50) NULL,
|
2019-04-27 20:39:24 +08:00
|
|
|
|
Result VARCHAR (50) NOT NULL,
|
|
|
|
|
UserAgent VARCHAR (2000) NULL
|
2019-03-05 13:14:58 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE ResetUsers(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
UserName VARCHAR (50) NOT NULL,
|
|
|
|
|
DisplayName VARCHAR (50) NOT NULL,
|
|
|
|
|
Reason VARCHAR (500) NOT NULL,
|
|
|
|
|
ResetTime DATETIME NOT NULL
|
2019-03-16 20:24:33 +08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE Traces(
|
|
|
|
|
ID INTEGER PRIMARY KEY Auto_increment,
|
|
|
|
|
UserName VARCHAR (50) NOT NULL,
|
|
|
|
|
LogTime DATETIME NOT NULL,
|
|
|
|
|
IP VARCHAR (15) NOT NULL,
|
|
|
|
|
Browser VARCHAR (50),
|
|
|
|
|
OS VARCHAR (50),
|
|
|
|
|
City VARCHAR (50),
|
2019-04-27 20:39:24 +08:00
|
|
|
|
RequestUrl VARCHAR (500) NOT NULL,
|
|
|
|
|
UserAgent VARCHAR (2000) NULL
|
2018-11-02 12:46:56 +08:00
|
|
|
|
);
|