Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration error: decimal column type #56

Closed
stepozer opened this issue Mar 28, 2013 · 6 comments
Closed

Migration error: decimal column type #56

stepozer opened this issue Mar 28, 2013 · 6 comments

Comments

@stepozer
Copy link

My English is not very good, so I apologize.

Table structure is:

CREATE TABLE `payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `comment` varchar(255) DEFAULT NULL,
  `type` int(11) NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Generated migration for this table structure:

$this->morphTable('payments', array(
    'columns' => array(
        // ... 
        new Column('amount', array(
            'type' => Column::TYPE_DECIMAL,
            'notNull' => true,
            'size' => 10,
            'after' => 'user_id'
        )),
        // ...
    ),
    // ...
));

How i understand, Migration generator must generate Scale field. Because when i run migration result is:

...
  `amount` decimal(10,0) NOT NULL
...

Please help:)

@dreamsxin
Copy link
Contributor

Fix it, view dreamsxin@a3456d8

@alexmarchenko
Copy link

Same error with FLOAT columns.
Also getting following error with DOUBLE columns:
Error: Column type does not support scale parameter

@dreamsxin
Copy link
Contributor

Same this phalcon/cphalcon#1128
Add double type for column

@expertakademi
Copy link

Hello any solution for this issue ?

@dreamsxin
Copy link
Contributor

@alexmarchenko You can submit it under your error message?

@sergeyklay
Copy link
Contributor

@dreamsxin Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants