Monday, July 29, 2019

[google-cloud-sql-discuss] Google Cloud Database doesn't support MyISAM, so how I am going to achieve this in InnoDB?

Basically what I want to do is to have Auto Incremental Primary Key id, that resets when two column combo is unique.

This is how the database would look
+--------+----+---------+
| grp    | id | name    |
+--------+----+---------+
| fish   |  1 | lax     |
| mammal |  1 | dog     |
| mammal |  2 | cat     |
| mammal |  3 | whale   |
| bird   |  1 | penguin |
| bird   |  2 | ostrich |
+--------+----+---------+

and this would be the query that creates table...
CREATE TABLE animals (
    grp ENUM
('fish','mammal','bird') NOT NULL,
    id MEDIUMINT NOT NULL AUTO_INCREMENT
,
    name CHAR
(30) NOT NULL,
    PRIMARY KEY
(grp,id)
) ENGINE=MyISAM;

...But as Google Cloud don't support MyISAM, how I can achieve same thing in InnoDB?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/1545bd4b-cb3f-42df-8780-935d978b7689%40googlegroups.com.

No comments:

Post a Comment