text: # Generated by Django 2.1.2 on 2019-02-04 04:03
  
  from django.conf import settings
  from django.db import migrations, models
  import django.db.models.deletion
  
  
  class Migration(migrations.Migration):
      """
      change table name
      flogs to posts
      flatgrams to photos
      """
      dependencies = [
          migrations.swappable_dependency(settings.AUTH_USER_MODEL),
          ('posts', '0001_initial'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Photo',
              fields=[
                  ('id', models.AutoField(primary_key=True, serialize=False)),
                  ('user', models.ForeignKey(
                      on_delete=django.db.models.deletion.CASCADE,
                      related_name='photos',
                      to=settings.AUTH_USER_MODEL)),
                  ('title',
                   models.CharField(max_length=255, verbose_name='title')),
                  (
                      'content',
                      models.TextField(null=True, verbose_name='content')),
                  ('created_at', models.DateTimeField(auto_now_add=True,
                                                      verbose_name='created')),
                  ('updated_at', models.DateTimeField(auto_now=True)),
              ],
              options={
                  'verbose_name': 'photo',
                  'verbose_name_plural': 'photos',
                  'db_table': 'photos',
                  'ordering': ['-id'],
              },
          ),
          migrations.CreateModel(
              name='Post',
              fields=[
                  ('id', models.AutoField(primary_key=True, serialize=False)),
                  ('user', models.ForeignKey(
                      on_delete=django.db.models.deletion.CASCADE,
                      related_name='posts',
                      to=settings.AUTH_USER_MODEL)),
                  ('title', models.CharField(
                      max_length=255, verbose_name='title')),
                  ('content', models.TextField(
                      null=True, verbose_name='content')),
                  ('created_at', models.DateTimeField(auto_now_add=True,
                                                      verbose_name='created')),
                  ('updated_at', models.DateTimeField(auto_now=True)),
              ],
              options={
                  'verbose_name': 'post',
                  'verbose_name_plural': 'posts',
                  'db_table': 'posts',
                  'ordering': ['-id'],
              },
          ),
          migrations.RemoveField(
              model_name='flatgram',
              name='user',
          ),
          migrations.RemoveField(
              model_name='flog',
              name='user',
          ),
          migrations.DeleteModel(
              name='Flatgram',
          ),
          migrations.DeleteModel(
              name='Flog',
          ),
          migrations.AddIndex(
              model_name='post',
              index=models.Index(fields=['created_at'],
                                 name='idx_posts_created_at'),
          ),
          migrations.AddIndex(
              model_name='photo',
              index=models.Index(fields=['created_at'],
                                 name='idx_photos_created_at'),
          ),
      ]
  