Magento General Error 1025 Error On Rename Of
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site error 1025 (hy000) error on rename of (errno 150) About Us Learn more about Stack Overflow the company Business Learn more about
General Error: 1025 Error On Rename Of Laravel
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join error 1025 (hy000) error on rename of (errno 152) the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Help with: ERROR 1025
Mysql Error 1025 Errno 150
(HY000): Error on rename of … (errno: 150) up vote 35 down vote favorite 7 I am getting this error when I am trying to run an alter table command to drop a column: ERROR 1025 (HY000): Error on rename of .... (errno: 150). If I understand correctly it is a foreign key problem, but I do not have a clue how to fix it. Would laravel drop foreign key somebody be so kind and tell me how to get it working. The code used for creating table: CREATE TABLE categories( cid INT AUTO_INCREMENT NOT NULL PRIMARY KEY, assets_id INT NOT NULL, cat_name VARCHAR(30) NOT NULL, INDEX(assets_id), FOREIGN KEY (assets_id) REFERENCES asset(aid) ON UPDATE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=utf8; The alter command: ALTER TABLE categories DROP COLUMN assets_id; The table categories is completely blank. So there is no information to set off the CASCADE restrictions. So could you help me what kind of wizardry do I need to delete the column assets_id. Thank you. mysql share|improve this question edited May 10 '11 at 10:50 Manoj 3,43574364 asked May 10 '11 at 10:31 Henkka 3623817 add a comment| 3 Answers 3 active oldest votes up vote 66 down vote accepted Use SHOW CREATE TABLE categories to show the name of constraint. Most probably it will be categories_ibfk_1 Use the name to drop the foreign key first and the column then: ALTER TABLE categories DROP FOREIGN KEY categories_ibfk_1; ALTER TABLE categories DROP COLUMN assets_id; share|improve this answer answered May 10 '11 at 10:37 Quassnoi 262k51432485 Thank you! That did the trick. –Henkka May
here
Error Code 1025 Outlook Mac
for a quick overview of the site Help
Error 1025 Outlook Mac
Center Detailed answers to any questions you might have Meta Discuss the laravel drop foreign key if exists workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about http://stackoverflow.com/questions/5948704/help-with-error-1025-hy000-error-on-rename-of-errno-150 hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/27175808/dropping-column-with-foreign-key-laravel-error-general-error-1025-error-on-ren them; it only takes a minute: Sign up Dropping column with foreign key Laravel error: General error: 1025 Error on rename up vote 26 down vote favorite 3 I've created a table using migration like this: public function up() { Schema::create('despatch_discrepancies', function($table) { $table->increments('id')->unsigned(); $table->integer('pick_id')->unsigned(); $table->foreign('pick_id')->references('id')->on('picks'); $table->integer('pick_detail_id')->unsigned(); $table->foreign('pick_detail_id')->references('id')->on('pick_details'); $table->integer('original_qty')->unsigned(); $table->integer('shipped_qty')->unsigned(); }); } public function down() { Schema::drop('despatch_discrepancies'); } I need to change this table and drop the foreign key reference & column pick_detail_id and add a new varchar column called sku after pick_id column. So, I've created another migration, which looks like this: public function up() { Schema::table('despatch_discrepancies', function($table) { $table->dropForeign('pick_detail_id'); $table->dropColumn('pick_detail_id'); $table->string('sku', 20)->after('pick_id'); }); } public function down() { Schema::table('despatch_discrepancies', function($table) { $table->integer('pick_detail_id')->unsigned(); $table->foreign('pick_detail_id')->references('id')->on('pick_details'); $tabl
Local http://www.shahalpk.name/post/63368393191/mysql-error-1025-on-rename-of-blahblah-errno Community Meetups Laravel.io Site and Community Forum Database migrate:reset erring when dropping error 1025 foreign key I'm having an issue when rolling back a migration that drops foreign keys. I'm creating the foreign keys in their own migration file to error on rename avoid any issues with the tables not being present and the migration itself works fine. However, the reset provides the following SQL error. [Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 1025 Error on rename of [emailprotected]/authors_books' to [emailprotected]/#sql2 20a-f4' (errno: 152) (SQL: alter table `authors_books` drop foreign key author_id) Everything seems fine. I'll include a sample migration set tha
above error popped up. My SQL command was ALTER TABLE `admin_user` DROP `store_id`; and the error… MySQL Error #1025 Error on rename of '.\magento\#sql-1378_1b9' to '.\magento\admin_user' (errno: 150) I’ve learned this error is associated with some foreign key related stuff. My column store_id was a foreign key referencing another table core_store. Although the error wasn’t much informative, googling the error code will link you to pretty good results. In my case, all i have to do was to drop the associated foreign key and then drop the column. To find the foreign key name you can execute the following query select constraint_name from information_schema.key_column_usage where table_name like 'admin_user' and column_name like 'store_id'; +------------------------------------------------------------+ | constraint_name | +------------------------------------------------------------+ | FK_ADMIN_USER_WEBSITE_ID_REF_CORE_STORE_WEBSITE_ID | +------------------------------------------------------------+ Now drop the foreign key… alter table admin_user drop foreign key FK_ADMIN_USER_WEBSITE_ID_REF_CORE_STORE_WEBSITE_ID And finally drop the column… alter table `admin_user` drop `store_id`; 0 Kudos 0 Kudos Show Notes jonathanmiami liked thisjonathanmiami reblogged this from shahalpkshahalpk posted this Read this next: More shahalpk. do. overdo. @shahalpk sayhello © 2011–2016