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

日時データ型の対応 #2308

Merged
merged 7 commits into from May 11, 2017

Conversation

@chihiro-adachi
Copy link
Contributor

chihiro-adachi commented May 9, 2017

概要(Overview・Refs Issue)

#1199 の対応

方針(Policy)

mysql

postgresql

  • timestamp with timezoneを使う
    • 内部的にはUTC時刻で表現される
  • ormから投入するデータは、全てUTCに変換して保存する
    • select時はアプリ側のtimezoneに変換する
    • insert時はUTCに変換してinsert
  • 接続時に、Set timezone TO 'UTCする
    • dbalで直接sqlを実行した場合を想定
    • current_timestampやnowした時に、UTCで検索/更新するため
  • 参考

実装に関する補足(Appendix)

~~~`SQLSTATE[HY000]: General error: 1298 Unknown or incorrect time zone: 'UTC'`~~~

~~~https://dev.mysql.com/doc/refman/5.6/ja/mysql-tzinfo-to-sql.html~~~

https://github.com/EC-CUBE/ec-cube/pull/2308/commits/91d82f00f4121eed39eb1f5dec944917f2853005 で対応

## テスト(Test)

https://github.com/EC-CUBE/ec-cube/pull/2308/commits/a9e66fd878f08813b83101ab1208919ae455f272 にselect/insertのテストコードを追加

## 相談(Discussion)
@chihiro-adachi chihiro-adachi changed the title WIP:日次データ型の対応 WIP:日時データ型の対応 May 9, 2017
@chihiro-adachi chihiro-adachi force-pushed the chihiro-adachi:dev-timezone branch from dc0fe15 to a9e66fd May 10, 2017
@chihiro-adachi chihiro-adachi changed the title WIP:日時データ型の対応 日時データ型の対応 May 10, 2017
@chihiro-adachi chihiro-adachi added this to the 3.1.0 milestone May 10, 2017
@chihiro-adachi

This comment has been minimized.

Copy link
Contributor Author

chihiro-adachi commented May 10, 2017

mysqlのset timezoneの設定方法を確認 +00:00

@chihiro-adachi chihiro-adachi force-pushed the chihiro-adachi:dev-timezone branch from 91d82f0 to 229ee3c May 10, 2017
@kiy0taka kiy0taka merged commit 70c10e7 into EC-CUBE:experimental/3.1 May 11, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@chihiro-adachi chihiro-adachi deleted the chihiro-adachi:dev-timezone branch May 11, 2017
@Yangsin Yangsin mentioned this pull request Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.