Skip to content

Commit b243d1f

Browse files
committed
Updated demo database
1 parent e6f1f16 commit b243d1f

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

drf_example

4 KB
Binary file not shown.

example/migrations/0001_initial.py

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.5 on 2016-05-02 08:26
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
import django.db.models.deletion
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name='Author',
19+
fields=[
20+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21+
('created_at', models.DateTimeField(auto_now_add=True)),
22+
('modified_at', models.DateTimeField(auto_now=True)),
23+
('name', models.CharField(max_length=50)),
24+
('email', models.EmailField(max_length=254)),
25+
],
26+
options={
27+
'abstract': False,
28+
},
29+
),
30+
migrations.CreateModel(
31+
name='AuthorBio',
32+
fields=[
33+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
34+
('created_at', models.DateTimeField(auto_now_add=True)),
35+
('modified_at', models.DateTimeField(auto_now=True)),
36+
('body', models.TextField()),
37+
('author', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='bio', to='example.Author')),
38+
],
39+
options={
40+
'abstract': False,
41+
},
42+
),
43+
migrations.CreateModel(
44+
name='Blog',
45+
fields=[
46+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
47+
('created_at', models.DateTimeField(auto_now_add=True)),
48+
('modified_at', models.DateTimeField(auto_now=True)),
49+
('name', models.CharField(max_length=100)),
50+
('tagline', models.TextField()),
51+
],
52+
options={
53+
'abstract': False,
54+
},
55+
),
56+
migrations.CreateModel(
57+
name='Comment',
58+
fields=[
59+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
60+
('created_at', models.DateTimeField(auto_now_add=True)),
61+
('modified_at', models.DateTimeField(auto_now=True)),
62+
('body', models.TextField()),
63+
('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='example.Author')),
64+
],
65+
options={
66+
'abstract': False,
67+
},
68+
),
69+
migrations.CreateModel(
70+
name='Entry',
71+
fields=[
72+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
73+
('created_at', models.DateTimeField(auto_now_add=True)),
74+
('modified_at', models.DateTimeField(auto_now=True)),
75+
('headline', models.CharField(max_length=255)),
76+
('body_text', models.TextField(null=True)),
77+
('pub_date', models.DateField(null=True)),
78+
('mod_date', models.DateField(null=True)),
79+
('n_comments', models.IntegerField(default=0)),
80+
('n_pingbacks', models.IntegerField(default=0)),
81+
('rating', models.IntegerField(default=0)),
82+
('authors', models.ManyToManyField(to='example.Author')),
83+
('blog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='example.Blog')),
84+
],
85+
options={
86+
'abstract': False,
87+
},
88+
),
89+
migrations.AddField(
90+
model_name='comment',
91+
name='entry',
92+
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='example.Entry'),
93+
),
94+
]

example/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)