Comments (4)
It could be a problem with Doctrine, converting tinyint fields to boolean. Will have to take a look.
from migrations-generator.
$table->boolean() in way generators goes back to tinyint anyway?
from migrations-generator.
What would be the issue with this conversion? $table->boolean()
is effectively tinyint(1)
.
The generated field type (when $table->boolean()
is called during the migration process) will depend on laravel's schema grammar.
from migrations-generator.
I see I accidentally typed tinyint(1)
in instead of tinyint(4)
in my initial report... corrected.
I see two issues with this... first, it is not a faithful recreation of the DB if all tinyint
are assumed to be boolean
. Converting tinyint(4) -> boolean()
which is tinyint(1)
is incorrect.
Second, at least for MySQL, the Laravel boolean
type is only a shortcut for tinyint(1)
as you said. So when you write boolean
in your migrations you are explicitly giving extra context as to what will be stored in that field.
But, when reverse-engineering a table there is no way to infer what that tinyint
field was being used for, no matter the display width. So in this case, on MySQL, I think it should just stay tinyint
, so tinyint(1) -> tinyInteger()
and tinyint(4) -> tinyInteger()
, etc. Don't even bring boolean
into it, because all that really says in the migration is "I intend to only store true/false values here", which you have no way of knowing.
Again, this is minor stuff, and the second issue if more a matter of semantics than anything.
from migrations-generator.
Related Issues (20)
- Feature Request? !Schema::hasTable HOT 1
- ->increment() not generated AUTO_INCREMENT HOT 1
- ignore fields after created_at
- laravel5.8 There are more Warning HOT 1
- How to generate migrations for Oracle HOT 1
- Support for Postgresql hstore. HOT 1
- Laravel 6.0 Compatibility HOT 27
- Support option of --ignore-created-migration HOT 2
- Namespace accident HOT 2
- Installation via composer require --dev "xethron/migrations-generator" failing HOT 1
- Not Working with Old database enum values HOT 1
- PSR-0 problem in laravel-4-generators: Class names and file locations do not match HOT 1
- Laravel 7 support HOT 2
- Not working for Laravel 5.8 HOT 1
- 'migrations' table was not updated HOT 1
- Undefined property: stdClass::$column_name HOT 3
- Migrations generator working with Laravel 7.11 HOT 2
- Support for postgres HOT 1
- Is that will be available for Laravel 8? HOT 1
- not working on laravel 9 what we should do now HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from migrations-generator.