# db/migrate/6_add_foreign_key.rb
class AddForeignKey < ActiveRecord::Migration
def self.up
execute "ALTER TABLE bees ADD CONSTRAINT beehive_id_fkey FOREIGN KEY
(beehive_id) REFERENCES beehives (id);"
end
def self.down
execute "ALTER TABLE bees DROP CONSTRAINT beehive_id_fkey;"
end
end
class AddForeignKey < ActiveRecord::Migration
def self.up
execute "ALTER TABLE user_notes ADD CONSTRAINT creator_id_fkey FOREIGN KEY (creator_id) REFERENCES users (id);"
end
def self.down
execute "ALTER TABLE user_notes DROP CONSTRAINT creator_id_fkey;"
end
end
分享到:
相关推荐
ESF Database Migration Toolkit Pro 8.2.07 + Key.tgz 数据库迁移神器
新测能用。我在网上搜索了各个版本的EFS不少20个,都不能用,很多都带毒。功夫不负有心人,终于找到了个能用的。真正的可用版本是打个后是要弹个框要求输入NAME,Campany,Email,CODE。如果不弹注册框,干脆别用,伤...
key/foreign key, indexes, auto-increment(serial) and default value will be migrated. When you want to migrate data between two different character-sets(e.g.: UTF8, CP1250 etc) tables, it also ...
MySQL Migration Toolkit 可以将任何数据源转换成mysql的数据,也可以将mysql的数据转换成其它类型的数据 MySQL Migration Toolkit 包括下列转换工具: Access-to-MySQL Access数据库转MySQL数据库 DBF-to-MySQL DBF...
MySQL Migration Toolkit 2.3版 数据库转化工具下载
使用 IBM DB2 Migration Toolkit 迁移数据,此文档详细介绍了,使用IBM MTK工具进行数据库移植的过程,很值得一看!
tomcat升级为10.x版本以后,由于JavaEE更名为Jakarta,原有的javax.*命名空间迁移为jakarta.x,原有项目如需迁移到...jar jakartaee-migration-0.2.0.jar <source> 命令,将新生成的war包放到webapps下即可正常使用
ESF Database Migration Toolkit 是一个允许您在不同数据库格式之间进行数据转换的程序。 它可以直接连接到MySQL,SQL Server, PostgreSQL,Oracle,Access,Excel,Paradox,Lotus,dBase,Visual FoxPro,Text等...
数据库转换神器 ESF Database Migration Toolkit - Professional
ESF.Database.Migration.Toolkit.v7.3.27 破解版 数据库迁移好工具,支持多种数据库,oracle postgresql mysql等 win7 64 位 亲测可用
OpenNI_Migration_Guide
WINDOWS SERVER 2008 Live_Migration虚拟化实战
提供informix到oracle数据migration的方案
MySQL Migration Toolkit的使用
Practical Hadoop Migration: How to Integrate Your RDBMS with the Hadoop Ecosystem and Re-Architect Relational Applications to NoSQL by Bhushan Lakhe English | 28 Aug. 2016 | ISBN: 1484212886 | 332 ...
在使用Wp之初,没有意识到固定链接的问题,到现在一直在使用“http://blog.designlinks.cn/?p=13”这样的网址,看上去虽然很短,...在这里与大家分享这个很好的插件:wp-permalinks-migration.1.0(固定链接更改插件)
MySQL Migration Toolkit 数据迁移
Lakhe proceeds to cover the selection criteria for ETL tools, the implementation steps for migration with SQOOP- and Flume-based data transfers, and transition optimization techniques for tuning ...
免费的数据源迁徙工具,支持sql,mysql,oracle,db2等数据库之间的相互转换
USMT(User State Migration Tool,用户状态移转工具)是微软Windows 的一种安装工具,用处是协助用户在升级时,把原来电脑的设定转移到新的电脑上。适用于: Windows(R) 7 Windows Server(R) 2008 R2 Windows ...