doctrine / dbal

Doctrine Database Abstraction Layer
https://www.doctrine-project.org/projects/dbal.html
MIT License
9.41k stars 1.33k forks source link

Column change causes 'NULL' #5603

Closed fridzema closed 1 year ago

fridzema commented 2 years ago

I just posted the same issue to laravel/framework and was pointed to here directly https://github.com/doctrine/dbal

php artisan about

  Environment ......................................................................................................................................  
  Application Name ................................................................................................................... ***
  Laravel Version ........................................................................................................................... 9.25.1  
  PHP Version ................................................................................................................................ 8.1.9  
  Composer Version ........................................................................................................................... 2.4.0  
  Environment ................................................................................................................................ local  
  Debug Mode ............................................................................................................................... ENABLED  
  URL ........................................................................................................................... ***  
  Maintenance Mode ............................................................................................................................. OFF  

  Cache ............................................................................................................................................  
  Config ................................................................................................................................ NOT CACHED  
  Events ................................................................................................................................ NOT CACHED  
  Routes ................................................................................................................................ NOT CACHED  
  Views ................................................................................................................................. NOT CACHED  

  Drivers ..........................................................................................................................................  
  Broadcasting .............................................................................................................................. pusher  
  Cache ...................................................................................................................................... redis  
  Database ................................................................................................................................... mysql  
  Logs .............................................................................................................................. stack / single  
  Mail ........................................................................................................................................ smtp  
  Octane .................................................................................................................................... swoole  
  Queue ...................................................................................................................................... redis  
  Session .................................................................................................................................... redis  

composer show -i

