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
Allow other database objects to have their name explicitly specified (eg indexes, foreign keys) #422
Comments
This is done in v1.0.42 |
Ho @josephmancuso . Firstly, thanks for doing that so quickly! :) I've found an issue: If I use method chaining on the field as it is being created, the
Gives:
If I add the name of the column, it works. But as we are already operating on the column, it should know from context. |
Update: If I create the index or foreign key constraint as a separate statements, these work fine. Shall i raise a bug report? |
sure |
@SparrowhawkMMU technically this isn't a bug as it wasn't a feature. I think Orator supported this though for indexes. |
Describe the feature as you'd like to see it
Currently, Masonite ORM generates database object names by appending some hard coded values when generating the DDL from the migrations. I need to follow a different pattern to comply with client-specified database naming norms.
For example,
table.string("email").unique()
on theusers
table definition leads to a unique index with the database object name ofusers_email_unique
I would like to be able to specify a param on
unique()
,index
andforeign
which , if present, would be used instead of the auto generated name:etc
Thanks!
The text was updated successfully, but these errors were encountered: