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

Type time #12471

Closed
wants to merge 95 commits into from
Closed

Type time #12471

wants to merge 95 commits into from

Conversation

ruudboon
Copy link
Member

Rebased upon request #12293
@sergeyklay Looked at the other added Column types but didn't see any changed test. What test do you want me to change?

@sergeyklay
Copy link
Contributor

sergeyklay commented Dec 13, 2016

I would like a small test (see example here) using this namespace https://github.com/phalcon/cphalcon/tree/master/tests/unit/Db/Column

/**
* Special type for time
*/
let definition["type"] = Column::TYPE_TIME;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix indents

}elseif memstr(columnType, "time") {
/**
* Time
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed that. Will fix it. Still working on those unit test btw. Try to push them today.

if empty columnSql {
let columnSql .= "TIME";
}
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there still issue with indents

if empty columnSql {
let columnSql .= "TIMESTAMP";
}
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

@sergeyklay
Copy link
Contributor

Could you provide a solution for the SQLite. I mean converting TIME to date type, etc

@ruudboon
Copy link
Member Author

I think everything is in. If there's more needed please let me know.

Hopefully all fixed now. Will try to hook up a normal editor on the vagrant machine. Sorry for all the hassle.

case Column::TYPE_TIME:
if empty columnSql {
let columnSql .= "TIME";
Copy link
Contributor

@sergeyklay sergeyklay Dec 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this? https://www.sqlite.org/datatype3.html#date_and_time_datatype

That's why I asked you to provide a workaround. That is why we are not in a hurry to accept all possible data types.

$column = new Column("time-test", array(
'type' => Column::TYPE_TIME
));
$this->assertEquals($dialect->getColumnDefinition($column), 'TIME');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see here a test for the table that has this data type. Please understand me correctly. We can't release framework with black box.

For example:

CREATE TABLE `entries` (
  `id` INT PRIMARY KEY AUTO_INCREMENT,
  `start` TIME NOT NULL DEFAULT CURRENT_TIME,
  `end` TIME DEFAULT '23:59',
  `add` TIME NULL,
  `amount` INT NOT NULL,
  `price` INT NOT NULL
);

Could you please convert this into objects and back?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I get it. Makes sense! Shouldn't we have them for datetime etc also?
Thnx 4 all the feedback. Appreciate the effort, kinda new to this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already TYPE_DATETIME and TYPE_DATE

$column = new Column("time-test", array(
'type' => Column::TYPE_TIME
));
$this->assertEquals($dialect->getColumnDefinition($column), 'TIME');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment for MysqlTest

$column = new Column("time-test", array(
'type' => Column::TYPE_TIME
));
$this->assertEquals($dialect->getColumnDefinition($column), 'TIME');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment for MysqlTest

@david-duncan
Copy link

This hasn't seen activity in two months - can we get review fixes pushed and for this PR to get squashed?

@ruudboon
Copy link
Member Author

ruudboon commented Nov 8, 2017

Just wanna give heads up that I did some work on this issue (ruudboon@ce2408d). Trying to finish unit tests and get Travis to work on my branch before submitting a new pull.

@niden niden self-assigned this Oct 22, 2018
@niden niden mentioned this pull request Oct 31, 2018
3 tasks
@niden
Copy link
Member

niden commented Oct 31, 2018

Addressed in #13562

@niden niden closed this Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.