Hello. I have roughly this migration
def change do
create table(:countries, pimary_key: false) do
add :code, :string, size: 2, primary_key: true
add :name, :string, null: false
end
but this produces this sql
CREATE TABLE public.countries
(
id integer NOT NULL DEFAULT nextval('countries_id_seq'::regclass),
code character varying(2) NOT NULL,
name character varying(255) NOT NULL,
CONSTRAINT countries_pkey PRIMARY KEY (id, code)
)
WITH (
OIDS=FALSE
);
and creates this table
Table "public.countries"
Column | Type | Modifiers
--------+------------------------+--------------------------------------------------------
id | integer | not null default nextval('countries_id_seq'::regclass)
code | character varying(2) | not null
name | character varying(255) | not null
Indexes:
"countries_pkey" PRIMARY KEY, btree (id, code)
which is not my intention, I want no id
column and the code
column as a primary key.