Laravel&创新数据库 [英] Laravel & InnoDB

查看:68
本文介绍了Laravel&创新数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用laravel和laravel迁移机制.我创建了表并设置了外键.但是表是MyISSAM,因此不会创建任何外键.我在哪里启用/配置此功能? (将其更改为InnoDB,而不是在mysql服务器中).

I am using laravel and laravel migration mechanism. I created tables and seted up foreign keys. But the tables are MyISSAM so no foreign keys are created. Where do I enable / configure this? (to change it to InnoDB and not in the mysql server).

推荐答案

您可以编辑/config/database.php文件,搜索 mysql 条目并更改:

You can edit your /config/database.php file, search for mysql entry and change:

'engine' => null,

'engine' => 'InnoDB',

这可避免您为每个模式添加$table->engine = "InnoDB";;)

This saves you from adding $table->engine = "InnoDB"; for each of your Schemas ;)

这篇关于Laravel&创新数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