zoukankan      html  css  js  c++  java
  • 建立测试数据

    为了进行测试,我们希望确保测试数据库具有与开发数据库相同的表结构。我们不必管理那些装载数据库模式的 DDL 脚本,而是使用 Rake 命令帮助创建测试环境。运行 rake --tasks 命令,就会显示几个用来构建或清空测试数据库的命令:

    清单 3. Rake --tasks 输出
    rake db:test:clone             # Recreate the test database from the current 
                                   # environment's  database schema
    rake db:test:clone_structure   # Recreate the test databases from the development 
                                   # structure
    rake db:test:prepare           # Prepare the test database and load the schema                                 rake test:prepare (rails4)
    rake db:test:purge             # Empty the test database
    用 rake db:test:prepare 命令在数据库中建立表。这个命令会将开发数据库中的数据库模式复制到测试数据库中。
  • 相关阅读:
    centos 部署.NET CORE
    nginx 负载均衡
    graylog centos7 部署
    springboot 2.x centos 7.0 部署
    HashMap源代码阅读理解
    服务器安装redis
    java ---- gradle
    uboot-makefile总览
    makeFile
    Spring 推断构造方法
  • 原文地址:https://www.cnblogs.com/qinyan20/p/3643229.html
Copyright © 2011-2022 走看看