I'm updating schema in a Symfony app. This app was not written by me, so I'm groping the dark as it were.
I have validated the schema with php bin/console doctrine:schema:validate, and get an OK, the mappings are correct. But the database schema is not in sync (I'm actually starting with an empty database...)
Then I run bin/console doctrine:schema:update --force, and get the following error:
SQLSTATE[22023]: Invalid parameter value: 7 ERROR: NUMERIC scale 10 must be between 0 and precision 2
LINE 1: ...ULL, application_id VARCHAR(255) NOT NULL, amount NUMERIC(2,...
Within the ServiceFee class:
/**
* @ORM\Column(type="decimal", precision=2, scale=10)
*/
private $amount;
And the relevant SQL command (retrieved with bin/console doctrine:schema:update --dump-sql):
CREATE TABLE service_fees (
id INT NOT NULL,
created TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL,
modified TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL,
uuid VARCHAR(255) NOT NULL,
organization_id VARCHAR(255) NOT NULL,
application_id VARCHAR(255) NOT NULL,
amount NUMERIC(2, 10) NOT NULL,
charged BOOLEAN NOT NULL,
payment_method_type VARCHAR(255) NOT NULL,
transaction_number VARCHAR(255) NOT NULL,
removed BOOLEAN NOT NULL,
PRIMARY KEY(id)
);
CREATE UNIQUE INDEX unique_uuid ON service_fees (uuid);
After executing the command above, I start getting a new error, but I'm not sure if this is a result of an incomplete schema update:
SQLSTATE[42703]: Undefined column: 7 ERROR: column "min_value" does not exist
LINE 1: SELECT min_value, increment_by FROM "translations_id_seq"