Skip to content

Conversation

willvincent
Copy link
Contributor

Any unsignable datatype that has the unsigned modifier specified will be optimized to it's unsigned[type] corresponding datatype.

ie:

foo: integer unsigned

Becomes:

$table->unsignedInteger('foo');

And so forth.

Closes #5

@jasonmccreary
Copy link
Collaborator

Very nice. Are there any others you think, beyond unsigned?

@willvincent
Copy link
Contributor Author

Guess there are a couple nullable too.. nothing else jumps out at me. Let me get those added though

@willvincent
Copy link
Contributor Author

Omitted nullableTimestamps() as that's the same as timestamps() and arguable less optimal :)

@willvincent
Copy link
Contributor Author

willvincent commented Apr 15, 2020

Good call.. Str::startsWith is more readable

@jasonmccreary jasonmccreary merged commit 0a8646c into laravel-shift:master Apr 15, 2020
@jasonmccreary
Copy link
Collaborator

Yeah. I'll likely optimize the continue as well, but this is a great start.

@willvincent willvincent deleted the feature/optimize-datatypes branch April 16, 2020 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize column datatypes

2 participants