Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- class User(models.Model):
- username = models.CharField(max_length=250, primary_key=True)
- password = models.CharField(max_length=100)
- last_login = models.CharField(max_length=30)
- investment_Points = models.IntegerField(default=0)
- class Transaction(models.Model):
- username = models.ForeignKey(User, on_delete=models.CASCADE)
- date = models.CharField(max_length=30)
- type = models.CharField(max_length=30)
- amount = models.IntegerField()
- Operations to perform:
- Apply all migrations: admin, Cr, auth, contenttypes, sessions
- Running migrations:
- Rendering model states... DONE
- Applying Cr.0001_initial... OK
- Applying Cr.0002_auto_20160817_2218... OK
- Applying Cr.0003_auto_20160904_0411...Traceback (most recent call last):
- File "C:Anaconda3Libsite-packagesdjangodbbackendsutils.py", line 64, in execute
- return self.cursor.execute(sql, params)
- File "C:Anaconda3Libsite-packagesdjangodbbackendsmysqlbase.py", line 112, in execute
- return self.cursor.execute(query, args)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 226, in execute
- self.errorhandler(self, exc, value)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbconnections.py", line 36, in defaulterrorhandler
- raise errorvalue
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 217, in execute
- res = self._query(query)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 378, in _query
- rowcount = self._do_query(q)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 341, in _do_query
- db.query(q)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbconnections.py", line 280, in query
- _mysql.connection.query(self, query)
- _mysql_exceptions.OperationalError: (1067, "Invalid default value for 'lastlogin'")
- The above exception was the direct cause of the following exception:
- Traceback (most recent call last):
- File "C:UsersRasmusworkspaceCrowdsrcmanage.py", line 10, in <module>
- execute_from_command_line(sys.argv)
- File "C:Anaconda3Libsite-packagesdjangocoremanagement__init__.py", line 353, in execute_from_command_line
- utility.execute()
- File "C:Anaconda3Libsite-packagesdjangocoremanagement__init__.py", line 345, in execute
- self.fetch_command(subcommand).run_from_argv(self.argv)
- File "C:Anaconda3Libsite-packagesdjangocoremanagementbase.py", line 348, in run_from_argv
- self.execute(*args, **cmd_options)
- File "C:Anaconda3Libsite-packagesdjangocoremanagementbase.py", line 399, in execute
- output = self.handle(*args, **options)
- File "C:Anaconda3Libsite-packagesdjangocoremanagementcommandsmigrate.py", line 200, in handle
- executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
- File "C:Anaconda3Libsite-packagesdjangodbmigrationsexecutor.py", line 92, in migrate
- self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)
- File "C:Anaconda3Libsite-packagesdjangodbmigrationsexecutor.py", line 121, in _migrate_all_forwards
- state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
- File "C:Anaconda3Libsite-packagesdjangodbmigrationsexecutor.py", line 198, in apply_migration
- state = migration.apply(state, schema_editor)
- File "C:Anaconda3Libsite-packagesdjangodbmigrationsmigration.py", line 123, in apply
- operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
- File "C:Anaconda3Libsite-packagesdjangodbmigrationsoperationsfields.py", line 62, in database_forwards
- field,
- File "C:Anaconda3Libsite-packagesdjangodbbackendsmysqlschema.py", line 50, in add_field
- super(DatabaseSchemaEditor, self).add_field(model, field)
- File "C:Anaconda3Libsite-packagesdjangodbbackendsbaseschema.py", line 396, in add_field
- self.execute(sql, params)
- File "C:Anaconda3Libsite-packagesdjangodbbackendsbaseschema.py", line 110, in execute
- cursor.execute(sql, params)
- File "C:Anaconda3Libsite-packagesdjangodbbackendsutils.py", line 79, in execute
- return super(CursorDebugWrapper, self).execute(sql, params)
- File "C:Anaconda3Libsite-packagesdjangodbbackendsutils.py", line 64, in execute
- return self.cursor.execute(sql, params)
- File "C:Anaconda3Libsite-packagesdjangodbutils.py", line 95, in __exit__
- six.reraise(dj_exc_type, dj_exc_value, traceback)
- File "C:Anaconda3Libsite-packagesdjangoutilssix.py", line 685, in reraise
- raise value.with_traceback(tb)
- File "C:Anaconda3Libsite-packagesdjangodbbackendsutils.py", line 64, in execute
- return self.cursor.execute(sql, params)
- File "C:Anaconda3Libsite-packagesdjangodbbackendsmysqlbase.py", line 112, in execute
- return self.cursor.execute(query, args)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 226, in execute
- self.errorhandler(self, exc, value)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbconnections.py", line 36, in defaulterrorhandler
- raise errorvalue
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 217, in execute
- res = self._query(query)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 378, in _query
- rowcount = self._do_query(q)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbcursors.py", line 341, in _do_query
- db.query(q)
- File "C:UsersRasmusAppDataLocalProgramsPythonPython35libsite-packagesMySQLdbconnections.py", line 280, in query
- _mysql.connection.query(self, query)
- django.db.utils.OperationalError: (1067, "Invalid default value for 'lastlogin'")
- Finished "C:UsersRasmusworkspaceCrowdsrcmanage.py migrate" execution.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement