Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
通过Hacker 月刊2011 年 2 月阅读这篇文章。
有一部分是关于种子脚本的。
定义什么是种子脚本。
请给出一个使用 MySQL 作为数据库在 cakephp 上运行的 web 应用程序的种子脚本的简单示例。
尽量减少行话。欢迎使用隐喻和类比。
就我个人而言,我通常会保留一个单独的 sql 转储数据,每次更改架构时都会更改这些数据。这种方法对我有用。如果有更好的方法,我想知道。
种子脚本是生成虚拟数据的脚本,可能使用随机值或可接受值的查找表。该脚本将创建将数据插入数据库所需的 SQL 查询,并且还可以执行查询。