troubleshooting Question

Porting tiny database from PostgreSQL to MySQL

Avatar of ltpitt
ltpitt asked on
DatabasesMySQL ServerPostgreSQL
3 Comments1 Solution230 ViewsLast Modified:
Hello there,

I have this working db in PostgreSQL:

DROP DATABASE IF EXISTS clanwars;

CREATE DATABASE clanwars;

USE clanwars;

CREATE TABLE t_teams (

    id SERIAL PRIMARY KEY,
    name TEXT,
    region TEXT,
    logo_url TEXT

);



CREATE TABLE t_matches (

    id SERIAL PRIMARY KEY,
    id_team_a INTEGER,
    id_team_b INTEGER,
    score_team_a INTEGER,
    score_team_b INTEGER,
    date DATE,

    constraint fk_team_a_id
    foreign key(id_team_a) references t_teams(id),

    constraint fk_team_b_id
    foreign key(id_team_b) references t_teams(id)

    );

If I try to create it in MySQL I get:
#1005 - Can't create table 'clanwars.t_matches' (errno: 150)

What am I doing wrong?
ASKER CERTIFIED SOLUTION
ltpitt

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros