Closed sasaki000 closed 9 months ago
I found that by first creating an empty table in MySQL using Django's ORM's python3 manage.py migrate
command, I was able to migrate the data without losing any digits.
Therefore, I think this request has a very low priority because it seems avoidable.
Hey!
You beat me to it. Was about to say that Django's ORM can already migrate schemas from database to database and then you can simply use this tool to migrate the data itself :)
Thank you for your continued support and development. The number of digits in numeric columns cannot be migrated correctly. In Django, I defined the trading_price column as a 16-digit integer part using DecimalField. Sqlite3 does not seem to have number of digits information. Therefore, the number of digits will be lost when migrating to MySQL. I would like it to be possible to migrate the number of digits by referencing the Django model class instead of from the db.sqlite3 file.
(1)The Django model class is below.
(2)The table definition of the Sqlite3 database (db.sqlite3 file) is below.(Before migration)
(3)The MySQL table definition is below.(After migration)