Created
July 21, 2017 18:17
-
-
Save dtzitz/bc10897e172d83beaefab14ae6adc125 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
~ $ python manage.py makemigrations | |
Did you rename event.event_end_date to event.end_date (a DateTimeField)? [y/N] y | |
Did you rename event.event_start_date to event.start_date (a DateTimeField)? [y/N] y | |
Did you rename event.event_title to event.title (a CharField)? [y/N] y | |
Migrations for 'events': | |
events/migrations/0002_auto_20170721_1815.py | |
- Rename field event_end_date on event to end_date | |
- Rename field event_start_date on event to start_date | |
- Rename field event_title on event to title | |
- Add field category to event | |
~ $ python manage.py migrate | |
Operations to perform: | |
Apply all migrations: admin, auth, contenttypes, events, hello, sessions | |
Running migrations: | |
Applying events.0002_auto_20170721_1815...Traceback (most recent call last): | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute | |
return self.cursor.execute(sql, params) | |
psycopg2.ProgrammingError: column "event_end_date" does not exist | |
The above exception was the direct cause of the following exception: | |
Traceback (most recent call last): | |
File "manage.py", line 10, in <module> | |
execute_from_command_line(sys.argv) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line | |
utility.execute() | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 355, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv | |
self.execute(*args, **cmd_options) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute | |
output = self.handle(*args, **options) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 204, in handle | |
fake_initial=fake_initial, | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/executor.py", line 115, in migrate | |
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards | |
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration | |
state = migration.apply(state, schema_editor) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/migration.py", line 129, in apply | |
operation.database_forwards(self.app_label, schema_editor, old_state, project_state) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/operations/fields.py", line 299, in database_forwards | |
to_model._meta.get_field(self.new_name), | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 515, in alter_field | |
old_db_params, new_db_params, strict) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/postgresql/schema.py", line 112, in _alter_field | |
new_db_params, strict, | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 593, in _alter_field | |
self.execute(self._rename_field_sql(model._meta.db_table, old_field, new_field, new_type)) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 120, in execute | |
cursor.execute(sql, params) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/utils.py", line 80, in execute | |
return super(CursorDebugWrapper, self).execute(sql, params) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute | |
return self.cursor.execute(sql, params) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__ | |
six.reraise(dj_exc_type, dj_exc_value, traceback) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise | |
raise value.with_traceback(tb) | |
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/utils.py", line 65, in execute | |
return self.cursor.execute(sql, params) | |
django.db.utils.ProgrammingError: column "event_end_date" does not exist |
This file contains hidden or 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
(tampabored) dylan@d-F1480: python manage.py makemigrations | |
Migrations for 'events': | |
events/migrations/0007_auto_20170721_1812.py | |
- Alter field category on event | |
(tampabored) dylan@d-F1480: python manage.py migrate | |
Operations to perform: | |
Apply all migrations: admin, auth, contenttypes, events, hello, sessions | |
Running migrations: | |
Applying events.0007_auto_20170721_1812... OK |
This file contains hidden or 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
from django.db import models | |
# Create your models here. | |
class Event(models.Model): | |
title = models.CharField(max_length=200) | |
start_date = models.DateTimeField('start date') | |
end_date = models.DateTimeField('end date') | |
category = models.CharField( | |
max_length = 50, | |
choices = ( | |
('Concert', 'CON'), | |
('Festival', 'FEST'), | |
('Kids', 'KIDS'), | |
('Miscellaneous', 'MISC') | |
), | |
default = 'Miscellaneous' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment