{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/15625","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/15625/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/15625/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/15625/events","html_url":"https://github.com/laravel/framework/issues/15625","id":179402660,"number":15625,"title":"Migration caused error for columns ending with '#'","user":{"login":"bhargav3","id":949476,"avatar_url":"https://avatars.githubusercontent.com/u/949476?v=3","gravatar_id":"","url":"https://api.github.com/users/bhargav3","html_url":"https://github.com/bhargav3","followers_url":"https://api.github.com/users/bhargav3/followers","following_url":"https://api.github.com/users/bhargav3/following{/other_user}","gists_url":"https://api.github.com/users/bhargav3/gists{/gist_id}","starred_url":"https://api.github.com/users/bhargav3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhargav3/subscriptions","organizations_url":"https://api.github.com/users/bhargav3/orgs","repos_url":"https://api.github.com/users/bhargav3/repos","events_url":"https://api.github.com/users/bhargav3/events{/privacy}","received_events_url":"https://api.github.com/users/bhargav3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-27T05:47:44Z","updated_at":"2016-09-27T07:51:24Z","closed_at":null,"body":"- Laravel Version: 5.2.39\r\n- PHP Version: PHP 5.6.24 (cli) (built: Jul 22 2016 02:41:22)\r\n- Database Driver & Version: mysql & MySQL Server 5.7.13\r\n\r\n### Description:\r\nI have two column names in a table that end with \"#\".\r\nhin# and stock# respectively.\r\n\r\nLaravel migrations have caused MySQL errors while I tried to modify them.\r\n\r\n### Steps To Reproduce:\r\n\r\n- Create a table with columns \"hin#\" and \"stock#\" using the following SQL:\r\n\r\n````sql\r\nCREATE TABLE test_table (\r\nid INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n`hin#` VARCHAR(30),\r\n`stock#` VARCHAR(30)\r\n);\r\n````\r\n\r\n- Create a Laravel migration using the command:\r\n\r\n````bash\r\nphp artisan make:migration update_test_table\r\n````\r\n\r\n- Add the following code to the created Laravel migration:\r\n\r\n````php\r\n<?php\r\n\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\n\r\nclass UpdateVesselDatatypes extends Migration\r\n{\r\n    /**\r\n     * Run the migrations.\r\n     *\r\n     * @return void\r\n     */\r\n    public function up()\r\n    {\r\n        Schema::table('test_table', function ($table) {\r\n                $table->string('hin#')->nullable()->change();\r\n                $table->string('stock#')->nullable()->change();\r\n    }\r\n}\r\n````\r\n\r\n- You will see the following MySQL error:\r\n\r\n````log\r\n                                                                                                                                                                      [Illuminate\\Database\\QueryException]                                                                                                                                                    \r\n  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to u  \r\n  se near '' at line 1 (SQL: ALTER TABLE test_table CHANGE hin# hin# VARCHAR(255) DEFAULT NULL COLLATE latin1_swedish_ci, CHANGE stock# stock# VARCHAR(255) DEFAULT NULL COLLATE latin1_swed  \r\n  ish_ci, \r\n\r\n[PDOException]                                                                                                                                                                          \r\n  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to u  \r\n  se near '' at line 1                                                                                                                                                                    \r\n                                                      \r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/249791878","html_url":"https://github.com/laravel/framework/issues/15625#issuecomment-249791878","issue_url":"https://api.github.com/repos/laravel/framework/issues/15625","id":249791878,"user":{"login":"srmklive","id":839335,"avatar_url":"https://avatars.githubusercontent.com/u/839335?v=3","gravatar_id":"","url":"https://api.github.com/users/srmklive","html_url":"https://github.com/srmklive","followers_url":"https://api.github.com/users/srmklive/followers","following_url":"https://api.github.com/users/srmklive/following{/other_user}","gists_url":"https://api.github.com/users/srmklive/gists{/gist_id}","starred_url":"https://api.github.com/users/srmklive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srmklive/subscriptions","organizations_url":"https://api.github.com/users/srmklive/orgs","repos_url":"https://api.github.com/users/srmklive/repos","events_url":"https://api.github.com/users/srmklive/events{/privacy}","received_events_url":"https://api.github.com/users/srmklive/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T07:51:24Z","updated_at":"2016-09-27T07:51:24Z","body":"@bhargav3 You need to pull in `doctrine/dbal` package. I myself am using PHP 7.0.10 with MySQL 5.7.13  and didn't run into issue you mentioned. "}}
{"actor":{"display_login":"srmklive"}}