You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
## 数据库
|
|
|
|
|
1.创建一个新的数据库,如edu_local,必须是UTF-8,
|
|
|
|
|
命令:CREATE DATABASE `edu_local` CHARACTER SET utf8 COLLATE utf8_general_ci;
|
|
|
|
|
2.设置本地database.yml
|
|
|
|
|
3. 链接mysql,执行导入数据库:source /Users/jingquanhuang/eduplus2/db/structure.sql
|
|
|
|
|
3.1 mac pwd 获取本地目录
|
|
|
|
|
4. 导入基础数据: source /Users/jingquanhuang/eduplus2/db/init.sql
|
|
|
|
|
4. 初始化种子数据 bundle exec rake db:seed
|
|
|
|
|
5、启动服务用 bundle exec rails s
|
|
|
|
|
6、设置配置文件数据:/edu_settins: 配置: origin_database(原始数据库,及有数据的数据库)database(需要导入的数据库,及database.yml中的数据库)
|
|
|
|
|
7、调用接口:
|
|
|
|
|
url: /api/initialization_data.json?paths=123,124,125
|
|
|
|
|
参数paths: 需要导入的实训路径的id,以逗号分隔
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8、 超级管理员用户
|
|
|
|
|
educoder 123456789
|