codeigniter3.16版本migration(数据工厂迁移类)的使用
来源:互联网 发布:云图制作软件 编辑:程序博客网 时间:2024/06/10 21:43
codeIgniter3.16版本migration(数据工厂迁移类)的使用介绍
一、application\config 下的迁移类配置文件migration设置
1.配置migration_enabled为true,即打开migration
$config['migration_enabled'] = TRUE;
2.配置migration的命名规则
时间戳格式:timestamp 即 20171205150455这种形式
序列格式:sequential 即0,1,2,3这种形式
$config['migration_type'] = 'timestamp';
3.配置迁移的版本
$config['migration_version'] = 20171205150455;
4.配置迁移的文件位置
$config['migration_path'] = APPPATH.'migrations/';
二、迁移文件编写
如图:部分内容参考
数据库工厂类
数据迁移类
重点:
$this->dbforge->add_key('id', TRUE); //设置主键
$this->dbforge->add_key('name');//设置普通索引
//指定表的属性,MySQL 的 ENGINE和表注释
$attributes = array('ENGINE' => 'InnoDB', 'comment' => '"后台模块表"');
$this->dbforge->create_table('modules', TRUE, $attributes);
- codeigniter3.16版本migration(数据工厂迁移类)的使用
- opencart2集成codeigniter3的数据访问类
- 使用 IBM DB2 Migration Toolkit 迁移数据
- 使用 IBM DB2 Migration Toolkit 迁移数据
- laravel 之数据迁移 migration
- ThinkPHP5 数据迁移 migration 填坑记
- redis-migration:独创的redis在线数据迁移工具
- laravel使用migration表的创建和迁移
- openstack 在线迁移(live-migration)的配置
- DJANGO中migration(迁移)的理解和运用
- RTC Repository数据迁移 (Data Migration)
- 使用Microsoft SQL Server Migration Assistant for Oracle工具迁移数据
- rails3 数据 migration 之一 - migration 的解析
- SQL Server Migration Assistant for MySQL(SSMA),数据迁移后的一些善后操作
- 数据库迁移/数据库版本管理(Database Migration/VCS for database)
- Core Data 学习:轻量级版本迁移(Lightweight Migration)
- process migration(进程迁移) 学习笔记
- 使用SQL database Migration wizard迁移数据库时的varchar中文乱码问题
- ResNet 6大变体对比
- A03_IO文件管理
- ionic3开发系列——打包APK运行,启动页后白屏几秒,解决方案
- E
- 算法爱好者——子集 ? 待解决
- codeigniter3.16版本migration(数据工厂迁移类)的使用
- 一道挤奶的奶牛题的题解
- Kotlin使用Retrofit进行get请求的方法(懒加载机制)
- shrio 权限管理filterChainDefinitions过滤器配置
- [Leetcode] 500. Keyboard Row 解题报告
- Hdfs 数据块丢失处理
- android系统常用URI
- mysql--表拆分
- 仿知乎广告效果