加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – 续集生成迁移

发布时间:2020-12-17 03:23:44 所属栏目:百科 来源:网络整理
导读:我看到Sequel gem支持迁移 here,但我没有看到任何类型的生成器记录.是否存在;或者我应该手动创建所有迁移(或者交替创建我自己的任务来生成迁移)? 解决方法 从 documentation: Sequel doesn’t come with generators that create migrations for you. Howev
我看到Sequel gem支持迁移 here,但我没有看到任何类型的生成器记录.是否存在;或者我应该手动创建所有迁移(或者交替创建我自己的任务来生成迁移)?

解决方法

从 documentation:

Sequel doesn’t come with generators that create migrations for you. However,creating a migration is as simple as creating a file with the appropriate filename in your migrations directory that contains a Sequel.migration call.

迁移文件的内容不必指定时间戳或索引,它是一种非常简单的格式.

我通常只是复制一个先前的迁移(可能是一个类似于我正在创建的迁移)并更改文件名.查看现有迁移:

$ls -1 db/migrate/
20170320075430_check_postgres_extensions.rb
...

对于运行迁移,我使用可用的rake任务here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读