Conditions | 4 |
Total Lines | 11 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import os |
||
9 | def generate_tables(database): |
||
10 | for (name, table) in tables.items(): |
||
11 | if not database.find_table(name): |
||
12 | try: |
||
13 | database.create_table(name, table) |
||
14 | print(f"Table {name} created.") |
||
15 | except psycopg2.errors.SyntaxError as error: |
||
16 | print(f"Fail: {error}.") |
||
17 | return |
||
18 | else: |
||
19 | print(f"Table {name} already exists.") |
||
20 | |||
25 |