<gh_stars>10-100
# Generated by Django 2.0.7 on 2018-07-21 12:43

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.IntegerField(db_column='cat_id', primary_key=True, serialize=False)),
                ('title', models.CharField(db_column='cat_title', max_length=255)),
            ],
            options={
                'verbose_name': 'MediaWiki Category',
                'verbose_name_plural': 'MediaWiki Categories',
                'db_table': 'category',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='CategoryLink',
            fields=[
                ('id', models.IntegerField(db_column='cl_sortkey', primary_key=True, serialize=False)),
                ('cat', models.CharField(db_column='cl_to', max_length=255)),
            ],
            options={
                'verbose_name': 'MediaWiki Category Link',
                'verbose_name_plural': 'MediaWiki Category Links',
                'db_table': 'categorylinks',
                'ordering': ['cat', 'page'],
            },
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id', models.IntegerField(db_column='page_id', primary_key=True, serialize=False)),
                ('namespace', models.IntegerField(db_column='page_namespace')),
                ('title_url', models.CharField(db_column='page_title', max_length=255)),
                ('len', models.IntegerField(db_column='page_len')),
                ('is_redirect', models.BooleanField(db_column='page_is_redirect', default=False)),
            ],
            options={
                'verbose_name': 'MediaWiki Page',
                'verbose_name_plural': 'MediaWiki Pages',
                'db_table': 'page',
                'ordering': ['namespace', 'title_url'],
            },
        ),
        migrations.CreateModel(
            name='Revision',
            fields=[
                ('id', models.IntegerField(db_column='rev_id', primary_key=True, serialize=False)),
                ('timestamp', models.CharField(db_column='rev_timestamp', max_length=14)),
                ('page', models.ForeignKey(db_column='rev_page', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Page')),
            ],
            options={
                'verbose_name': 'MediaWiki Revision',
                'verbose_name_plural': 'MediaWiki Revisions',
                'db_table': 'revision',
            },
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
                ('id', models.IntegerField(db_column='old_id', primary_key=True, serialize=False)),
                ('data_raw', models.TextField(db_column='old_text')),
            ],
            options={
                'verbose_name': 'MediaWiki Text Blob',
                'verbose_name_plural': 'MediaWiki Text Blobs',
                'db_table': 'pagecontent',
            },
        ),
        migrations.AddField(
            model_name='revision',
            name='text',
            field=models.ForeignKey(db_column='rev_text_id', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Text'),
        ),
        migrations.AddField(
            model_name='page',
            name='latest',
            field=models.ForeignKey(db_column='page_latest', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Revision'),
        ),
        migrations.AddField(
            model_name='categorylink',
            name='page',
            field=models.ForeignKey(db_column='cl_from', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Page'),
        ),
    ]

# Generated by Django 2.0.7 on 2018-07-21 12:43

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.IntegerField(db_column='cat_id', primary_key=True, serialize=False)),
                ('title', models.CharField(db_column='cat_title', max_length=255)),
            ],
            options={
                'verbose_name': 'MediaWiki Category',
                'verbose_name_plural': 'MediaWiki Categories',
                'db_table': 'category',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='CategoryLink',
            fields=[
                ('id', models.IntegerField(db_column='cl_sortkey', primary_key=True, serialize=False)),
                ('cat', models.CharField(db_column='cl_to', max_length=255)),
            ],
            options={
                'verbose_name': 'MediaWiki Category Link',
                'verbose_name_plural': 'MediaWiki Category Links',
                'db_table': 'categorylinks',
                'ordering': ['cat', 'page'],
            },
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id', models.IntegerField(db_column='page_id', primary_key=True, serialize=False)),
                ('namespace', models.IntegerField(db_column='page_namespace')),
                ('title_url', models.CharField(db_column='page_title', max_length=255)),
                ('len', models.IntegerField(db_column='page_len')),
                ('is_redirect', models.BooleanField(db_column='page_is_redirect', default=False)),
            ],
            options={
                'verbose_name': 'MediaWiki Page',
                'verbose_name_plural': 'MediaWiki Pages',
                'db_table': 'page',
                'ordering': ['namespace', 'title_url'],
            },
        ),
        migrations.CreateModel(
            name='Revision',
            fields=[
                ('id', models.IntegerField(db_column='rev_id', primary_key=True, serialize=False)),
                ('timestamp', models.CharField(db_column='rev_timestamp', max_length=14)),
                ('page', models.ForeignKey(db_column='rev_page', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Page')),
            ],
            options={
                'verbose_name': 'MediaWiki Revision',
                'verbose_name_plural': 'MediaWiki Revisions',
                'db_table': 'revision',
            },
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
                ('id', models.IntegerField(db_column='old_id', primary_key=True, serialize=False)),
                ('data_raw', models.TextField(db_column='old_text')),
            ],
            options={
                'verbose_name': 'MediaWiki Text Blob',
                'verbose_name_plural': 'MediaWiki Text Blobs',
                'db_table': 'pagecontent',
            },
        ),
        migrations.AddField(
            model_name='revision',
            name='text',
            field=models.ForeignKey(db_column='rev_text_id', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Text'),
        ),
        migrations.AddField(
            model_name='page',
            name='latest',
            field=models.ForeignKey(db_column='page_latest', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Revision'),
        ),
        migrations.AddField(
            model_name='categorylink',
            name='page',
            field=models.ForeignKey(db_column='cl_from', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='compat.Page'),
        ),
    ]
# Generated by Django 2.0.7 on 2018-07-21 12:43