GispoCoding / tarmo

Tarmo - Tampere Mobilemap
https://ulkoilutampereenseutu.fi/
MIT License
11 stars 3 forks source link

Quick fix of the symbolic link problem and refine databasemodel #128

Closed pavetsu14 closed 2 years ago

pavetsu14 commented 2 years ago

Unified some column names accross the kooste schema and went through current default and constraint settings. In other words, tried to clean the databasemodel up. Also added necessary information for determining tarmo category values for each object in kooste schema.

Still, alembic.ini problem needs to be solved and there needs to be some issues with osm data too (tests fail).

pavetsu14 commented 2 years ago

@Rikuoja The tests fail so there is probably something wrong here.. I just cannot locate what causes the problem.

pavetsu14 commented 2 years ago

A number of places to be fixed, plus two general issues to be fixed (I can do the latter)

  1. The migration file itself is missing in alembic/versions directory
  2. None of the imports will work at the moment, because they just take the data from the api and save it in the corresponding database fields. Will have to fix each manually to set the fields "name" and "infoFi" correctly, and to set the tarmo category in the lipas case.

Regarding to issue 1: Do you have any idea why the migration file isn't there? I think I committed everything which had changed. Isn't it so that this file should get generated automatically? Could this be releted to the problem with alembic.ini?

Rikuoja commented 2 years ago

Regarding to issue 1: Do you have any idea why the migration file isn't there? I think I committed everything which had changed. Isn't it so that this file should get generated automatically? Could this be releted to the problem with alembic.ini?

No idea. It should be there. What name did you give the new migration? The name of the file should be of the format uuid_migration_name.py and it should be in the versions directory. Basically it's identical to all the other files (it doesn't contain any original code) in the same directory so you can also add it manually, just change the uuids inside the file so that revision is your revision uuid and down_revision is the last revision uuid. That way alembic knows the correct order to run the migrations.

It's a bit silly that each revision has its own python script when they are identical. But the reason is that the migrations are run with python, and in that case each revision .py file might contain different python code.

pavetsu14 commented 2 years ago

@Rikuoja Made requested changes but tests still fail. This time I suppose the reason is that test_wfs_loader.py has wrong column names. I already tried to fix that, but apparently didn't succeed in that so please take a look what is still wrong here.

pavetsu14 commented 2 years ago

@Rikuoja Just to remember all necessary things; it is still needed to

Rikuoja commented 2 years ago