Ticket #32256: 0001_initial.py

File 0001_initial.py, 1.2 KB (added by InvalidInterrupt, 4 years ago)

example migration

Line 
1# Generated by Django 3.1.4 on 2020-12-10 08:18
2
3from django.db import migrations, models
4
5
6class Migration(migrations.Migration):
7
8 dependencies = [
9 ]
10
11 operations = [
12 migrations.CreateModel(
13 name="test",
14 fields=[
15 ("id",
16 models.AutoField(auto_created=True, primary_key=True, serialize=False,
17 verbose_name="ID")),
18 ("first_created", models.DateTimeField(auto_now=True)),
19 ("last_edited", models.DateTimeField(auto_now_add=True, null=True)),
20 ]
21 ),
22 migrations.RunPython(migrations.RunPython.noop), # Create an optimization barrier
23 migrations.RenameField(model_name="test",
24 old_name="first_created",
25 new_name="last_edited2"),
26 migrations.RenameField(model_name="test",
27 old_name="last_edited",
28 new_name="first_created"),
29 migrations.RenameField(model_name="test",
30 old_name="last_edited2",
31 new_name="last_edited"),
32 ]
Back to Top