-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
from typing import Optional | ||
|
||
from peewee import SqliteDatabase | ||
|
||
from calendar_connector.database.db_connector import get_db | ||
from calendar_connector.database.all_models import ALL_MODELS | ||
|
||
|
||
def create_db(db: SqliteDatabase) -> None: | ||
def create_db(db: Optional[SqliteDatabase] = None) -> None: | ||
if db is None: | ||
db = get_db() | ||
db.create_tables(ALL_MODELS) | ||
|
||
|
||
if __name__ == "__main__": | ||
create_db(get_db()) | ||
create_db() | ||
print("Created tables") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters