Closed faysal-ishtiaq closed 3 years ago
We require contributors to sign our Contributor License Agreement, and we don't have @faysal-ishtiaq on file. In order for us to review and merge your code, please contact @isedwards to get yourself added.
Thank you @faysal-ishtiaq. MCH users are using MySQL 5.1 which allows the dummy dates by default as an alternative to NULL
.
The NO_ZERO_DATE
SQL Mode was added in MySQL 5.7.8.
Could you try:
NO_ZERO_DATE
to False to allow the dummy default dates and restoring the schemaExecuting these commands resolved the issue with original DDL file.
mysql -h localhost -P 3306 --protocol tcp -D mch -u root -p
SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
exit;
mysql -h localhost -P 3306 --protocol tcp -D mch -u root -p < ./opencdms-test-data/schemas/mch/Create_MCH_English_basic_tables.sql
and from this package root
sqlacodegen mysql+pymysql://root:root@localhost/mch > ./opencdms/models/mch/english.py
P.S: I used latest MySQL docker image
@cla-bot check
The cla-bot has been summoned, and re-checked this pull request!
Resolves #10
I encountered an error while importing the tables into the database. In the DDL file on line 506, it was
I changed it to the following to solve the error