Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty string as default value in migrations not working [MySQL] #620

Closed
JRubics opened this issue Apr 7, 2022 · 2 comments
Closed

Empty string as default value in migrations not working [MySQL] #620

JRubics opened this issue Apr 7, 2022 · 2 comments
Labels
bug An existing feature is not working as intended

Comments

@JRubics
Copy link
Contributor

JRubics commented Apr 7, 2022

In migrations when creating a schema if we add default value to string field to be empty string ('') and run the migrations, that field becomes NULL in the table.

Example of migration:

class CreateSomeTable(Migration):
    def up(self):
        with self.schema.create('some_table') as table:
            table.increments('id')
            table.string('another_field', 10).default('')
            ....

Desktop (please complete the following information):

OS: Linux
Version Ubuntu 21.10

What database are you using?

Type: [MySQL]
Version [14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper]
Masonite ORM [2.4.2]
@JRubics JRubics added the bug An existing feature is not working as intended label Apr 7, 2022
@josephmancuso
Copy link
Member

This is fixed

@JRubics
Copy link
Contributor Author

JRubics commented Apr 21, 2022

Thank you! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An existing feature is not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants