Closed naarkhoo closed 5 years ago
I ended up changing Integer to SmallInteger and in some other cases, using Column(VARCHAR(255), nullable=False, unique=True)
instead of Column(String(255, 'utf8mb4_bin'), nullable=False, unique=True)
Branche
I do not have this error. I am guessing it is some sort of strict check in mysql since i can only get an error if i actually insert a key that is to long. I really need to make better unique string key solution i am not to happy with but have not had the time.
The easiest thing is to reduce the string length of branchetekst to less than 188. It seems the strings i currently have in my local copy of the data which is somewhat outdated is 115. I guess the best solution is to actually change it to text so no surprises come when new industri long industri descriptions suddenly appear and then handle the unique constraint in my program. I am not going to change that anytime soon. It is cause by the fact that industri code keys are not unique and have changed meaning over time, so the really best thing is to annotate the industri code with a reference to the specification it came from see https://www.dst.dk/da/Statistik/dokumentation/nomenklaturer/dansk-branchekode-db07#
As I am trying to "python -m cvrparser dbsetup -t" I get the following error,
I thought the problem could the charset - so I changed the
config.ini
but also within the mysql environment usingALTER DATABASE virkdb CHARACTER SET utf8 COLLATE utf8_general_ci;
.As a background information, I could setup the regnskab package (download the two large tables).