Fix url
This commit is contained in:
parent
251d29c461
commit
be0412ffae
|
|
@ -11,27 +11,17 @@ class Command(BaseCommand):
|
||||||
def account_sql(self):
|
def account_sql(self):
|
||||||
with connections['legacy'].cursor() as cursor:
|
with connections['legacy'].cursor() as cursor:
|
||||||
cursor.execute('''
|
cursor.execute('''
|
||||||
select REPLACE(p.image_url, 'original.png', p.attachment_file_name) as image_url,
|
select
|
||||||
p.attachment_file_name,
|
url as image_url,
|
||||||
p.account_id
|
t.account_id
|
||||||
from
|
from
|
||||||
(
|
(
|
||||||
select
|
select a.account_id, a.attachment_file_name,
|
||||||
REPLACE(
|
trim(CONCAT(u.url, a.attachment_suffix_url)) as url
|
||||||
REPLACE(t.url, 'original.jpg', t.attachment_file_name),
|
from account_pictures a,
|
||||||
'original.jpeg', t.attachment_file_name
|
(select 'https://s3.eu-central-1.amazonaws.com/gm-test.com/media/' as url) u
|
||||||
) as image_url,
|
) t
|
||||||
t.attachment_file_name,
|
''')
|
||||||
t.account_id
|
|
||||||
from
|
|
||||||
(
|
|
||||||
select a.account_id, a.attachment_file_name,
|
|
||||||
LOWER(trim(CONCAT(u.url, a.attachment_suffix_url))) as url
|
|
||||||
from account_pictures a,
|
|
||||||
(select 'https://s3.eu-central-1.amazonaws.com/gm-test.com/media/' url) u
|
|
||||||
) t
|
|
||||||
) p
|
|
||||||
''')
|
|
||||||
return namedtuplefetchall(cursor)
|
return namedtuplefetchall(cursor)
|
||||||
|
|
||||||
def handle(self, *args, **kwargs):
|
def handle(self, *args, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user