更多>
最新下载
24小时阅读排行榜
- 1 如何用序列 SEQUENCE 实现跨表全局唯一 ID 的生成方案
- 2 Linux NTP 同步失败的常见原因
- 3 Laravel中如何使用模型观察者Observer_Laravel模型事件监听方法【实战】
- 4 如何在 Tone.js 中准确监控序列进度与状态
- 5 tcp_tw_recycle 环境下的 NAT 兼容性与 tcp_timestamps 关闭风险
- 6 如何用正则表达式匹配包含“olo”但不以或不以“olo”开头/结尾的单词
- 7 Go 语言中 Goroutine 通过无缓冲通道实现精确交替执行的原理详解
- 8 Python 多线程中的共享数据问题
- 9 PostgreSQL regexp_split_to_table 的性能与替代方案
- 10 如何为 WooCommerce 可变订阅产品中的特定变体启用手动续订
- 11 为下拉菜单添加圆角时避免内容被裁剪的完整解决方案
- 12 fastapi 如何实现 StreamingResponse 的 chunked transfer
- 13 Linux 用户态与内核态切换的真实成本
- 14 Python 类型注解对运行时的影响
- 15 list.remove(x) 找不到元素抛 ValueError 的优雅处理方式
更多>
最新教程
-
- Node.js 教程
- 16361 2025-08-28
-
- CSS3 教程
- 1547099 2025-08-27
-
- Rust 教程
- 23473 2025-08-27
-
- Vue 教程
- 25900 2025-08-22
-
- PostgreSQL 教程
- 22398 2025-08-21
-
- Git 教程
- 9340 2025-08-21
下载首页 / 类库下载 / 其它类库
php artisan migrate #输出Migration table created successfully. Migrated: 2014_10_12_000000_create_users_table Migrated: 2014_10_12_100000_create_password_resets_table
php artisan migrate:rollback #输出Rolled back: 2014_10_12_100000_create_password_resets_table Rolled back: 2014_10_12_000000_create_users_table
php artisan make:migration create_article_table --create='articles' #输出Created Migration: 2015_03_28_050138_create_article_table
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateArticleTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('articles', function(Blueprint $table)
{
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('articles');
}
}database migrations 是laravel最强大的功能之一。数据库迁移可以理解为数据库的版本控制器。
在 database/migrations 目录中包含两个迁移文件,一个建立用户表,一个用于用户密码重置。
在迁移文件中,up 方法用于创建数据表,down方法用于回滚,也就是删除数据表。
本站所有资源都是由网友投搞发布,或转载各大下载站,请自行检测软件的完整性!本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!如有侵权请联系我们删除下架,联系方式:admin@php.cn
