Commit 70f5f157 authored by Bastien Le Querrec's avatar Bastien Le Querrec

add migration to add default values

b92f0d08 added default values to pass
strict SQL mode, but migrations were missing.

Had to use raw SQL queries because phinx does not support our structure.
parent b5b18e91
<?php
use Phinx\Migration\AbstractMigration;
class AddDefaultValues extends AbstractMigration
{
public function up()
{
$this->adapter->execute("ALTER TABLE contreparties ALTER datec SET DEFAULT '0000-00-00 00:00:00';");
$this->adapter->execute("ALTER TABLE contreparties ALTER commentaire SET DEFAULT '';");
$this->adapter->execute("ALTER TABLE dons ALTER datec SET DEFAULT '0000-00-00 00:00:00';");
$this->adapter->execute("ALTER TABLE dons ALTER cadeau SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE dons ALTER abo SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE dons ALTER taille SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE dons ALTER public SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE dons ALTER pdf SET DEFAULT \"\";");
$this->adapter->execute("ALTER TABLE dons ALTER decimale SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE dons ALTER datee SET DEFAULT '0000-00-00 00:00:00';");
$this->adapter->execute("ALTER TABLE dons ALTER pi_x SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE dons ALTER pi_y SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE dons ALTER hash SET DEFAULT \"\";");
$this->adapter->execute("ALTER TABLE dons ALTER taille_h SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE users ALTER total SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE users ALTER cumul SET DEFAULT '0';");
$this->adapter->execute("ALTER TABLE users ALTER pseudo SET DEFAULT \"\";");
$this->adapter->execute("ALTER TABLE users ALTER commentaire SET DEFAULT \"\";");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment