`

执行数据脚本相关命令

阅读更多
在命令行输入:rake -T db

rake db:abort_if_pending_migrations  # Raises an error if there are pending migrations
rake db:charset                      # Retrieves the charset for the current environment's database
rake db:collation                    # Retrieves the collation for the current environment's database
rake db:create                       # Create the database defined in config/database.yml for the current RAILS_ENV
rake db:create:all                   # Create all the local databases defined in config/database.yml
rake db:drop                         # Drops the database for the current RAILS_ENV
rake db:drop:all                     # Drops all the local databases defined in config/database.yml
rake db:factory_girl:load            # Load factory_girl into the current environment's database.
rake db:fixtures:identify            # Search for a fixture given a LABEL or ID.
rake db:fixtures:load                # Load fixtures into the current environment's database.
rake db:migrate                      # Migrate the database through scripts in db/migrate and update db/schema.rb by inv...
rake db:migrate:down                 # Runs the "down" for a given migration VERSION.
rake db:migrate:redo                 # Rollbacks the database one migration and re migrate up.
rake db:migrate:reset                # Resets your database using your migrations for the current environment
rake db:migrate:up                   # Runs the "up" for a given migration VERSION.
rake db:populate                     # Erase and fill database
rake db:reset                        # Drops and recreates the database from db/schema.rb for the current environment.
rake db:rollback                     # Rolls the schema back to the previous version.
rake db:schema:dump                  # Create a db/schema.rb file that can be portably used against any DB supported by AR
rake db:schema:load                  # Load a schema.rb file into the database
rake db:sessions:clear               # Clear the sessions table
rake db:sessions:create              # Creates a sessions migration for use with ActiveRecord::SessionStore
rake db:structure:dump               # Dump the database structure to a SQL file
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:load                    # Recreate the test database from the current schema.rb
rake db:test:prepare                 # Check for pending migrations and load the test schema
rake db:test:purge                   # Empty the test database
rake db:version                      # Retrieves the current schema version number
rake spec:db:fixtures:load           # Load fixtures (from spec/fixtures) into the current environment's database.

分享到:
评论

相关推荐

    通过SSHPASS执行命令及相关脚本

    标题中的“通过SSHPASS执行命令及相关脚本”是指在Linux环境下使用`sshpass`工具进行非交互式SSH登录并执行远程命令的技术。`sshpass`是一个命令行实用程序,它允许用户在不手动输入密码的情况下,通过SSH连接执行...

    xshell ssh自动登录并执行命令脚本.rar

    本压缩包“xshell ssh自动登录并执行命令脚本.rar”提供了一种自动化的方式,通过Xshell自动连接到SSH服务器并执行预设的命令脚本,极大地节省了手动操作的时间。 首先,我们需要了解SSH(Secure Shell),这是一种...

    tp5执行shell命令定时执行命令行运行php脚本

    ThinkPHP5(简称TP5)是一个流行的PHP框架,它提供了一种方式来实现这种定时任务,即通过执行shell命令在命令行模式下运行PHP脚本。这个过程涉及到多个知识点,包括TP5的命令行工具、shell命令以及定时任务的设置。 ...

    0-SecureCRT运行Python脚本.pdf

    本文主要介绍了SecureCRT这款软件如何运行Python脚本来测试IoT-WiFi模块,涉及的主题包括SecureCRT的基本使用、Python脚本的执行、以及SecureCRT中实现的Python脚本的常用方法。 首先,文章的前言部分提到,对于...

    Windows计划任务配置定期执行SQL脚本对数据库数据自动导出删除及压缩

    在IT领域,尤其是在数据库管理和自动化运维中,"Windows计划任务配置定期执行SQL脚本对数据库数据自动导出删除及压缩"是一项重要的技能。这涉及到Windows操作系统中的任务调度器(Task Scheduler)以及SQL语言的运用...

    linux下shell脚本实现数据的导出

    在Linux环境中,运行此脚本需要确保`oracle`用户有执行`exp`命令的权限,以及拥有写入指定文件路径的权限。 接下来,我们看看Java代码部分,这部分代码是用于执行shell脚本的: ```java String shfilepath = ...

    下面的注释包含自解压脚本命令

    自解压脚本通常包含两部分:压缩的数据和执行解压缩的代码。执行代码会解析压缩数据并调用相应的解压缩工具(如7-Zip、WinRAR或gzip)来解压这些数据。当用户运行这个脚本时,它首先执行解压逻辑,然后将解压出的...

    MySchool的数据脚本

    在MySchool项目中,这个数据脚本包含了创建、修改和删除数据库对象(如表、视图、索引等)的命令,以及填充初始数据的语句。这样的脚本使得数据库的构建和维护变得更加高效和标准化。 接着,我们来看"描述"部分:...

    批量执行SQL脚本

    例如,在提供的文件名“批量报表导入”中,我们可以推测这是一个与报表数据导入相关的脚本,可能包括创建表、插入数据、更新数据或生成报表等操作。 2. **工具选择**:有许多工具可以用来批量执行SQL脚本,如MySQL...

    C# 执行SQL脚本

    在处理SQL SERVER数据库时,有时我们需要在C#程序中执行SQL脚本来完成数据的增删改查、数据库结构的修改等任务。本篇将详细介绍如何在C#中执行SQL脚本,以及相关的知识点。 1. **ADO.NET基础**: ADO.NET是.NET ...

    Mysql执行脚本步骤

    SQL 脚本文件是一个包含一到多个 SQL 命令的 SQL 语句,我们可以将这些 SQL 脚本放在一个文本文件中,然后通过相关的命令执行这个 SQL 脚本文件。SQL 脚本文件的基本结构如下: -- 创建表,使用“--”进行注释 ...

    winhex脚本命令教程--中文版.doc

    通过使用脚本命令,用户可以自动化一系列数据操作任务,如文件创建、读写、备份等。 - **脚本命令环境**:脚本命令适用于多种环境,如文件处理、磁盘操作等。 - **注释**:脚本文件中的注释以双斜杠(//)开头。 - ...

    大数据采集与处理技术相关shell脚本

    根据提供的文件信息,我们可以归纳出三个主要的大数据采集与处理技术相关的Shell脚本知识点:自动创建文件、自动采集以及分区。 ### 自动创建文件 此脚本的主要功能是基于两个给定日期(`beg_date` 和 `end_date`...

    linux下批量执行oracle脚本的shell脚本

    本篇将详细讲解如何利用shell脚本来批量执行Oracle数据库脚本,以及涉及的相关知识点。 首先,我们来看标题中的"linux下批量执行oracle脚本的shell脚本",这指的是在Linux操作系统中,通过编写shell脚本来自动化...

    批量执行SQL脚本(附源码).zip

    用户可以通过执行进度了解脚本的执行情况,判断是否出现异常或者运行时间过长,从而及时进行调整或干预。 双击显示SQL脚本内容的功能使得用户可以直接在程序内查看和预览SQL命令,无需依赖其他文本编辑器。这对于...

    自动下载并保存GFS数据的Shell脚本

    “Linux Shell”是这个脚本的运行环境,它是一种命令行解释器,允许用户通过命令行界面执行各种系统操作。在Linux系统中,Shell脚本可以实现自动化任务,如数据处理、文件管理、系统监控等,是系统管理员和数据科学...

    Oralce备份脚本exp命令

    本文将深入探讨如何使用Oracle的`exp`命令来创建数据库备份脚本,并结合计划任务实现自动备份。 `exp`是Oracle Data Pump Export工具的旧版命令,用于将数据库对象(如表、索引、存储过程等)的数据和元数据导出到...

    ftp自动运行脚本

    总结来说,"ftp自动运行脚本"涉及了FTP协议的基础知识、脚本自动化技术、批处理文件和FTP命令文件的编写,以及安全性和效率的考量。通过理解这些概念和工具,我们可以创建出能够自动完成FTP任务的高效解决方案。

Global site tag (gtag.js) - Google Analytics