You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in Slack, I was attempting to use after in a migration as shown in the documentation table.string('is_admin').after('email'). In Masonite-orm 1.0.55 it is throwing an exception "'NoneType' object is not callable" in masoniteorm/schema/Blueprint.py line 874. The line is self._last_column.after(old_column).
To Reproduce
Steps to reproduce the behavior:
Create a basic migration like this (all boilerplate from craft migration -t users except for the added line from the documentation).
frommasoniteorm.migrationsimportMigrationclassMigrationForUsersTable(Migration):
defup(self):
""" Run the migrations. """withself.schema.table("users") astable:
table.string('is_admin').after('email')
defdown(self):
""" Revert the migrations. """pass
Do the migration with craft migrate
The migration runs somewhat -- the is_admin column gets added to the end of the table, but not after the email column as intended. Because it throws the exception, the migration does not complete successfully.
What database are you using?
Type: MariaDB
Version 10.1something on Ubuntu
Masonite ORM v1.0.55
Other notes
Joseph Mancuso suggested that perhaps string is not setting _last_column.
I found this while trying to do a migration that alters several table columns and simplified it. It feels like the documentation for creating tables is pretty good, but altering them could use more examples.
The text was updated successfully, but these errors were encountered:
tpow
added
the
bug
An existing feature is not working as intended
label
Nov 12, 2021
As mentioned in Slack, I was attempting to use
after
in a migration as shown in the documentationtable.string('is_admin').after('email')
. In Masonite-orm 1.0.55 it is throwing an exception "'NoneType' object is not callable" in masoniteorm/schema/Blueprint.py line 874. The line isself._last_column.after(old_column)
.To Reproduce
Steps to reproduce the behavior:
craft migrate
The migration runs somewhat -- the is_admin column gets added to the end of the table, but not after the email column as intended. Because it throws the exception, the migration does not complete successfully.
What database are you using?
Other notes
Joseph Mancuso suggested that perhaps string is not setting _last_column.
I found this while trying to do a migration that alters several table columns and simplified it. It feels like the documentation for creating tables is pretty good, but altering them could use more examples.
The text was updated successfully, but these errors were encountered: