laravel 创建表 字段列举
来源:互联网 发布:淘宝怎么搜爱情动作片 编辑:程序博客网 时间:2024/06/14 03:43
$table->bigIncrements('id'); ID 自动增量,使用相当于「big integer」类型$table->bigInteger('votes'); 相当于 BIGINT 类型$table->binary('data'); 相当于 BLOB 类型$table->boolean('confirmed'); 相当于 BOOLEAN 类型$table->char('name', 4); 相当于 CHAR 类型,并带有长度$table->date('created_at'); 相当于 DATE 类型$table->dateTime('created_at'); 相当于 DATETIME 类型$table->decimal('amount', 5, 2); 相当于 DECIMAL 类型,并带有精度与基数$table->double('column', 15, 8); 相当于 DOUBLE 类型,总共有 15 位数,在小数点后面有 8 位数$table->enum('choices', array('foo', 'bar')); 相当于 ENUM 类型$table->float('amount'); 相当于 FLOAT 类型$table->increments('id'); 相当于 Incrementing 类型 (数据表主键)$table->integer('votes'); 相当于 INTEGER 类型$table->json('options'); 相当于 JSON 类型$table->longText('description'); 相当于 LONGTEXT 类型$table->mediumInteger('numbers'); 相当于 MEDIUMINT 类型$table->mediumText('description'); 相当于 MEDIUMTEXT 类型$table->morphs('taggable'); 加入整数 taggable_id 与字串 taggable_type$table->nullableTimestamps(); 与 timestamps() 相同,但允许 NULL$table->smallInteger('votes'); 相当于 SMALLINT 类型$table->tinyInteger('numbers'); 相当于 TINYINT 类型$table->softDeletes(); 加入 deleted_at 字段于软删除使用$table->string('email'); 相当于 VARCHAR 类型$table->string('name', 100); 相当于 VARCHAR 类型,并指定长度$table->text('description'); 相当于 TEXT 类型$table->time('sunrise'); 相当于 TIME 类型$table->timestamp('added_on'); 相当于 TIMESTAMP 类型$table->timestamps(); 加入 created_at 和 updated_at 字段$table->rememberToken(); 加入 remember_token 使用 VARCHAR(100) NULL->nullable() 标示此字段允许 NULL->default($value) 声明此字段的默认值->unsigned() 配置整数是无分正负
0 0
- laravel 创建表 字段列举
- ArcPy列举字段
- Laravel创建数据库表结构
- Laravel 创建指定表 migrate
- 使用laravel 的artisan快速创建表
- laravel sum 多个字段
- Laravel 提示字段不存在groupBy
- 创建表 并添加字段!
- Laravel中创建Model
- 用Laravel创建项目
- PHP Laravel命令行创建
- laravel手动创建分页
- laravel mvc组件创建
- laravel框架 创建控制器
- 列举出记录集中的字段的函数
- laravel使用migration表的创建和迁移
- sql 创建表、删除表 增加字段 删除字段操作
- sql 创建表、删除表 增加字段 删除字段操作
- ORACLE数据库汉字占几个字节问题
- C++ 模版注意事项
- SVN客户端无法连接服务器的问题
- Spring注解式事务管理
- Chebyshev-Inequality-with-Linear-Bound
- laravel 创建表 字段列举
- android fragment
- IOS中根据url在app之间跳转
- Linux 相关命令
- win32 握手对话框
- Centos6.3下zabbix监控mysql数据库参数
- 第11章 程序料理----miniMusic(2)
- Android学习之路
- 使用JDBC连接MySQL数据库--典型案例分析(四)----更新和插入员工数据