{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/22402","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/22402/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/22402/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/22402/events","html_url":"https://github.com/laravel/framework/issues/22402","id":281575656,"node_id":"MDU6SXNzdWUyODE1NzU2NTY=","number":22402,"title":"Eloquent: renameColumn doesn't work on columns with '-' in it with MariaDB","user":{"login":"FSMaxB","id":4294942,"node_id":"MDQ6VXNlcjQyOTQ5NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/4294942?v=4","gravatar_id":"","url":"https://api.github.com/users/FSMaxB","html_url":"https://github.com/FSMaxB","followers_url":"https://api.github.com/users/FSMaxB/followers","following_url":"https://api.github.com/users/FSMaxB/following{/other_user}","gists_url":"https://api.github.com/users/FSMaxB/gists{/gist_id}","starred_url":"https://api.github.com/users/FSMaxB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FSMaxB/subscriptions","organizations_url":"https://api.github.com/users/FSMaxB/orgs","repos_url":"https://api.github.com/users/FSMaxB/repos","events_url":"https://api.github.com/users/FSMaxB/events{/privacy}","received_events_url":"https://api.github.com/users/FSMaxB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-12-12T23:38:13Z","updated_at":"2018-10-10T21:47:06Z","closed_at":null,"author_association":"NONE","body":"- Laravel Version: Lumen 5.5.2\r\n- PHP Version: 7.0.22-0ubuntu0.16.04.1\r\n- Database Driver & Version: 10.0.31-MariaDB\r\n\r\n### Description:\r\nWhen trying to rename a column with a `-`, the database throws a syntax error:\r\n```\r\n$ php artisan migrate\r\n\r\nIn Connection.php line 664:\r\n                                                                                                        \r\n  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check   \r\n  the manual that corresponds to your MariaDB server version for the right syntax to use near '-name g  \r\n  ood_name VARCHAR(255) NOT NULL' at line 1 (SQL: ALTER TABLE bug CHANGE weird-name good_name VARCHAR(  \r\n  255) NOT NULL)                                                                                        \r\n                                                                                                        \r\n\r\nIn PDOConnection.php line 79:\r\n                                                                                                        \r\n  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check   \r\n  the manual that corresponds to your MariaDB server version for the right syntax to use near '-name g  \r\n  ood_name VARCHAR(255) NOT NULL' at line 1                                                             \r\n                                                                                                        \r\n\r\nIn PDOConnection.php line 77:\r\n                                                                                                        \r\n  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check   \r\n  the manual that corresponds to your MariaDB server version for the right syntax to use near '-name g  \r\n  ood_name VARCHAR(255) NOT NULL' at line 1                                                             \r\n                                                                                                        \r\n```\r\n\r\nI think the problem is that column name is not quoted, so the `-` is a syntax error. Maybe dbal is misbehaving?\r\n\r\n### Steps To Reproduce:\r\n```php\r\n<?php\r\n\r\nuse Illuminate\\Support\\Facades\\Schema;\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\n\r\nclass RenameBug 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::create('bug', function (Blueprint $table) {\r\n            $table->string('weird-name');\r\n        });\r\n\r\n        Schema::table('bug', function (Blueprint $table) {\r\n            $table->renameColumn('weird-name', 'good_name');\r\n        });\r\n    }\r\n\r\n    /**\r\n     * Reverse the migrations.\r\n     *\r\n     * @return void\r\n     */\r\n    public function down()\r\n    {\r\n        //\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/428744658","html_url":"https://github.com/laravel/framework/issues/22402#issuecomment-428744658","issue_url":"https://api.github.com/repos/laravel/framework/issues/22402","id":428744658,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODc0NDY1OA==","user":{"login":"FSMaxB","id":4294942,"node_id":"MDQ6VXNlcjQyOTQ5NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/4294942?v=4","gravatar_id":"","url":"https://api.github.com/users/FSMaxB","html_url":"https://github.com/FSMaxB","followers_url":"https://api.github.com/users/FSMaxB/followers","following_url":"https://api.github.com/users/FSMaxB/following{/other_user}","gists_url":"https://api.github.com/users/FSMaxB/gists{/gist_id}","starred_url":"https://api.github.com/users/FSMaxB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FSMaxB/subscriptions","organizations_url":"https://api.github.com/users/FSMaxB/orgs","repos_url":"https://api.github.com/users/FSMaxB/repos","events_url":"https://api.github.com/users/FSMaxB/events{/privacy}","received_events_url":"https://api.github.com/users/FSMaxB/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T21:47:06Z","updated_at":"2018-10-10T21:47:06Z","author_association":"NONE","body":"But won't that break once the bug is fixed?"}}
{"actor":{"display_login":"FSMaxB"}}