File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ script_location = alembic
36
36
# output_encoding = utf-8
37
37
38
38
# Container
39
- sqlalchemy.url = postgresql://postgres:thispasswordisverysecure @paws-compose-db/paws
39
+ sqlalchemy.url = postgresql://postgres:PASSWORD @paws-compose-db/paws
40
40
41
41
# Local
42
42
# sqlalchemy.url = postgresql://postgres:thispasswordisverysecure@localhost/paws
Original file line number Diff line number Diff line change 3
3
from sqlalchemy import engine_from_config
4
4
from sqlalchemy import pool
5
5
6
+ from os import environ
7
+
6
8
from alembic import context
7
9
8
10
# this is the Alembic Config object, which provides
25
27
# ... etc.
26
28
27
29
30
+ PG_URL1 = 'postgresql://postgres:'
31
+ PG_URL2 = environ ['POSTGRES_PASSWORD' ]
32
+ PG_URL3 = '@paws-compose-db/paws'
33
+
34
+ PG_URL = PG_URL1 + PG_URL2 + PG_URL3
35
+
36
+
28
37
def run_migrations_offline ():
29
38
"""Run migrations in 'offline' mode.
30
39
@@ -37,7 +46,8 @@ def run_migrations_offline():
37
46
script output.
38
47
39
48
"""
40
- url = config .get_main_option ("sqlalchemy.url" )
49
+ # url = config.get_main_option("sqlalchemy.url")
50
+ url = PG_URL
41
51
context .configure (
42
52
url = url ,
43
53
target_metadata = target_metadata ,
@@ -60,6 +70,7 @@ def run_migrations_online():
60
70
config .get_section (config .config_ini_section ),
61
71
prefix = "sqlalchemy." ,
62
72
poolclass = pool .NullPool ,
73
+ url = PG_URL ,
63
74
)
64
75
65
76
with connectable .connect () as connection :
You can’t perform that action at this time.
0 commit comments