Skip to content

Commit c3217dc

Browse files
committed
Merge pull request #95 from yola/log_before_migrate
Migrate after logfile creation
2 parents 9b126eb + e98fa9b commit c3217dc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Change Log
22
==========
33

4+
0.4.21
5+
------
6+
7+
* Migrate writes out to a log file, ensure that the log file exists before
8+
trying to migrate
9+
410
0.4.20
511
------
612

yodeploy/hooks/django.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ def django_prepare(self):
6464
os.mkdir(media_dir)
6565
chown_r(data_dir, 'www-data', 'www-data')
6666

67-
if self.migrate_on_deploy:
68-
self.migrate()
69-
7067
logfile = self.config.get(self.app, {}).get('path', {}).get('log',
7168
None)
7269
if logfile:
@@ -78,6 +75,9 @@ def django_prepare(self):
7875

7976
touch(logfile, 'www-data', 'adm', 0640)
8077

78+
if self.migrate_on_deploy:
79+
self.migrate()
80+
8181
if self.has_static:
8282
self.manage_py('collectstatic', '--noinput')
8383

0 commit comments

Comments
 (0)