Sql Table error

Error: SQLSTATE[HY000]: General error: 1364 Field ‘sale_phase_id’ doesn’t have a default value

Why Im I getting this

LeadsTable.php

public function initialize(array $config)
{
    parent::initialize($config);

    $this->setTable('leads');
    $this->setDisplayField('id');
    $this->setPrimaryKey('id');

    $this->addBehavior('Timestamp');

    $this->belongsTo('SalePhases', [
        'foreignKey' => 'sale_phase_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('Campaigns', [
        'foreignKey' => 'campaign_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('Users', [
        'foreignKey' => 'user_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('Accounts', [
        'foreignKey' => 'account_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('Contacts', [
        'foreignKey' => 'contact_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('PaidTo', [
        'foreignKey' => 'paid_to_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('Secteurs', [
        'foreignKey' => 'secteur_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsToMany('Leads', [
        'foreignKey' => 'lead_type_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('SourceProspects', [
        'foreignKey' => 'source_prospect_id',
        'joinType' => 'INNER'
    ]);
    $this->hasMany('Accounts', [
        'foreignKey' => 'lead_id'
    ]);
    $this->hasMany('Contacts', [
        'foreignKey' => 'lead_id'
    ]);
    } 

    public function validationDefault(Validator $validator)
    {
    $validator
        ->integer('id')
        ->allowEmpty('id', 'create');

    $validator
        ->scalar('name_lead')
        ->maxLength('name_lead', 255)
        ->requirePresence('name_lead', 'create')
        ->notEmpty('name_lead');

    $validator
        ->integer('forcecast_amount')
        ->requirePresence('forcecast_amount', 'create')
        ->notEmpty('forcecast_amount');

    $validator
        ->date('term')
        ->requirePresence('term', 'create')
        ->notEmpty('term');

    $validator
        ->scalar('next')
        ->maxLength('next', 255)
        ->requirePresence('next', 'create')
        ->notEmpty('next');

    $validator
        ->numeric('probability')
        ->requirePresence('probability', 'create')
        ->notEmpty('probability');

    $validator
        ->scalar('description')
        ->maxLength('description', 255)
        ->requirePresence('description', 'create')
        ->notEmpty('description');

    return $validator;
   } 

    public function buildRules(RulesChecker $rules)
   {
    $rules->add($rules->existsIn(['sale_phase_id'], 'SalePhases'));
    $rules->add($rules->existsIn(['campaign_id'], 'Campaigns'));
    $rules->add($rules->existsIn(['user_id'], 'Users'));
    $rules->add($rules->existsIn(['account_id'], 'Accounts'));
    $rules->add($rules->existsIn(['contact_id'], 'Contacts'));
    $rules->add($rules->existsIn(['paid_to_id'], 'PaidTo'));
    $rules->add($rules->existsIn(['secteur_id'], 'Secteurs'));
    $rules->add($rules->existsIn(['lead_type_id'], 'Leads'));
    $rules->add($rules->existsIn(['source_prospect_id'], 'SourceProspects'));

    return $rules;
   }
   }

SalePhasesTable.php

public function initialize(array $config)
{
    parent::initialize($config);

    $this->setTable('sale_phases');
    $this->setDisplayField('id');
    $this->setPrimaryKey('id');

    $this->belongsTo('Users', [
        'foreignKey' => 'user_id'
    ]);
    $this->hasMany('Leads', [
        'foreignKey' => 'sale_phase_id'
    ]);
   }

   public function validationDefault(Validator $validator)
    {
    $validator
        ->integer('id')
        ->allowEmpty('id', 'create');

    $validator
        ->scalar('name_phase')
        ->maxLength('name_phase', 25)
        ->allowEmpty('name_phase');

    return $validator;
}

public function buildRules(RulesChecker $rules)
{
    $rules->add($rules->existsIn(['user_id'], 'Users'));

    return $rules;
}
}

does the sale_phase_id have a default value? (eg. an Auto Increment?)

Yes it does all my table have auto for id

Edit : apparently It doesnt work if the Table SalePhase is empty so I had to add new user in it in order to retrive it from Lead Table
displayfield

Use the following query in your database.

SET GLOBAL sql_mode=’’;

This seems like a poor solution, to a question that appears to have been resolved nearly 2 years ago.