postgres_migration/migration.py

26 lines
584 B
Python
Raw Normal View History

2021-02-10 01:26:54 +01:00
from etlalchemy import ETLAlchemySource, ETLAlchemyTarget
source = ETLAlchemySource(
"sqlite:///databases/odyfo.db",
included_tables=[
"users",
"cities",
"games",
"payments",
"player_availabilities",
"player_cancel_games",
"purchase_games",
"sports",
"teams",
"user_ratings",
"venue_images",
"venues",
"web_bookings",
],
)
target = ETLAlchemyTarget(
"postgresql+psycopg2://postgres@localhost/odyfo", drop_database=True
)
target.addSource(source)
target.migrate()