Monday, July 29, 2019

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

Can you say why do you want to achieve that? What's wrong with all ids
being unique?

On Mon, Jul 29, 2019 at 10:25 AM Gerth Ermel <gerth.ermel@gmail.com> wrote:
>
> 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.

--
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/CAAG%3DWUtcsP6n_NE%3DT9Db0gxEPc3GJxOFEzS0obkbT-fubH7V0Q%40mail.gmail.com.

No comments:

Post a Comment