Direct dependencies:
akaunting/laravel-money                  dev-master 4875d13           Currency formatting and conversion package for Laravel
barryvdh/laravel-debugbar                v3.7.0                       PHP Debugbar integration for Laravel
barryvdh/laravel-ide-helper              v2.12.3                      Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
barryvdh/laravel-snappy                  v1.0.0                       Snappy PDF/Image for Laravel
beyondcode/helo-laravel                  1.4.0                        HELO Laravel debug helper
doctrine/dbal                            3.4.1                        Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
ebess/advanced-nova-media-library        3.8.0                        Laravel Nova tools for managing the Spatie media library.
epartment/nova-dependency-container      1.3.3                        A Laravel Nova field container allowing to depend on other fields values
ergebnis/composer-normalize              2.28.3                       Provides a composer plugin for normalizing composer.json.
fakerphp/faker                           v1.20.0                      Faker is a PHP library that generates fake data for you.
guzzlehttp/guzzle                        7.4.5                        Guzzle is a PHP HTTP client library
h4cc/wkhtmltoimage-amd64                 0.12.4                       Convert html to image using webkit (qtwebkit). Static linked linux binary for amd64 systems.
h4cc/wkhtmltopdf-amd64                   0.12.4                       Convert html to pdf using webkit (qtwebkit). Static linked linux binary for amd64 systems.
imanghafoori/laravel-masterpass          dev-master b5d974e           A minimal yet powerful package to help you easily impersonate your users.
lab404/laravel-impersonate               1.7.3                        Laravel Impersonate is a plugin that allows to you to authenticate as your users.
laracasts/flash                          3.2.1                        Easy flash notifications
laracasts/generators                     2.0.1                        Advanced Laravel generators, that include schema information.
laravel/dusk                             v6.25.1                      Laravel Dusk provides simple end-to-end testing and browser automation.
laravel/framework                        v9.25.1                      The Laravel Framework.
laravel/horizon                          v5.10.0                      Dashboard and code-driven configuration for Laravel queues.
laravel/nova                             3.32.0                       A wonderful administration interface for Laravel.
laravel/octane                           v1.3.0                       Supercharge your Laravel application's performance.
laravel/pint                             v1.1.1                       An opinionated code formatter for PHP.
laravel/sanctum                          v2.15.1                      Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.
laravel/tinker                           v2.7.2                       Powerful REPL for the Laravel framework.
laravel/ui                               v3.4.6                       Laravel UI utilities and presets.
liam-wiltshire/laravel-jit-loader        dev-l9-compatibility 45287e7 Just In Time relationship loader for Laravel
mockery/mockery                          1.5.0                        Mockery is a simple yet flexible PHP mock object framework
nunomaduro/collision                     v6.2.1                       Cli error handling for console/command-line PHP applications.
nunomaduro/larastan                      v2.1.12                      Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel
nunomaduro/laravel-desktop-notifier      v2.6.0                       Send notifications to your desktop from your Laravel commands. An JoliNotif wrapper for Laravel 5.
phpoffice/phpspreadsheet                 1.24.1                       PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpunit/phpunit                          9.5.21                       The PHP Unit Testing framework.
premediapower/chili-api                  dev-master 20d104c           Package generated from https://editor.premediapower.com/editor/main.asmx?WSDL using wsdltophp/packagegenerator
premediapower/cloudflow-api              dev-master d8af9db           Cloudflow PHP Api package
premediapower/pmp-nova-theme             dev-development              A Laravel Nova theme.
pusher/pusher-php-server                 7.0.2                        Library for interacting with the Pusher REST API
rootinc/laravel-azure-middleware         0.9.10                       Azure Middleware Auth
sentry/sentry-laravel                    2.13.0                       Laravel SDK for Sentry (https://sentry.io)
spatie/laravel-activitylog               4.5.3                        A very simple activity logger to monitor the users of your website or application
spatie/laravel-blade-javascript          2.7.0                        A Blade directive to export variables to JavaScript
spatie/laravel-ignition                  1.3.1                        A beautiful error page for Laravel applications.
spatie/laravel-image-optimizer           1.7.0                        Optimize images in your Laravel app
spatie/laravel-medialibrary              10.4.3                       Associate files with Eloquent models
spatie/laravel-ray                       1.30.0                       Easily debug Laravel apps
staudenmeir/belongs-to-through           v2.12.1                      Laravel Eloquent BelongsToThrough relationships
symfony/http-client                      v6.1.3                       Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/mailgun-mailer                   v6.1.0                       Symfony Mailgun Mailer Bridge
tightenco/ziggy                          v1.4.6                       Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
voku/html-min                            4.5.0                        HTML Compressor and Minifier
zbateson/mail-mime-parser                2.2.1                        MIME email message parser

Transitive dependencies:
appstract/nova-horizon                   2.1.0                        Horizon statistics in Nova
barryvdh/reflection-docblock             v2.0.6                      
brick/math                               0.9.3                        Arbitrary-precision arithmetic library
brick/money                              0.5.3                        Money and currency library
cakephp/chronos                          2.3.0                        A simple API extension for DateTime.
clue/stream-filter                       v1.6.0                       A simple and modern approach to stream filtering in PHP
composer/class-map-generator             1.0.0                        Utilities to scan PHP code and generate class maps.
composer/pcre                            3.0.0                        PCRE wrapping library that offers type-safe preg_* replacements.
dflydev/dot-access-data                  v3.0.1                       Given a deep data structure, access data by dot notation.
doctrine/cache                           2.2.0                        PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
doctrine/deprecations                    v1.0.0                       A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.
doctrine/event-manager                   1.1.2                        The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
doctrine/inflector                       2.0.4                        PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
doctrine/instantiator                    1.4.1                        A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                           1.2.3                        PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
dragonmantank/cron-expression            v3.3.1                       CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
egulias/email-validator                  3.2.1                        A library for validating emails against several RFCs
ergebnis/json-normalizer                 2.1.0                        Provides generic and vendor-specific normalizers for normalizing JSON documents.
ergebnis/json-printer                    3.2.0                        Provides a JSON printer, allowing for flexible indentation.
ergebnis/json-schema-validator           2.0.0                        Provides a JSON schema validator, building on top of justinrainbow/json-schema.
ezyang/htmlpurifier                      v4.14.0                      Standards compliant HTML filter written in PHP
facade/ignition-contracts                1.0.2                        Solution contracts for Ignition
filp/whoops                              2.14.5                       php error handling for cool kids
fruitcake/php-cors                       v1.2.0                       Cross-origin resource sharing library for the Symfony HttpFoundation
graham-campbell/result-type              v1.1.0                       An Implementation Of The Result Type
gregoriohc/laravel-nova-theme-responsive v0.8.1                       A Laravel Nova responsive theme.
guzzlehttp/promises                      1.5.1                        Guzzle promises library
guzzlehttp/psr7                          2.4.0                        PSR-7 message implementation that also provides common utility methods
hamcrest/hamcrest-php                    v2.0.1                       This is the PHP port of Hamcrest Matchers
http-interop/http-factory-guzzle         1.2.0                        An HTTP Factory using Guzzle PSR7
intervention/image                       2.7.2                        Image handling and manipulation library with support for Laravel integration
jean85/pretty-package-versions           2.0.5                        A library to get pretty versions strings of installed dependencies
jolicode/jolinotif                       v2.4.0                       Send desktop notifications on Windows, Linux, MacOS.
justinrainbow/json-schema                5.2.12                       A library to validate a json schema.
knplabs/knp-snappy                       v1.4.1                       PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.
laminas/laminas-diactoros                2.14.0                       PSR HTTP Message implementations
laravel/serializable-closure             v1.2.0                       Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
league/commonmark                        2.3.5                        Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)
league/config                            v1.1.1                       Define configuration arrays with strict schemas and access values with dot notation
league/flysystem                         3.2.1                        File storage abstraction for PHP
league/glide                             2.2.2                        Wonderfully easy on-demand image manipulation library with an HTTP based API.
league/mime-type-detection               1.11.0                       Mime-type detection for Flysystem
localheinz/diff                          1.1.1                        Fork of sebastian/diff for use with ergebnis/composer-normalize
maennchen/zipstream-php                  2.2.1                        ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.
markbaker/complex                        3.0.1                        PHP Class for working with complex numbers
markbaker/matrix                         3.0.0                        PHP Class for working with matrices
maximebf/debugbar                        v1.18.0                      Debug bar in the browser for php application
microsoft/microsoft-graph                1.73.0                       The Microsoft Graph SDK for PHP
monolog/monolog                          2.8.0                        Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                        1.11.0                       Create deep copies (clones) of your objects
myclabs/php-enum                         1.8.4                        PHP Enum implementation
nesbot/carbon                            2.61.0                       An API extension for DateTime that supports 281 different languages.
nette/schema                             v1.2.2                       📐 Nette Schema: validating data structures against a given Schema.
nette/utils                              v3.2.7                       🛠  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
nikic/php-parser                         v4.14.0                      A PHP parser written in PHP
nunomaduro/termwind                      v1.14.0                      Its like Tailwind CSS, but for the console.
nyholm/psr7                              1.5.1                        A fast PHP7 implementation of PSR-7
paragonie/random_compat                  v9.99.100                    PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
paragonie/sodium_compat                  v1.17.1                      Pure PHP implementation of libsodium; uses the PHP extension if it exists
phar-io/manifest                         2.0.3                        Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                          3.2.1                        Library for handling version information and constraints
php-http/client-common                   2.5.0                        Common HTTP Client implementations and tools for HTTPlug
php-http/discovery                       1.14.3                       Finds installed HTTPlug implementations and PSR-7 message factories
php-http/httplug                         2.3.0                        HTTPlug, the HTTP client abstraction for PHP
php-http/message                         1.13.0                       HTTP Message related tools
php-http/message-factory                 v1.0.2                       Factory interfaces for PSR-7 HTTP Message
php-http/promise                         1.1.0                        Promise used for asynchronous HTTP requests
php-webdriver/webdriver                  1.12.1                       A PHP client for Selenium WebDriver. Previously facebook/webdriver.
phpdocumentor/reflection-common          2.2.0                        Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock        5.3.0                        With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver              1.6.1                        A PSR-5 based resolver of Class names, Types and Structural Element Names
phpmyadmin/sql-parser                    5.5.0                        A validating SQL lexer and parser with a focus on MySQL dialect.
phpoption/phpoption                      1.9.0                        Option Type for PHP
phpspec/prophecy                         v1.15.0                      Highly opinionated mocking framework for PHP 5.3+
phpstan/phpstan                          1.8.2                        PHPStan - PHP Static Analysis Tool
phpunit/php-code-coverage                9.2.15                       Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator                3.0.6                        FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                      3.1.1                        Invoke callables with a timeout
phpunit/php-text-template                2.0.4                        Simple template engine.
phpunit/php-timer                        5.0.3                        Utility class for timing
pimple/pimple                            v3.5.0                       Pimple, a simple Dependency Injection Container
psr/cache                                3.0.0                        Common interface for caching libraries
psr/container                            2.0.2                        Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                     1.0.0                        Standard interfaces for event handling.
psr/http-client                          1.0.1                        Common interface for HTTP clients
psr/http-factory                         1.0.1                        Common interfaces for PSR-7 HTTP message factories
psr/http-message                         1.0.1                        Common interface for HTTP messages
psr/log                                  3.0.0                        Common interface for logging libraries
psr/simple-cache                         2.0.0                        Common interfaces for simple caching
psy/psysh                                v0.11.8                      An interactive shell for modern PHP.
ralouphie/getallheaders                  3.0.3                        A polyfill for getallheaders.
ramsey/collection                        1.2.2                        A PHP library for representing and manipulating collections.
ramsey/uuid                              4.4.0                        A PHP library for generating and working with universally unique identifiers (UUIDs).
sebastian/cli-parser                     1.0.1                        Library for parsing CLI options
sebastian/code-unit                      1.0.8                        Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup       2.0.3                        Looks up which function or method a line of code belongs to
sebastian/comparator                     4.0.6                        Provides the functionality to compare PHP values for equality
sebastian/complexity                     2.0.2                        Library for calculating the complexity of PHP code units
sebastian/diff                           4.0.4                        Diff implementation
sebastian/environment                    5.1.4                        Provides functionality to handle HHVM/PHP environments
sebastian/exporter                       4.0.4                        Provides the functionality to export PHP variables for visualization
sebastian/global-state                   5.0.5                        Snapshotting of global state
sebastian/lines-of-code                  1.0.3                        Library for counting the lines of code in PHP source code
sebastian/object-enumerator              4.0.4                        Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector               2.0.4                        Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context              4.0.4                        Provides functionality to recursively process PHP variables
sebastian/resource-operations            3.0.3                        Provides a list of PHP built-in functions that operate on resources
sebastian/type                           3.0.0                        Collection of value objects that represent the types of the PHP type system
sebastian/version                        3.0.2                        Library that helps with managing the version number of Git-hosted PHP projects
sentry/sdk                               3.2.0                        This is a metapackage shipping sentry/sentry with a recommended HTTP client.
sentry/sentry                            3.7.0                        A PHP SDK for Sentry (http://sentry.io)
spatie/backtrace                         1.2.1                        A better backtrace
spatie/flare-client-php                  1.3.0                        Send PHP errors to Flare
spatie/ignition                          1.3.1                        A beautiful error page for PHP applications.
spatie/image                             2.2.4                        Manipulate images with an expressive API
spatie/image-optimizer                   1.6.2                        Easily optimize images using PHP
spatie/laravel-package-tools             1.12.1                       Tools for creating Laravel packages
spatie/macroable                         2.0.0                        A trait to dynamically add methods to a class
spatie/once                              3.1.0                        A magic memoization function
spatie/ray                               1.36.0                       Debug with Ray to fix problems faster
spatie/temporary-directory               2.1.0                        Easily create, use and destroy temporary directories
symfony/console                          v6.1.3                       Eases the creation of beautiful and testable command line interfaces
symfony/css-selector                     v6.1.3                       Converts CSS selectors to XPath expressions
symfony/deprecation-contracts            v3.1.1                       A generic function and convention to trigger deprecation notices
symfony/error-handler                    v6.1.3                       Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher                 v6.1.0                       Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts       v3.1.1                       Generic abstractions related to dispatching event
symfony/finder                           v6.1.3                       Finds files and directories via an intuitive fluent interface
symfony/http-client-contracts            v3.1.1                       Generic abstractions related to HTTP clients
symfony/http-foundation                  v6.1.3                       Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                      v6.1.3                       Provides a structured process for converting a Request into a Response
symfony/intl                             v6.1.0                       Provides a PHP replacement layer for the C intl extension that includes additional data from the ICU library
symfony/mailer                           v6.1.3                       Helps sending emails
symfony/mime                             v6.1.3                       Allows manipulating MIME messages
symfony/options-resolver                 v6.1.0                       Provides an improved replacement for the array_replace PHP function
symfony/polyfill-ctype                   v1.26.0                      Symfony polyfill for ctype functions
symfony/polyfill-iconv                   v1.26.0                      Symfony polyfill for the Iconv extension
symfony/polyfill-intl-grapheme           v1.26.0                      Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-idn                v1.26.0                      Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer         v1.26.0                      Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring                v1.26.0                      Symfony polyfill for the Mbstring extension
symfony/polyfill-php72                   v1.26.0                      Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php80                   v1.26.0                      Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81                   v1.26.0                      Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/polyfill-uuid                    v1.26.0                      Symfony polyfill for uuid functions
symfony/process                          v6.1.3                       Executes commands in sub-processes
symfony/psr-http-message-bridge          v2.1.2                       PSR HTTP message bridge
symfony/routing                          v6.1.3                       Maps an HTTP request to a set of configuration variables
symfony/service-contracts                v3.1.1                       Generic abstractions related to writing services
symfony/stopwatch                        v6.1.0                       Provides a way to profile code
symfony/string                           v6.1.3                       Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/translation                      v6.1.3                       Provides tools to internationalize your application
symfony/translation-contracts            v3.1.1                       Generic abstractions related to translation
symfony/var-dumper                       v6.1.3                       Provides mechanisms for walking through any arbitrary PHP variable
theseer/tokenizer                        1.2.1                        A small library for converting tokenized PHP source code into XML and potentially other formats
tijsverkoyen/css-to-inline-styles        2.2.4                        CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.
titasgailius/search-relations            2.0.1                        A Laravel Nova tool.
vlucas/phpdotenv                         v5.4.1                       Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
voku/portable-ascii                      2.0.1                        Portable ASCII library - performance optimized (ascii) string functions for php.
voku/simple_html_dom                     4.8.6                        Simple HTML DOM package.
webmozart/assert                         1.11.0                       Assertions to validate method input/output with nice error messages.
wsdltophp/packagebase                    2.2.3                        Contains the base classes to be used by classes generated by wsdltophp/packagegenerator
zbateson/mb-wrapper                      1.1.2                        Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation
zbateson/stream-decorators               1.0.6                        PHP psr7 stream decorators for mime message part streams

Migrations

  Schema::create('test', function(Blueprint $table){
      $table->string('name')->nullable();
  });
  Schema::table('test', function(Blueprint $table){
      $table->string('name', 100)->nullable()->change();
  });

Results

On my local instance using mariadb 10.8.3 this translates to the following create statements:

Good

CREATE TABLE `test_table` (
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

On our staging environment running on azure database service with mariadb 10.3.23 this generates the following create statements:

Wrong

CREATE TABLE `test_table` (
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'NULL'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

At doctrine/dbal i could find one somehow relevant issue but it seems to be fixed already... https://github.com/doctrine/dbal/issues/2988

morozov commented 2 years ago

@fridzema if you or the Laravel maintainers believe that the problem is in the DBAL, it should be reproduced using the DBAL's API only. Please provide the steps to reproduce the issue.

morozov commented 1 year ago

Closing due to the lack of feedback.

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.