Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8451321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:12:27+00:00 2026-06-10T11:12:27+00:00

I am trying to create a table based on the Magento database structure. I

  • 0

I am trying to create a table based on the Magento database structure. I keep getting an error during my install process, so I am trying to create the three tables associated with the issue. I keep getting an error with the OAuth installation. The new version of Magento divides the process into 3 tables in MySQL. So two of the three tables have been created and here is the MySQL script for the third one – here is the table that runs the error.

DROP TABLE IF EXISTS `oauth_token`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_token` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
`consumer_id` int(10) unsigned NOT NULL COMMENT 'Consumer ID',
`admin_id` int(10) unsigned DEFAULT NULL COMMENT 'Admin user ID',
`customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer user ID',
`type` varchar(16) NOT NULL COMMENT 'Token Type',
`token` varchar(32) NOT NULL COMMENT 'Token',
`secret` varchar(32) NOT NULL COMMENT 'Token Secret',
`verifier` varchar(32) DEFAULT NULL COMMENT 'Token Verifier',
`callback_url` varchar(255) NOT NULL COMMENT 'Token Callback URL',
`revoked` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Is Token revoked',
`authorized` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Is Token authorized',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Token creation         timestamp',
PRIMARY KEY (`entity_id`),
UNIQUE KEY `UNQ_OAUTH_TOKEN_TOKEN` (`token`),
KEY `IDX_OAUTH_TOKEN_CONSUMER_ID` (`consumer_id`),
KEY `FK_OAUTH_TOKEN_ADMIN_ID_ADMIN_USER_USER_ID` (`admin_id`),
KEY `FK_OAUTH_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`customer_id`),
CONSTRAINT `FK_OAUTH_TOKEN_ADMIN_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`admin_id`)         REFERENCES `admin_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_OAUTH_TOKEN_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID` FOREIGN KEY     (`consumer_id`) REFERENCES `oauth_consumer` (`entity_id`) ON DELETE CASCADE ON UPDATE     CASCADE,
CONSTRAINT `FK_OAUTH_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='OAuth Tokens';
/*!40101 SET character_set_client = @saved_cs_client */;

so what should I do or how can I alter the MySQL script to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:12:29+00:00Added an answer on June 10, 2026 at 11:12 am

    Most commonly this is because the tables you are referencing are MyISAM and you can’t use them in an FK relationship.

    Might also be that you don’t have unique names for your FK’s but that looks unlikely given your naming convention.

    If neither of those, check the columns you are referencing and make sure they have an index on them, either primary key or unique.

    Finally check your data type, it must be exactly the same between both columns in the FK relationship. even differing lengths (int(10), int(11)), or signed vs unsigned will not allow you to make an FK relationship.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create this table in a MySQL database CREATE TABLE IF
I'm trying to create a custom module using Magento's EAV structure and have been
In PHP I am trying to create a table based off whats in a
I am trying to create a dynamic table that is being built based on
I'm trying to create a relationship based tables but wondering which is the better
I'm trying to create table from view from remote server (calling procedure UPDATE_PROC), like
Hi this is the table I am trying to create: CREATE TABLE images (
I am trying to create a table for printing purpose. As seen in many
I am trying to create a table with a single column using the following
I am trying to create a table layout filled with lots of bits of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.