• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem on migration use

#1
Hello Codeigniter Users,

I've problem when I try to migrate some files in sequential mode.
After respect recommendations on Migrations in CI4 Userguide, I run spark command migrate, and I've got this error msg :

Code:
Type:        mysqli_sql_exception
Message:     Unknown column 'group' in 'where clause'
Filename:    /Applications/MAMP/htdocs/bl6/vendor/codeigniter4/framework/system/Database/MySQLi/Connection.php
Line Number: 329

I have this exception even specify the group into my migration files...

PHP Code:
<?php namespace App\Database\Migrations;

use 
CodeIgniter\Database\Migration;

class 
Migration_User extends Migration
{
 
   protected $DBGroup 'default';

 
   public function up()
 
   {
......... 

And I still have access to the database on my web application, but same mysql connection problem on group in "where clause".

If anyone could help me.

Thanks in advance
Reply

#2
The issue isn't with your database group but rather with a table in your database that is expected to have a `group` column which is missing. I'd bet 99% that this is the `migrations` table which is created automatically upon using migrations and should look like this:

+-----------+--------------+------+-----+---------+-------+
| Field     | Type         | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| version   | varchar(255) | NO   |     | NULL    |       |
| name      | varchar(255) | NO   |     | NULL    |       |
| group     | varchar(255) | NO   |     | NULL    |       |
| namespace | varchar(255) | NO   |     | NULL    |       |
| time      | int(11)      | NO   |     | NULL    |       |
+-----------+--------------+------+-----+---------+-------+


If you have access to the database check the integrity of you migrations table and either repair it by adding `groups` or (if you haven't run any migrations yet) drop it and the framework will recreate it.
Reply

#3
(05-20-2019, 07:35 AM)MGatner Wrote: The issue isn't with your database group but rather with a table in your database that is expected to have a `group` column which is missing. I'd bet 99% that this is the `migrations` table which is created automatically upon using migrations and should look like this:

+-----------+--------------+------+-----+---------+-------+
| Field     | Type         | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| version   | varchar(255) | NO   |     | NULL    |       |
| name      | varchar(255) | NO   |     | NULL    |       |
| group     | varchar(255) | NO   |     | NULL    |       |
| namespace | varchar(255) | NO   |     | NULL    |       |
| time      | int(11)      | NO   |     | NULL    |       |
+-----------+--------------+------+-----+---------+-------+


If you have access to the database check the integrity of you migrations table and either repair it by adding `groups` or (if you haven't run any migrations yet) drop it and the framework will recreate it.


Hello MGatner,

Indeed, it was my migration table in error. I've just dropped it, and re-run migrate command, it works fine now !!!

Thanks for your reply.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.