dbforge

Codeigniter showing error: No database selected

我只是一个虾纸丫 提交于 2020-01-22 00:20:57
问题 I am using Codeigniter's DBForge class to create a database and table within that database. Here is code: if ($this->dbforge->create_database('new_db')) { $fields = array( 'blog_id' => array( 'type' => 'INT', 'constraint' => 5, 'unsigned' => TRUE, 'auto_increment' => TRUE ), 'blog_title' => array( 'type' => 'VARCHAR', 'constraint' => '100', ), 'blog_author' => array( 'type' => 'VARCHAR', 'constraint' => '100', 'default' => 'King of Town', ), 'blog_description' => array( 'type' => 'TEXT',

Create Unique field in Codeigniter DBForge Migration

假如想象 提交于 2019-12-30 17:41:26
问题 How can I make the financial_year field as unique using Codeigniter Dbforge migration? function up() { $this->dbforge->add_field(array( 'id' => array( 'type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'auto_increment' => TRUE ), 'financial_year' => array( 'type' => 'VARCHAR', 'constraint' => 20 ), 'start_date' => array( 'type' => 'DATE' ), 'end_date' => array( 'type' => 'DATE' ), 'status' => array( 'type' => "ENUM", 'constraint' => "'Active','Inactive'", 'default' => "Active" ),

Foreign Key constraints using dbForge Query Builder

十年热恋 提交于 2019-12-11 18:35:11
问题 I am beginner for dbForge Query Builder,Can I set foreign key constrains using this query Builder easily, 回答1: As its description says - No. http://www.devart.com/dbforge/mysql/querybuilder/ It is a tool for building queries and data managing. For managing schemas you probably need to move to dbForge Studio for MySQL 来源: https://stackoverflow.com/questions/5496216/foreign-key-constraints-using-dbforge-query-builder

Create Unique field in Codeigniter DBForge Migration

六眼飞鱼酱① 提交于 2019-12-01 16:23:37
How can I make the financial_year field as unique using Codeigniter Dbforge migration? function up() { $this->dbforge->add_field(array( 'id' => array( 'type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'auto_increment' => TRUE ), 'financial_year' => array( 'type' => 'VARCHAR', 'constraint' => 20 ), 'start_date' => array( 'type' => 'DATE' ), 'end_date' => array( 'type' => 'DATE' ), 'status' => array( 'type' => "ENUM", 'constraint' => "'Active','Inactive'", 'default' => "Active" ), 'created_on' => array( 'type' => 'TIMESTAMP' ) )); $this->dbforge->add_key('id', TRUE); // add `id` as