--新建表:

def up
create_table :[TABLE_NAME] do |t|
t.column :[NUM], :integer
t.column :[NAME], :string
t.column :[TIME], :timestamp
t.column :[ACTIVE], :boolean, :default => true
# 不推荐,用task rake
execute <<-SQL
[SQL-1];
[SQL-2];
SQL t.timestamps
end add_index :location_properties, :[NUM]
add_index :location_properties, :[NAME] , :unique => true end def down
drop_table :[TABLE_NAME]
end

--

Rails--bundle exec rake db:migrate的更多相关文章

  1. rake db:migrate 与 bundle exec rake db:migrate 的区别(copy)

    [说明:资料来自http://blog.csdn.net/lihuan974683978/article/details/8715414] 之前一直没弄明白rake  db:migrate 与 bun ...

  2. redmine3.3.3 rake db:migrate 报错invalid byte sequence in US-ASCII (Argument Error) 解决方法

    这个错误有点莫名其妙,系统默认的就是utf-8,可bundle就是不对.. rake db:migrate 结果没有任何错误,反而是网页passenger 提示了这个错误 参考:https://git ...

  3. rails学习笔记: rake db 相关命令

    rails学习笔记: rake db 命令行 rake db:*****script/generate model task name:string priority:integer script/g ...

  4. rails数据库操作rake db一点心得

    问题描述,对于很多的新手rails lover来说,搞定db是件头疼的事情,当建立了一个model,测试了半天发现我草列名写错了,再过一会儿发现association里面竟然没有xxx_id,这下子s ...

  5. rails使用 rake db:migrate 提示 Migrations are pending; run 'rake db:migrate RAILS_ENV=development' to resolve this issue.

    首先得特么建立数据库 : rake db:create 实际问题是没有int应该用integer http://www.rubycc.com/column/rails3.2.3/rails.htm

  6. Rails里rake db:migrate出现undefined method last_comment问题的解决

    这个问题和特定的rake版本有关,因为Rails要使用rake的last_comment方法在较新版本的rake中已被废弃,所以很多人卸载了新版本的rake去安装旧版本的rake. 这样也能解决问题, ...

  7. rake aborted! You have already activated rake 10.1.0, but your Gemfile requires rake 10.0.3. Using bundle exec may solve this.

    问题: wyy@wyy:~/moumentei-master$ rake db:createrake aborted!You have already activated rake 10.1.0, b ...

  8. Rails 4.0 bundle exec rspec spec/requests/xxx 测试失败的解决

    rails项目没有使用默认的单元测试包,而是使用了rspec-rails来测试. 按照文档说明首先生成对应的测试文件: rails generate integration_test xxx invo ...

  9. java.util.MissingResourceException: Can't find resource for bundle oracle.sysman.db.rsc.LoginResourc

    http://blog.itpub.net/197458/viewspace-1055358/   oracle 10.2.0.4 windows 2003 X64 平台 系统安装EMCA正常.第一次 ...

随机推荐

  1. 菜鸟学Linux命令:chmod命令和数字文件权限

    chmod是一条在Unix系统中用于控制用户对文件的权限的命令(change mode单词前缀的组合)和函数.只有文件所有者和超级用户可以修改文件或目录的权限.可以使用绝对模式,符号模式指定文件的权限 ...

  2. HTTP协议中状态码的应用

    HTTP状态码(HTTP Status Code)是用以表示网页服务器HTTP响应状态的3位数字代码. 所有状态码的第一个数字代表了响应的五种状态之一.   Mark from 维基百科     消息 ...

  3. Linux查询网址

    1.man查询手册 LINUX MAN PAGES ONLINE: http://man.he.net/ 2.编码规范 https://www.kernel.org/doc/Documentation ...

  4. C# 如何判断系统是否是静音

    推荐的方法,使用CoreAudioApi.dll,仅在win7上测试过: private MMDevice defaultDevice = null; //判断当前系统扬声器状态 private bo ...

  5. poj 1273 最大流入门

    明天再拍一遍 #include <iostream> #include <queue> using namespace std; ; const int INF = 0x7FF ...

  6. GDUT 校赛01 dp

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABT8AAAILCAIAAAChHn9YAAAgAElEQVR4nOy9f4il13nneUGgxrRYux ...

  7. loadrunner关联边界乱码

    问题现象: 如上图中的我想关联 <ins class="curmarker" id="cur2494"></ins><ins cl ...

  8. ember.js:使用笔记5 使用view

    在已经设置route的情况下,以table为例,可以如下设置,范围为对应的模版: App.TableView = Em.View.extend({ }); App.TableIndexView = E ...

  9. Playmaker Input篇教程之Playmaker购买下载和导入

    Playmaker Input篇教程之Playmaker购买下载和导入 Playmaker Input篇认识Playmaker Playmaker是Unity的插件,其标志如图1-1所示.开发者使用它 ...

  10. DFS POJ 2362 Square

    题目传送门 /* DFS:问能否用小棍子组成一个正方形 剪枝有3:长的不灵活,先考虑:若根本构不成正方形,直接no:若第一根比边长长,no 这题是POJ_1011的精简版:) */ #include ...