-
Notifications
You must be signed in to change notification settings - Fork 41
新增数据库配置信息和文档 #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
新增数据库配置信息和文档 #67
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3c8be08
fix: add database sql file
wjiangwang 24c9a22
docs: update readme database
wjiangwang a583d77
fix: fix error log
wjiangwang 17a1dde
fix: fix token expire
wjiangwang 8ebb604
feat: auto create database
wjiangwang 6de782b
docs: update pro readme
wjiangwang cc4e5ef
docs: update pro readme
wjiangwang bff53b3
docs: update pro readme
wjiangwang a3f2325
fix: pro init log info
wjiangwang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { Application } from 'egg'; | ||
|
|
||
| export default (app: Application) => { | ||
| // 数据库模型同步,只建议在开发环境下使用 | ||
| if (app.config.env === 'local') { | ||
| try { | ||
| app.beforeStart(async () => { | ||
| await app.model.sync({ alter: true }); | ||
| }); | ||
| } catch (error) { | ||
| console.error('数据库同步失败,请检查数据库配置信息或手动创建数据库', error); | ||
| } | ||
| } | ||
| }; | ||
17 changes: 0 additions & 17 deletions
17
packages/toolkits/pro/template/server/eggJs/app/database/buryinfo.sql
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
packages/toolkits/pro/template/server/eggJs/app/database/createuser.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| INSERT INTO registeruser | ||
| VALUES ( | ||
| null, | ||
| 'admin@example.com', | ||
| '$2b$10$W2NoJWWldrv4ksIalH7po.4vsczt3TlP8SepiEVNEanXzYTIxnIVu', | ||
| 'email' | ||
| ); | ||
|
|
||
| INSERT INTO userinfo | ||
| VALUES ( | ||
| null, | ||
| (SELECT id | ||
| FROM registeruser | ||
| WHERE | ||
| user_name = 'admin@example.com') | ||
|
|
||
| , | ||
| 'admin@example.com', | ||
| 'Tiny-Vue-Pro', | ||
| 'social recruitment', | ||
| 'admin', | ||
| '2023-06-01', | ||
| '2023-09-30', | ||
| '90', | ||
| '2023-06-01', | ||
| '2026-06-01', | ||
| 'beijing', | ||
| '1', | ||
| 'Front end' | ||
| ) |
19 changes: 19 additions & 0 deletions
19
packages/toolkits/pro/template/server/eggJs/app/database/table/employee.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| DROP TABLE IF EXISTS `employee`; | ||
|
|
||
| CREATE TABLE | ||
| `employee` ( | ||
| `id` bigint(16) NOT NULL, | ||
| `name` varchar(20) DEFAULT NULL COMMENT '姓名', | ||
| `employee_no` varchar(50) DEFAULT NULL COMMENT '工号', | ||
| `department` varchar(50) DEFAULT NULL COMMENT '部门', | ||
| `department_level` varchar(50) DEFAULT NULL COMMENT '部门层级', | ||
| `status` varchar(10) DEFAULT NULL COMMENT '状态', | ||
| `workbench_name` varchar(50) DEFAULT NULL COMMENT '工作台名称', | ||
| `project` varchar(50) DEFAULT NULL COMMENT '赋能项目', | ||
| `type` varchar(50) DEFAULT NULL COMMENT '人员类型', | ||
| `address` varchar(50) DEFAULT NULL COMMENT '研究所', | ||
| `roles` varchar(50) DEFAULT NULL COMMENT '角色', | ||
| `last_update_user` varchar(50) DEFAULT NULL COMMENT '最后更新人', | ||
| `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', | ||
| PRIMARY KEY (`id`) USING BTREE | ||
| ) ENGINE = InnoDB DEFAULT CHARSET = utf8 ROW_FORMAT = DYNAMIC; |
9 changes: 9 additions & 0 deletions
9
packages/toolkits/pro/template/server/eggJs/app/database/table/registeruser.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| DROP TABLE IF EXISTS `registeruser`; | ||
| CREATE TABLE | ||
| `registeruser` ( | ||
| `id` bigint(50) unsigned NOT NULL AUTO_INCREMENT, | ||
| `user_name` varchar(20) NOT NULL COMMENT '用户名', | ||
| `password` varchar(60) NOT NULL COMMENT '密码', | ||
| `register_type` varchar(10) DEFAULT NULL COMMENT '注册类型', | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8; |
20 changes: 20 additions & 0 deletions
20
packages/toolkits/pro/template/server/eggJs/app/database/table/userinfo.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| DROP TABLE IF EXISTS `userinfo`; | ||
|
|
||
| CREATE TABLE | ||
| `userinfo` ( | ||
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
| `user_id` bigint(20) unsigned DEFAULT NULL, | ||
| `user_name` varchar(32) NOT NULL COMMENT '用户名', | ||
| `department` varchar(32) NOT NULL DEFAULT '' COMMENT '部门', | ||
| `employee_type` varchar(32) DEFAULT NULL COMMENT '招聘类型', | ||
| `role` varchar(32) DEFAULT NULL COMMENT '角色', | ||
| `probation_start` date DEFAULT NULL COMMENT '试用期开始时间', | ||
| `probation_end` date DEFAULT NULL COMMENT '试用期结束时间', | ||
| `probation_duration` bigint(11) unsigned DEFAULT NULL COMMENT '试用期时长', | ||
| `protocol_start` date DEFAULT NULL COMMENT '合同开始日期', | ||
| `protocol_end` date DEFAULT NULL COMMENT '合同结束日期', | ||
| `address` varchar(32) DEFAULT NULL COMMENT '地址', | ||
| `status` varchar(32) DEFAULT NULL COMMENT '状态', | ||
| `job` varchar(32) DEFAULT NULL COMMENT '职位', | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.