-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug (fix heroku): Reset migrations to fix heroku app
- delete migrations - remake migrations
- Loading branch information
Patrick Kimanje
authored and
Patrick Kimanje
committed
Oct 8, 2018
1 parent
a969fb7
commit beb29cd
Showing
6 changed files
with
237 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
exclude_patterns: | ||
- migrations/ | ||
- tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,4 +112,3 @@ db.sqlite3 | |
tmp | ||
my_env | ||
|
||
migrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Generated by Django 2.1 on 2018-10-08 18:55 | ||
|
||
from django.db import migrations, models | ||
import django.utils.timezone | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Article', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('updated_at', models.DateTimeField(auto_created=True, default=django.utils.timezone.now)), | ||
('created_at', models.DateTimeField(auto_created=True, default=django.utils.timezone.now)), | ||
('slug', models.SlugField(max_length=100, unique=True)), | ||
('title', models.CharField(error_messages={'required': 'Write a short title for your article.'}, max_length=255)), | ||
('description', models.TextField(error_messages={'required': 'A description of your post is required.'})), | ||
('body', models.TextField(error_messages={'required': 'You cannot submit an article without body.'})), | ||
('favorites_count', models.IntegerField(default=0)), | ||
('photo_url', models.CharField(max_length=255, null=True)), | ||
], | ||
options={ | ||
'ordering': ['-created_at', 'author'], | ||
'get_latest_by': 'created_at', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='ArticleReport', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('report_message', models.TextField(blank=True, null=True)), | ||
('reported_at', models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Comments', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_at', models.DateTimeField(auto_created=True, default=django.utils.timezone.now)), | ||
('body', models.TextField(error_messages={'required': 'You cannot submit without a comment.'})), | ||
], | ||
options={ | ||
'ordering': ['-created_at'], | ||
'get_latest_by': 'created_at', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Rating', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('rated_at', models.DateTimeField(auto_created=True, default=django.utils.timezone.now)), | ||
('score', models.DecimalField(decimal_places=2, max_digits=4)), | ||
], | ||
options={ | ||
'ordering': ('-score',), | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Replies', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_at', models.DateTimeField(auto_created=True, default=django.utils.timezone.now)), | ||
('content', models.TextField(error_messages={'required': 'You cannot submit without a reply.'})), | ||
], | ||
options={ | ||
'ordering': ['-created_at'], | ||
'get_latest_by': 'created_at', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Tag', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('tag_name', models.CharField(max_length=64, unique=True)), | ||
], | ||
), | ||
] |
78 changes: 78 additions & 0 deletions
78
authors/apps/articles/migrations/0002_auto_20181008_1855.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Generated by Django 2.1 on 2018-10-08 18:55 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('articles', '0001_initial'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='replies', | ||
name='author', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replies', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='replies', | ||
name='comment', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='articles.Comments'), | ||
), | ||
migrations.AddField( | ||
model_name='rating', | ||
name='article', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='scores', to='articles.Article'), | ||
), | ||
migrations.AddField( | ||
model_name='rating', | ||
name='rated_by', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='scores', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='comments', | ||
name='article', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='articles.Article'), | ||
), | ||
migrations.AddField( | ||
model_name='comments', | ||
name='author', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='articlereport', | ||
name='article', | ||
field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='articles.Article'), | ||
), | ||
migrations.AddField( | ||
model_name='articlereport', | ||
name='user', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='article', | ||
name='author', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='articles', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='article', | ||
name='dislikes', | ||
field=models.ManyToManyField(related_name='dislike_preferences', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='article', | ||
name='likes', | ||
field=models.ManyToManyField(related_name='like_preferences', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='article', | ||
name='tags', | ||
field=models.ManyToManyField(related_name='article_tag', to='articles.Tag'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Generated by Django 2.1 on 2018-10-08 18:55 | ||
|
||
import authors.apps.social_auth.utils | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('auth', '0009_alter_user_last_name_max_length'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='User', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('password', models.CharField(max_length=128, verbose_name='password')), | ||
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), | ||
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), | ||
('username', models.CharField(db_index=True, max_length=255, unique=True)), | ||
('email', models.EmailField(db_index=True, max_length=254, unique=True)), | ||
('is_active', models.BooleanField(default=True)), | ||
('is_email_verified', models.BooleanField(default=False)), | ||
('is_staff', models.BooleanField(default=False)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('updated_at', models.DateTimeField(auto_now=True)), | ||
('social_id', models.CharField(default=authors.apps.social_auth.utils.create_unique_number, max_length=255)), | ||
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), | ||
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Generated by Django 2.1 on 2018-10-08 18:55 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('articles', '0001_initial'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='UserProfile', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('bio', models.TextField(blank=True, null=True)), | ||
('avatar', models.URLField(blank=True, null=True)), | ||
('first_name', models.CharField(blank=True, max_length=50, null=True)), | ||
('last_name', models.CharField(blank=True, max_length=50, null=True)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('birth_date', models.DateField(blank=True, null=True)), | ||
('location', models.CharField(blank=True, max_length=100, null=True)), | ||
('updated_at', models.DateTimeField(auto_now=True)), | ||
('favorites', models.ManyToManyField(related_name='favorited_by', to='articles.Article')), | ||
('following', models.ManyToManyField(related_name='followers', to='profiles.UserProfile')), | ||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |