Update readme

This commit is contained in:
2023-03-14 00:01:18 +01:00
parent ea91e622fb
commit 8c83107ea0
2 changed files with 25 additions and 3 deletions

View File

@ -11,13 +11,35 @@
# Migrate DB
## Export WGdaten
**ATTENTION:** Office and Python versions have to be both 64-bit or both 32-bit!
This will export all tables from the MS Access file `WGDATEN.accdb`
as csv files to the directory `TABLES_DIR`.
```shell
cd wgmaster
python3 export.py WGDATEN.accdb -o TABLES_DIR
cd..
```
## Generate PLZ
This will generate `data/90.plz.sql`.
```shell
cd data
python3 plz.py
cd ..
````
## Migrate
```shell
cd wgmaster
python3 migrate.py -q IN_DIR OUT_DIR -d DB.sqlite3
python3 import.py OUT_DIR NEW.sqlite3
python3 migrate.py -q TABLES_DIR MIGRATE_DIR -d DB.sqlite3
python3 import.py MIGRATE_DIR NEW.sqlite3
cd ..
```

View File

@ -28,7 +28,7 @@ def convert(tbl: str, name: str, a: Any) -> str:
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--output', default='tables')
parser.add_argument('wgdaten')
parser.add_argument('wgdaten', metavar='WGDATEN')
args = parser.parse_args()
os.makedirs(args.output, exist_ok=True)