summaryrefslogtreecommitdiff
path: root/app/media/migrations/0005_auto_20201201_2141.py
blob: e211ea2843f286583626dc7d8d7a142c22999eb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Generated by Django 3.1 on 2020-12-01 21:41

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('media', '0004_auto_20201201_2139'),
    ]

    operations = [
        migrations.RunSQL("""
            INSERT INTO media_luxvideo(
                id,
                video_mp4,
                video_webm,
                video_poster,
                title,
                pub_date,
                youtube_url,
                vimeo_url
            )
            SELECT 
                id,
                video_mp4,
                video_webm,
                video_poster,
                title,
                pub_date,
                youtube_url,
                vimeo_url
            FROM
                photos_luxvideo;
        """, reverse_sql="""
            INSERT INTO photos_luxvideos(
                video_mp4,
                video_webm,
                video_poster,
                title,
                pub_date,
                youtube_url,
                vimeo_url
            )
            SELECT
                video_mp4,
                video_webm,
                video_poster,
                title,
                pub_date,
                youtube_url,
                vimeo_url
            FROM
                media_luxvideo;
        """)
    ]